Files
export-xlsx/build/app/restapi/embedded_spec.go
Nathan Coad 8a65fcf6ef
All checks were successful
continuous-integration/drone/push Build is passing
functionbuilder again
2023-11-21 14:23:00 +11:00

445 lines
14 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package restapi
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
)
var (
// SwaggerJSON embedded version of the swagger document used at generation time
SwaggerJSON json.RawMessage
// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
FlatSwaggerJSON json.RawMessage
)
func init() {
SwaggerJSON = json.RawMessage([]byte(`{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"swagger": "2.0",
"info": {
"description": "Transform json input to xlsx spreadsheet",
"title": "export-xlsx",
"version": "1.0",
"x-direktiv-meta": {
"categories": [
"unknown"
],
"container": "registry.coadcorp.com/export-xlsx:1.0",
"issues": "https://git.coadcorp.com/nathan/export-xlsx/issues",
"license": "[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)",
"long-description": "Transform json input to excel spreadsheet via json2excel command",
"maintainer": "[nathan.coad@dell.com](nathan.coad@dell.com)",
"url": "https://git.coadcorp.com/nathan/export-xls"
}
},
"paths": {
"/": {
"post": {
"parameters": [
{
"type": "string",
"default": "development",
"description": "direktiv action id is an UUID. \nFor development it can be set to 'development'\n",
"name": "Direktiv-ActionID",
"in": "header"
},
{
"type": "string",
"default": "/tmp",
"description": "direktiv temp dir is the working directory for that request\nFor development it can be set to e.g. '/tmp'\n",
"name": "Direktiv-TempDir",
"in": "header"
},
{
"name": "body",
"in": "body",
"schema": {
"type": "object",
"required": [
"out-filename"
],
"properties": {
"out-filename": {
"description": "the filename of the output spreadsheet",
"type": "string",
"default": "output.xlsx"
},
"sheets": {
"description": "Array of worksheets to create in spreadsheet",
"type": "array",
"items": {
"type": "object",
"properties": {
"infile": {
"description": "Name of the json input file to utilise",
"type": "string"
},
"input-file": {
"description": "File to create before running commands",
"type": "array",
"default": null,
"items": {
"$ref": "#/definitions/direktivFile"
}
},
"worksheet-name": {
"description": "Label for the worksheet created in the spreadsheet",
"type": "string",
"default": "Sheet1"
}
}
}
}
}
}
}
],
"responses": {
"200": {
"description": "List of executed commands.",
"schema": {
"type": "object",
"properties": {
"export-excel": {
"type": "string"
}
},
"additionalProperties": false
},
"examples": {
"export-excel": "{\"export-excel\": \"JVBERi0xLjUKJdDUxdgKNSAwIG9iago8PAov==\"}"
}
},
"default": {
"description": "generic error response",
"schema": {
"$ref": "#/definitions/error"
},
"headers": {
"Direktiv-ErrorCode": {
"type": "string"
},
"Direktiv-ErrorMessage": {
"type": "string"
}
}
}
},
"x-direktiv": {
"cmds": [
{
"action": "foreach",
"exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.WorksheetName }}\" -outputFilename '{{ .OutFilename }}'",
"loop": ".Sheets",
"print": true,
"silent": false
},
{
"action": "exec",
"exec": "base64 -w 0 {{ .OutFilename }}"
}
],
"output": "{\n \"export-excel\": {{ (index . 1).result | toJson }}\n}\n"
},
"x-direktiv-errors": {
"io.direktiv.command.error": "Command execution failed",
"io.direktiv.output.error": "Template error for output generation of the service",
"io.direktiv.ri.error": "Can not create information object from request"
},
"x-direktiv-examples": [
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n out-filename: example.xlsx\n sheets:\n - sheet:\n worksheet-name: \"TestSpreadsheet\"\n input-file:\n - name: input.json\n data: |\n jq(.input)",
"title": "Basic"
},
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n out-filename: example.xlsx \n sheets:\n - sheet:\n worksheet-name: \"TestSpreadsheet\"\n input-file:\n - name: input.json\n data: |\n jq(.array | {input: . } | tostring ) ",
"title": "Use jq to add a parent key 'input' containing array of objects"
}
],
"x-direktiv-function": "functions:\n- id: export-xlsx\n image: registry.coadcorp.com/export-xlsx:1.0\n type: knative-workflow",
"x-direktiv-secrets": [
{
"description": "This is a secret value",
"name": "export-xlsxSecret"
}
]
},
"delete": {
"parameters": [
{
"type": "string",
"description": "On cancel Direktiv sends a DELETE request to\nthe action with id in the header\n",
"name": "Direktiv-ActionID",
"in": "header"
}
],
"responses": {
"200": {
"description": ""
}
},
"x-direktiv": {
"cancel": "echo 'cancel {{ .DirektivActionID }}'"
}
}
}
},
"definitions": {
"direktivFile": {
"type": "object",
"x-go-type": {
"import": {
"package": "github.com/direktiv/apps/go/pkg/apps"
},
"type": "DirektivFile"
}
},
"error": {
"type": "object",
"required": [
"errorCode",
"errorMessage"
],
"properties": {
"errorCode": {
"type": "string"
},
"errorMessage": {
"type": "string"
}
}
}
}
}`))
FlatSwaggerJSON = json.RawMessage([]byte(`{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"swagger": "2.0",
"info": {
"description": "Transform json input to xlsx spreadsheet",
"title": "export-xlsx",
"version": "1.0",
"x-direktiv-meta": {
"categories": [
"unknown"
],
"container": "registry.coadcorp.com/export-xlsx:1.0",
"issues": "https://git.coadcorp.com/nathan/export-xlsx/issues",
"license": "[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)",
"long-description": "Transform json input to excel spreadsheet via json2excel command",
"maintainer": "[nathan.coad@dell.com](nathan.coad@dell.com)",
"url": "https://git.coadcorp.com/nathan/export-xls"
}
},
"paths": {
"/": {
"post": {
"parameters": [
{
"type": "string",
"default": "development",
"description": "direktiv action id is an UUID. \nFor development it can be set to 'development'\n",
"name": "Direktiv-ActionID",
"in": "header"
},
{
"type": "string",
"default": "/tmp",
"description": "direktiv temp dir is the working directory for that request\nFor development it can be set to e.g. '/tmp'\n",
"name": "Direktiv-TempDir",
"in": "header"
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/postParamsBody"
}
}
],
"responses": {
"200": {
"description": "List of executed commands.",
"schema": {
"$ref": "#/definitions/postOKBody"
},
"examples": {
"export-excel": "{\"export-excel\": \"JVBERi0xLjUKJdDUxdgKNSAwIG9iago8PAov==\"}"
}
},
"default": {
"description": "generic error response",
"schema": {
"$ref": "#/definitions/error"
},
"headers": {
"Direktiv-ErrorCode": {
"type": "string"
},
"Direktiv-ErrorMessage": {
"type": "string"
}
}
}
},
"x-direktiv": {
"cmds": [
{
"action": "foreach",
"exec": "/bin/json2excel -inputJson {{- if eq (deref .Item.Infile) \"\" }} \"input.json\" {{- else }} {{ .Item.Infile }} {{- end }} -worksheetName \"{{ .Item.WorksheetName }}\" -outputFilename '{{ .OutFilename }}'",
"loop": ".Sheets",
"print": true,
"silent": false
},
{
"action": "exec",
"exec": "base64 -w 0 {{ .OutFilename }}"
}
],
"output": "{\n \"export-excel\": {{ (index . 1).result | toJson }}\n}\n"
},
"x-direktiv-errors": {
"io.direktiv.command.error": "Command execution failed",
"io.direktiv.output.error": "Template error for output generation of the service",
"io.direktiv.ri.error": "Can not create information object from request"
},
"x-direktiv-examples": [
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n out-filename: example.xlsx\n sheets:\n - sheet:\n worksheet-name: \"TestSpreadsheet\"\n input-file:\n - name: input.json\n data: |\n jq(.input)",
"title": "Basic"
},
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n out-filename: example.xlsx \n sheets:\n - sheet:\n worksheet-name: \"TestSpreadsheet\"\n input-file:\n - name: input.json\n data: |\n jq(.array | {input: . } | tostring ) ",
"title": "Use jq to add a parent key 'input' containing array of objects"
}
],
"x-direktiv-function": "functions:\n- id: export-xlsx\n image: registry.coadcorp.com/export-xlsx:1.0\n type: knative-workflow",
"x-direktiv-secrets": [
{
"description": "This is a secret value",
"name": "export-xlsxSecret"
}
]
},
"delete": {
"parameters": [
{
"type": "string",
"description": "On cancel Direktiv sends a DELETE request to\nthe action with id in the header\n",
"name": "Direktiv-ActionID",
"in": "header"
}
],
"responses": {
"200": {
"description": ""
}
},
"x-direktiv": {
"cancel": "echo 'cancel {{ .DirektivActionID }}'"
}
}
}
},
"definitions": {
"direktivFile": {
"type": "object",
"x-go-type": {
"import": {
"package": "github.com/direktiv/apps/go/pkg/apps"
},
"type": "DirektivFile"
}
},
"error": {
"type": "object",
"required": [
"errorCode",
"errorMessage"
],
"properties": {
"errorCode": {
"type": "string"
},
"errorMessage": {
"type": "string"
}
}
},
"postOKBody": {
"type": "object",
"properties": {
"export-excel": {
"type": "string"
}
},
"additionalProperties": false,
"x-go-gen-location": "operations"
},
"postParamsBody": {
"type": "object",
"required": [
"out-filename"
],
"properties": {
"out-filename": {
"description": "the filename of the output spreadsheet",
"type": "string",
"default": "output.xlsx"
},
"sheets": {
"description": "Array of worksheets to create in spreadsheet",
"type": "array",
"items": {
"$ref": "#/definitions/postParamsBodySheetsItems"
}
}
},
"x-go-gen-location": "operations"
},
"postParamsBodySheetsItems": {
"type": "object",
"properties": {
"infile": {
"description": "Name of the json input file to utilise",
"type": "string"
},
"input-file": {
"description": "File to create before running commands",
"type": "array",
"default": [],
"items": {
"$ref": "#/definitions/direktivFile"
}
},
"worksheet-name": {
"description": "Label for the worksheet created in the spreadsheet",
"type": "string",
"default": "Sheet1"
}
},
"x-go-gen-location": "operations"
}
}
}`))
}