forked from loafle/openapi-generator-original
[Style][Go] standardize the format of mustache (tiny change) (#17363)
* fix: change indent style to tab in the mustache to generate Go code * docs: standardize the language names for code blocks * docs: change indent style to tab in the code blocks * update: regenerate samples * `./bin/generate-samples.sh ./bin/configs/*.yaml`
This commit is contained in:
parent
10da7a3c5a
commit
004c7e8c8d
@ -1,9 +1,9 @@
|
|||||||
package handlers
|
package handlers
|
||||||
{{#operations}}
|
{{#operations}}
|
||||||
import (
|
import (
|
||||||
"{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/models"
|
"{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/models"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"net/http"
|
"net/http"
|
||||||
){{#operation}}
|
){{#operation}}
|
||||||
|
|
||||||
// {{nickname}} - {{{summary}}}
|
// {{nickname}} - {{{summary}}}
|
||||||
@ -11,8 +11,8 @@ import (
|
|||||||
// Deprecated
|
// Deprecated
|
||||||
{{/isDeprecated}}
|
{{/isDeprecated}}
|
||||||
func (c *Container) {{operationId}}(ctx echo.Context) error {
|
func (c *Container) {{operationId}}(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
{{/operation}}{{/operations}}
|
{{/operation}}{{/operations}}
|
||||||
|
@ -6,6 +6,6 @@ type Container struct {
|
|||||||
|
|
||||||
// NewContainer returns an empty or an initialized container for your handlers.
|
// NewContainer returns an empty or an initialized container for your handlers.
|
||||||
func NewContainer() (Container, error) {
|
func NewContainer() (Container, error) {
|
||||||
c := Container{}
|
c := Container{}
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
@ -2,5 +2,5 @@ package models
|
|||||||
|
|
||||||
// HelloWorld is a sample data structure to make sure each endpoint return something.
|
// HelloWorld is a sample data structure to make sure each endpoint return something.
|
||||||
type HelloWorld struct {
|
type HelloWorld struct {
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
e := echo.New()
|
e := echo.New()
|
||||||
|
|
||||||
//todo: handle the error!
|
//todo: handle the error!
|
||||||
c, _ := handlers.NewContainer()
|
c, _ := handlers.NewContainer()
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
@ -23,4 +23,4 @@ func main() {
|
|||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Logger.Fatal(e.Start(":{{serverPort}}"))
|
e.Logger.Fatal(e.Start(":{{serverPort}}"))
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
|||||||
|
|
||||||
Install the following dependencies:
|
Install the following dependencies:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
go get github.com/stretchr/testify/assert
|
go get github.com/stretchr/testify/assert
|
||||||
{{#hasOAuthMethods}}
|
{{#hasOAuthMethods}}
|
||||||
go get golang.org/x/oauth2
|
go get golang.org/x/oauth2
|
||||||
@ -31,13 +31,13 @@ go get golang.org/x/net/context
|
|||||||
|
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import {{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}"
|
import {{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}"
|
||||||
```
|
```
|
||||||
|
|
||||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ Default configuration comes with `Servers` field that contains server objects as
|
|||||||
|
|
||||||
For using other server than the one defined on index 0 set context value `{{packageName}}.ContextServerIndex` of type `int`.
|
For using other server than the one defined on index 0 set context value `{{packageName}}.ContextServerIndex` of type `int`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerIndex, 1)
|
ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerIndex, 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerInde
|
|||||||
|
|
||||||
Templated server URL is formatted using default variables from configuration or from context value `{{packageName}}.ContextServerVariables` of type `map[string]string`.
|
Templated server URL is formatted using default variables from configuration or from context value `{{packageName}}.ContextServerVariables` of type `map[string]string`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerVariables, map[string]string{
|
ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerVariables, map[string]string{
|
||||||
"basePath": "v2",
|
"basePath": "v2",
|
||||||
})
|
})
|
||||||
@ -71,7 +71,7 @@ Each operation can use different server URL defined using `OperationServers` map
|
|||||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
||||||
Similar rules for overriding default operation server index and variables applies by using `{{packageName}}.ContextOperationServerIndices` and `{{packageName}}.ContextOperationServerVariables` context maps.
|
Similar rules for overriding default operation server index and variables applies by using `{{packageName}}.ContextOperationServerIndices` and `{{packageName}}.ContextOperationServerVariables` context maps.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), {{packageName}}.ContextOperationServerIndices, map[string]int{
|
ctx := context.WithValue(context.Background(), {{packageName}}.ContextOperationServerIndices, map[string]int{
|
||||||
"{classname}Service.{nickname}": 2,
|
"{classname}Service.{nickname}": 2,
|
||||||
})
|
})
|
||||||
@ -112,7 +112,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(
|
auth := context.WithValue(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
{{packageName}}.ContextAPIKeys,
|
{{packageName}}.ContextAPIKeys,
|
||||||
@ -130,7 +130,7 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "BEARER_TOKEN_STRING")
|
auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "BEARER_TOKEN_STRING")
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
@ -141,10 +141,10 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), {{packageName}}.ContextBasicAuth, {{packageName}}.BasicAuth{
|
auth := context.WithValue(context.Background(), {{packageName}}.ContextBasicAuth, {{packageName}}.BasicAuth{
|
||||||
UserName: "username",
|
UserName: "username",
|
||||||
Password: "password",
|
Password: "password",
|
||||||
})
|
})
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
@ -155,7 +155,7 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
authConfig := {{packageName}}.HttpSignatureAuth{
|
authConfig := {{packageName}}.HttpSignatureAuth{
|
||||||
KeyId: "my-key-id",
|
KeyId: "my-key-id",
|
||||||
PrivateKeyPath: "rsa.pem",
|
PrivateKeyPath: "rsa.pem",
|
||||||
@ -193,14 +193,14 @@ Example
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "ACCESSTOKENSTRING")
|
auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "ACCESSTOKENSTRING")
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
|
|
||||||
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import "golang.org/x/oauth2"
|
import "golang.org/x/oauth2"
|
||||||
|
|
||||||
/* Perform OAuth2 round trip request and obtain a token */
|
/* Perform OAuth2 round trip request and obtain a token */
|
||||||
|
@ -26,31 +26,31 @@ Method | HTTP request | Description
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
{{#vendorExtensions.x-go-import}}
|
{{#vendorExtensions.x-go-import}}
|
||||||
{{{vendorExtensions.x-go-import}}}
|
{{{vendorExtensions.x-go-import}}}
|
||||||
{{/vendorExtensions.x-go-import}}
|
{{/vendorExtensions.x-go-import}}
|
||||||
{{goImportAlias}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}"
|
{{goImportAlias}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
{{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
{{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
|
||||||
configuration := {{goImportAlias}}.NewConfiguration()
|
configuration := {{goImportAlias}}.NewConfiguration()
|
||||||
apiClient := {{goImportAlias}}.NewAPIClient(configuration)
|
apiClient := {{goImportAlias}}.NewAPIClient(configuration)
|
||||||
{{#returnType}}resp, {{/returnType}}r, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute()
|
{{#returnType}}resp, {{/returnType}}r, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
{{#returnType}}
|
{{#returnType}}
|
||||||
// response from `{{operationId}}`: {{{.}}}
|
// response from `{{operationId}}`: {{{.}}}
|
||||||
fmt.Fprintf(os.Stdout, "Response from `{{classname}}.{{operationId}}`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `{{classname}}.{{operationId}}`: %v\n", resp)
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) {
|
|||||||
{{/hasRequired}}
|
{{/hasRequired}}
|
||||||
{{/isAdditionalPropertiesTrue}}
|
{{/isAdditionalPropertiesTrue}}
|
||||||
{{#hasRequired}}
|
{{#hasRequired}}
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -13,20 +13,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
|
|||||||
|
|
||||||
Install the following dependencies:
|
Install the following dependencies:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
go get github.com/stretchr/testify/assert
|
go get github.com/stretchr/testify/assert
|
||||||
go get golang.org/x/net/context
|
go get golang.org/x/net/context
|
||||||
```
|
```
|
||||||
|
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"
|
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
```
|
```
|
||||||
|
|
||||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ Default configuration comes with `Servers` field that contains server objects as
|
|||||||
|
|
||||||
For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`.
|
For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)
|
ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)
|
|||||||
|
|
||||||
Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`.
|
Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
|
ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
|
||||||
"basePath": "v2",
|
"basePath": "v2",
|
||||||
})
|
})
|
||||||
@ -60,7 +60,7 @@ Each operation can use different server URL defined using `OperationServers` map
|
|||||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
||||||
Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps.
|
Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
|
ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
|
||||||
"{classname}Service.{nickname}": 2,
|
"{classname}Service.{nickname}": 2,
|
||||||
})
|
})
|
||||||
@ -126,10 +126,10 @@ Authentication schemes defined for the API:
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), openapi.ContextBasicAuth, openapi.BasicAuth{
|
auth := context.WithValue(context.Background(), openapi.ContextBasicAuth, openapi.BasicAuth{
|
||||||
UserName: "username",
|
UserName: "username",
|
||||||
Password: "password",
|
Password: "password",
|
||||||
})
|
})
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
@ -140,7 +140,7 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), openapi.ContextAccessToken, "BEARER_TOKEN_STRING")
|
auth := context.WithValue(context.Background(), openapi.ContextAccessToken, "BEARER_TOKEN_STRING")
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
|
@ -23,23 +23,23 @@ To test HTTP basic authentication
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.AuthAPI.TestAuthHttpBasic(context.Background()).Execute()
|
resp, r, err := apiClient.AuthAPI.TestAuthHttpBasic(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBasic``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBasic``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestAuthHttpBasic`: string
|
// response from `TestAuthHttpBasic`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBasic`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBasic`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -84,23 +84,23 @@ To test HTTP bearer authentication
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.AuthAPI.TestAuthHttpBearer(context.Background()).Execute()
|
resp, r, err := apiClient.AuthAPI.TestAuthHttpBearer(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBearer``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBearer``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestAuthHttpBearer`: string
|
// response from `TestAuthHttpBearer`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBearer`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBearer`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,23 +29,23 @@ Test binary (gif) response body
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestBinaryGif(context.Background()).Execute()
|
resp, r, err := apiClient.BodyAPI.TestBinaryGif(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBinaryGif``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBinaryGif``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestBinaryGif`: *os.File
|
// response from `TestBinaryGif`: *os.File
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBinaryGif`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBinaryGif`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -90,24 +90,24 @@ Test body parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := os.NewFile(1234, "some_file") // *os.File | (optional)
|
body := os.NewFile(1234, "some_file") // *os.File | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestBodyApplicationOctetstreamBinary(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.BodyAPI.TestBodyApplicationOctetstreamBinary(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyApplicationOctetstreamBinary``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyApplicationOctetstreamBinary``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestBodyApplicationOctetstreamBinary`: string
|
// response from `TestBodyApplicationOctetstreamBinary`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyApplicationOctetstreamBinary`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyApplicationOctetstreamBinary`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -156,24 +156,24 @@ Test array of binary in multipart mime
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
files := []*os.File{"TODO"} // []*os.File |
|
files := []*os.File{"TODO"} // []*os.File |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestBodyMultipartFormdataArrayOfBinary(context.Background()).Files(files).Execute()
|
resp, r, err := apiClient.BodyAPI.TestBodyMultipartFormdataArrayOfBinary(context.Background()).Files(files).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyMultipartFormdataArrayOfBinary``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyMultipartFormdataArrayOfBinary``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestBodyMultipartFormdataArrayOfBinary`: string
|
// response from `TestBodyMultipartFormdataArrayOfBinary`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyMultipartFormdataArrayOfBinary`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyMultipartFormdataArrayOfBinary`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -222,24 +222,24 @@ Test body parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional)
|
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestEchoBodyAllOfPet(context.Background()).Pet(pet).Execute()
|
resp, r, err := apiClient.BodyAPI.TestEchoBodyAllOfPet(context.Background()).Pet(pet).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyAllOfPet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyAllOfPet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestEchoBodyAllOfPet`: Pet
|
// response from `TestEchoBodyAllOfPet`: Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyAllOfPet`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyAllOfPet`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -288,24 +288,24 @@ Test free form object
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := map[string]interface{}{ ... } // map[string]interface{} | Free form object (optional)
|
body := map[string]interface{}{ ... } // map[string]interface{} | Free form object (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestEchoBodyFreeFormObjectResponseString(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.BodyAPI.TestEchoBodyFreeFormObjectResponseString(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyFreeFormObjectResponseString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyFreeFormObjectResponseString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestEchoBodyFreeFormObjectResponseString`: string
|
// response from `TestEchoBodyFreeFormObjectResponseString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyFreeFormObjectResponseString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyFreeFormObjectResponseString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -354,24 +354,24 @@ Test body parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional)
|
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestEchoBodyPet(context.Background()).Pet(pet).Execute()
|
resp, r, err := apiClient.BodyAPI.TestEchoBodyPet(context.Background()).Pet(pet).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestEchoBodyPet`: Pet
|
// response from `TestEchoBodyPet`: Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPet`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPet`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -420,24 +420,24 @@ Test empty response body
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional)
|
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestEchoBodyPetResponseString(context.Background()).Pet(pet).Execute()
|
resp, r, err := apiClient.BodyAPI.TestEchoBodyPetResponseString(context.Background()).Pet(pet).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPetResponseString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPetResponseString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestEchoBodyPetResponseString`: string
|
// response from `TestEchoBodyPetResponseString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPetResponseString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPetResponseString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -486,24 +486,24 @@ Test empty json (request body)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
tag := *openapiclient.NewTag() // Tag | Tag object (optional)
|
tag := *openapiclient.NewTag() // Tag | Tag object (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.BodyAPI.TestEchoBodyTagResponseString(context.Background()).Tag(tag).Execute()
|
resp, r, err := apiClient.BodyAPI.TestEchoBodyTagResponseString(context.Background()).Tag(tag).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyTagResponseString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyTagResponseString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestEchoBodyTagResponseString`: string
|
// response from `TestEchoBodyTagResponseString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyTagResponseString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyTagResponseString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -23,26 +23,26 @@ Test form parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
integerForm := int32(56) // int32 | (optional)
|
integerForm := int32(56) // int32 | (optional)
|
||||||
booleanForm := true // bool | (optional)
|
booleanForm := true // bool | (optional)
|
||||||
stringForm := "stringForm_example" // string | (optional)
|
stringForm := "stringForm_example" // string | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FormAPI.TestFormIntegerBooleanString(context.Background()).IntegerForm(integerForm).BooleanForm(booleanForm).StringForm(stringForm).Execute()
|
resp, r, err := apiClient.FormAPI.TestFormIntegerBooleanString(context.Background()).IntegerForm(integerForm).BooleanForm(booleanForm).StringForm(stringForm).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormIntegerBooleanString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormIntegerBooleanString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestFormIntegerBooleanString`: string
|
// response from `TestFormIntegerBooleanString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormIntegerBooleanString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormIntegerBooleanString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -93,29 +93,29 @@ Test form parameter(s) for oneOf schema
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
form1 := "form1_example" // string | (optional)
|
form1 := "form1_example" // string | (optional)
|
||||||
form2 := int32(56) // int32 | (optional)
|
form2 := int32(56) // int32 | (optional)
|
||||||
form3 := "form3_example" // string | (optional)
|
form3 := "form3_example" // string | (optional)
|
||||||
form4 := true // bool | (optional)
|
form4 := true // bool | (optional)
|
||||||
id := int64(789) // int64 | (optional)
|
id := int64(789) // int64 | (optional)
|
||||||
name := "name_example" // string | (optional)
|
name := "name_example" // string | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FormAPI.TestFormOneof(context.Background()).Form1(form1).Form2(form2).Form3(form3).Form4(form4).Id(id).Name(name).Execute()
|
resp, r, err := apiClient.FormAPI.TestFormOneof(context.Background()).Form1(form1).Form2(form2).Form3(form3).Form4(form4).Id(id).Name(name).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormOneof``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormOneof``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestFormOneof`: string
|
// response from `TestFormOneof`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormOneof`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormOneof`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -22,28 +22,28 @@ Test header parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
integerHeader := int32(56) // int32 | (optional)
|
integerHeader := int32(56) // int32 | (optional)
|
||||||
booleanHeader := true // bool | (optional)
|
booleanHeader := true // bool | (optional)
|
||||||
stringHeader := "stringHeader_example" // string | (optional)
|
stringHeader := "stringHeader_example" // string | (optional)
|
||||||
enumNonrefStringHeader := "enumNonrefStringHeader_example" // string | (optional)
|
enumNonrefStringHeader := "enumNonrefStringHeader_example" // string | (optional)
|
||||||
enumRefStringHeader := openapiclient.StringEnumRef("success") // StringEnumRef | (optional)
|
enumRefStringHeader := openapiclient.StringEnumRef("success") // StringEnumRef | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.HeaderAPI.TestHeaderIntegerBooleanStringEnums(context.Background()).IntegerHeader(integerHeader).BooleanHeader(booleanHeader).StringHeader(stringHeader).EnumNonrefStringHeader(enumNonrefStringHeader).EnumRefStringHeader(enumRefStringHeader).Execute()
|
resp, r, err := apiClient.HeaderAPI.TestHeaderIntegerBooleanStringEnums(context.Background()).IntegerHeader(integerHeader).BooleanHeader(booleanHeader).StringHeader(stringHeader).EnumNonrefStringHeader(enumNonrefStringHeader).EnumRefStringHeader(enumRefStringHeader).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `HeaderAPI.TestHeaderIntegerBooleanStringEnums``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `HeaderAPI.TestHeaderIntegerBooleanStringEnums``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestHeaderIntegerBooleanStringEnums`: string
|
// response from `TestHeaderIntegerBooleanStringEnums`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `HeaderAPI.TestHeaderIntegerBooleanStringEnums`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `HeaderAPI.TestHeaderIntegerBooleanStringEnums`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -22,27 +22,27 @@ Test path parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pathString := "pathString_example" // string |
|
pathString := "pathString_example" // string |
|
||||||
pathInteger := int32(56) // int32 |
|
pathInteger := int32(56) // int32 |
|
||||||
enumNonrefStringPath := "enumNonrefStringPath_example" // string |
|
enumNonrefStringPath := "enumNonrefStringPath_example" // string |
|
||||||
enumRefStringPath := openapiclient.StringEnumRef("success") // StringEnumRef |
|
enumRefStringPath := openapiclient.StringEnumRef("success") // StringEnumRef |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(context.Background(), pathString, pathInteger, enumNonrefStringPath, enumRefStringPath).Execute()
|
resp, r, err := apiClient.PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(context.Background(), pathString, pathInteger, enumNonrefStringPath, enumRefStringPath).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: string
|
// response from `TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,25 +29,25 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
enumNonrefStringQuery := "enumNonrefStringQuery_example" // string | (optional)
|
enumNonrefStringQuery := "enumNonrefStringQuery_example" // string | (optional)
|
||||||
enumRefStringQuery := openapiclient.StringEnumRef("success") // StringEnumRef | (optional)
|
enumRefStringQuery := openapiclient.StringEnumRef("success") // StringEnumRef | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestEnumRefString(context.Background()).EnumNonrefStringQuery(enumNonrefStringQuery).EnumRefStringQuery(enumRefStringQuery).Execute()
|
resp, r, err := apiClient.QueryAPI.TestEnumRefString(context.Background()).EnumNonrefStringQuery(enumNonrefStringQuery).EnumRefStringQuery(enumRefStringQuery).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestEnumRefString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestEnumRefString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestEnumRefString`: string
|
// response from `TestEnumRefString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestEnumRefString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestEnumRefString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -97,27 +97,27 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
datetimeQuery := time.Now() // time.Time | (optional)
|
datetimeQuery := time.Now() // time.Time | (optional)
|
||||||
dateQuery := time.Now() // string | (optional)
|
dateQuery := time.Now() // string | (optional)
|
||||||
stringQuery := "stringQuery_example" // string | (optional)
|
stringQuery := "stringQuery_example" // string | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestQueryDatetimeDateString(context.Background()).DatetimeQuery(datetimeQuery).DateQuery(dateQuery).StringQuery(stringQuery).Execute()
|
resp, r, err := apiClient.QueryAPI.TestQueryDatetimeDateString(context.Background()).DatetimeQuery(datetimeQuery).DateQuery(dateQuery).StringQuery(stringQuery).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryDatetimeDateString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryDatetimeDateString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestQueryDatetimeDateString`: string
|
// response from `TestQueryDatetimeDateString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryDatetimeDateString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryDatetimeDateString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -168,26 +168,26 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
integerQuery := int32(56) // int32 | (optional)
|
integerQuery := int32(56) // int32 | (optional)
|
||||||
booleanQuery := true // bool | (optional)
|
booleanQuery := true // bool | (optional)
|
||||||
stringQuery := "stringQuery_example" // string | (optional)
|
stringQuery := "stringQuery_example" // string | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestQueryIntegerBooleanString(context.Background()).IntegerQuery(integerQuery).BooleanQuery(booleanQuery).StringQuery(stringQuery).Execute()
|
resp, r, err := apiClient.QueryAPI.TestQueryIntegerBooleanString(context.Background()).IntegerQuery(integerQuery).BooleanQuery(booleanQuery).StringQuery(stringQuery).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryIntegerBooleanString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryIntegerBooleanString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestQueryIntegerBooleanString`: string
|
// response from `TestQueryIntegerBooleanString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryIntegerBooleanString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryIntegerBooleanString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -238,24 +238,24 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional)
|
queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute()
|
resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestQueryStyleDeepObjectExplodeTrueObject`: string
|
// response from `TestQueryStyleDeepObjectExplodeTrueObject`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -304,24 +304,24 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
queryObject := *openapiclient.NewTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() // TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter | (optional)
|
queryObject := *openapiclient.NewTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() // TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute()
|
resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: string
|
// response from `TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -370,24 +370,24 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
queryObject := *openapiclient.NewTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | (optional)
|
queryObject := *openapiclient.NewTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueArrayString(context.Background()).QueryObject(queryObject).Execute()
|
resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueArrayString(context.Background()).QueryObject(queryObject).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueArrayString``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueArrayString``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestQueryStyleFormExplodeTrueArrayString`: string
|
// response from `TestQueryStyleFormExplodeTrueArrayString`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueArrayString`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueArrayString`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -436,24 +436,24 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional)
|
queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute()
|
resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObject``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObject``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestQueryStyleFormExplodeTrueObject`: string
|
// response from `TestQueryStyleFormExplodeTrueObject`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObject`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObject`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -502,24 +502,24 @@ Test query parameter(s)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
queryObject := *openapiclient.NewDataQuery() // DataQuery | (optional)
|
queryObject := *openapiclient.NewDataQuery() // DataQuery | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute()
|
resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestQueryStyleFormExplodeTrueObjectAllOf`: string
|
// response from `TestQueryStyleFormExplodeTrueObjectAllOf`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -13,7 +13,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
|
|||||||
|
|
||||||
Install the following dependencies:
|
Install the following dependencies:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
go get github.com/stretchr/testify/assert
|
go get github.com/stretchr/testify/assert
|
||||||
go get golang.org/x/oauth2
|
go get golang.org/x/oauth2
|
||||||
go get golang.org/x/net/context
|
go get golang.org/x/net/context
|
||||||
@ -21,13 +21,13 @@ go get golang.org/x/net/context
|
|||||||
|
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"
|
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
```
|
```
|
||||||
|
|
||||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ Default configuration comes with `Servers` field that contains server objects as
|
|||||||
|
|
||||||
For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`.
|
For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
|||||||
|
|
||||||
Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`.
|
Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{
|
ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{
|
||||||
"basePath": "v2",
|
"basePath": "v2",
|
||||||
})
|
})
|
||||||
@ -61,7 +61,7 @@ Each operation can use different server URL defined using `OperationServers` map
|
|||||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
||||||
Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps.
|
Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{
|
ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{
|
||||||
"{classname}Service.{nickname}": 2,
|
"{classname}Service.{nickname}": 2,
|
||||||
})
|
})
|
||||||
@ -182,14 +182,14 @@ Authentication schemes defined for the API:
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING")
|
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING")
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
|
|
||||||
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import "golang.org/x/oauth2"
|
import "golang.org/x/oauth2"
|
||||||
|
|
||||||
/* Perform OAuth2 round trip request and obtain a token */
|
/* Perform OAuth2 round trip request and obtain a token */
|
||||||
@ -209,7 +209,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(
|
auth := context.WithValue(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
petstore.ContextAPIKeys,
|
petstore.ContextAPIKeys,
|
||||||
@ -230,7 +230,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(
|
auth := context.WithValue(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
petstore.ContextAPIKeys,
|
petstore.ContextAPIKeys,
|
||||||
@ -247,10 +247,10 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{
|
auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{
|
||||||
UserName: "username",
|
UserName: "username",
|
||||||
Password: "password",
|
Password: "password",
|
||||||
})
|
})
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
|
@ -22,25 +22,25 @@ To test special tags
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
uuidTest := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | to test uuid example value
|
uuidTest := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | to test uuid example value
|
||||||
body := *openapiclient.NewClient() // Client | client model
|
body := *openapiclient.NewClient() // Client | client model
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).UuidTest(uuidTest).Body(body).Execute()
|
resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).UuidTest(uuidTest).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `Call123TestSpecialTags`: Client
|
// response from `Call123TestSpecialTags`: Client
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -35,22 +35,22 @@ creates an XmlItem
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
xmlItem := *openapiclient.NewXmlItem() // XmlItem | XmlItem Body
|
xmlItem := *openapiclient.NewXmlItem() // XmlItem | XmlItem Body
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.CreateXmlItem(context.Background()).XmlItem(xmlItem).Execute()
|
r, err := apiClient.FakeAPI.CreateXmlItem(context.Background()).XmlItem(xmlItem).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.CreateXmlItem``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.CreateXmlItem``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -99,24 +99,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := true // bool | Input boolean as post body (optional)
|
body := true // bool | Input boolean as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterBooleanSerialize`: bool
|
// response from `FakeOuterBooleanSerialize`: bool
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -165,24 +165,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional)
|
body := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterCompositeSerialize`: OuterComposite
|
// response from `FakeOuterCompositeSerialize`: OuterComposite
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -231,24 +231,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := float32(8.14) // float32 | Input number as post body (optional)
|
body := float32(8.14) // float32 | Input number as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterNumberSerialize`: float32
|
// response from `FakeOuterNumberSerialize`: float32
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -297,24 +297,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := "body_example" // string | Input string as post body (optional)
|
body := "body_example" // string | Input string as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterStringSerialize`: string
|
// response from `FakeOuterStringSerialize`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -363,22 +363,22 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass |
|
body := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).Body(body).Execute()
|
r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -425,23 +425,23 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
query := "query_example" // string |
|
query := "query_example" // string |
|
||||||
body := *openapiclient.NewUser() // User |
|
body := *openapiclient.NewUser() // User |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).Body(body).Execute()
|
r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -491,24 +491,24 @@ To test \"client\" model
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewClient() // Client | client model
|
body := *openapiclient.NewClient() // Client | client model
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestClientModel`: Client
|
// response from `TestClientModel`: Client
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -557,36 +557,36 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
number := float32(8.14) // float32 | None
|
number := float32(8.14) // float32 | None
|
||||||
double := float64(1.2) // float64 | None
|
double := float64(1.2) // float64 | None
|
||||||
patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None
|
patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None
|
||||||
byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None
|
byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None
|
||||||
integer := int32(56) // int32 | None (optional)
|
integer := int32(56) // int32 | None (optional)
|
||||||
int32_ := int32(56) // int32 | None (optional)
|
int32_ := int32(56) // int32 | None (optional)
|
||||||
int64_ := int64(789) // int64 | None (optional)
|
int64_ := int64(789) // int64 | None (optional)
|
||||||
float := float32(3.4) // float32 | None (optional)
|
float := float32(3.4) // float32 | None (optional)
|
||||||
string_ := "string__example" // string | None (optional)
|
string_ := "string__example" // string | None (optional)
|
||||||
binary := os.NewFile(1234, "some_file") // *os.File | None (optional)
|
binary := os.NewFile(1234, "some_file") // *os.File | None (optional)
|
||||||
date := time.Now() // string | None (optional)
|
date := time.Now() // string | None (optional)
|
||||||
dateTime := time.Now() // time.Time | None (optional)
|
dateTime := time.Now() // time.Time | None (optional)
|
||||||
password := "password_example" // string | None (optional)
|
password := "password_example" // string | None (optional)
|
||||||
callback := "callback_example" // string | None (optional)
|
callback := "callback_example" // string | None (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute()
|
r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -648,29 +648,29 @@ To test enum parameters
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional)
|
enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional)
|
||||||
enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg")
|
enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg")
|
||||||
enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional)
|
enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional)
|
||||||
enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg")
|
enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg")
|
||||||
enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional)
|
enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional)
|
||||||
enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional)
|
enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional)
|
||||||
enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$")
|
enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$")
|
||||||
enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg")
|
enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg")
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute()
|
r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -726,27 +726,27 @@ Fake endpoint to test group parameters (optional)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
requiredStringGroup := int32(56) // int32 | Required String in group parameters
|
requiredStringGroup := int32(56) // int32 | Required String in group parameters
|
||||||
requiredBooleanGroup := true // bool | Required Boolean in group parameters
|
requiredBooleanGroup := true // bool | Required Boolean in group parameters
|
||||||
requiredInt64Group := int64(789) // int64 | Required Integer in group parameters
|
requiredInt64Group := int64(789) // int64 | Required Integer in group parameters
|
||||||
stringGroup := int32(56) // int32 | String in group parameters (optional)
|
stringGroup := int32(56) // int32 | String in group parameters (optional)
|
||||||
booleanGroup := true // bool | Boolean in group parameters (optional)
|
booleanGroup := true // bool | Boolean in group parameters (optional)
|
||||||
int64Group := int64(789) // int64 | Integer in group parameters (optional)
|
int64Group := int64(789) // int64 | Integer in group parameters (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute()
|
r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -798,22 +798,22 @@ test inline additionalProperties
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
param := map[string]string{"key": "Inner_example"} // map[string]string | request body
|
param := map[string]string{"key": "Inner_example"} // map[string]string | request body
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).Param(param).Execute()
|
r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).Param(param).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -860,23 +860,23 @@ test json serialization of form data
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
param := "param_example" // string | field1
|
param := "param_example" // string | field1
|
||||||
param2 := "param2_example" // string | field2
|
param2 := "param2_example" // string | field2
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute()
|
r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -926,26 +926,26 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pipe := []string{"Inner_example"} // []string |
|
pipe := []string{"Inner_example"} // []string |
|
||||||
ioutil := []string{"Inner_example"} // []string |
|
ioutil := []string{"Inner_example"} // []string |
|
||||||
http := []string{"Inner_example"} // []string |
|
http := []string{"Inner_example"} // []string |
|
||||||
url := []string{"Inner_example"} // []string |
|
url := []string{"Inner_example"} // []string |
|
||||||
context := []string{"Inner_example"} // []string |
|
context := []string{"Inner_example"} // []string |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute()
|
r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -22,24 +22,24 @@ To test class name in snake case
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewClient() // Client | client model
|
body := *openapiclient.NewClient() // Client | client model
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestClassname`: Client
|
// response from `TestClassname`: Client
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -28,22 +28,22 @@ Add a new pet to the store
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.AddPet(context.Background()).Body(body).Execute()
|
r, err := apiClient.PetAPI.AddPet(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -90,23 +90,23 @@ Deletes a pet
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | Pet id to delete
|
petId := int64(789) // int64 | Pet id to delete
|
||||||
apiKey := "apiKey_example" // string | (optional)
|
apiKey := "apiKey_example" // string | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute()
|
r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -160,24 +160,24 @@ Finds Pets by status
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
status := []string{"Status_example"} // []string | Status values that need to be considered for filter
|
status := []string{"Status_example"} // []string | Status values that need to be considered for filter
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute()
|
resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FindPetsByStatus`: []Pet
|
// response from `FindPetsByStatus`: []Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -226,24 +226,24 @@ Finds Pets by tags
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
tags := []string{"Inner_example"} // []string | Tags to filter by
|
tags := []string{"Inner_example"} // []string | Tags to filter by
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute()
|
resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FindPetsByTags`: []Pet
|
// response from `FindPetsByTags`: []Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -292,24 +292,24 @@ Find pet by ID
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet to return
|
petId := int64(789) // int64 | ID of pet to return
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute()
|
resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetPetById`: Pet
|
// response from `GetPetById`: Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -360,22 +360,22 @@ Update an existing pet
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.UpdatePet(context.Background()).Body(body).Execute()
|
r, err := apiClient.PetAPI.UpdatePet(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -422,24 +422,24 @@ Updates a pet in the store with form data
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet that needs to be updated
|
petId := int64(789) // int64 | ID of pet that needs to be updated
|
||||||
name := "name_example" // string | Updated name of the pet (optional)
|
name := "name_example" // string | Updated name of the pet (optional)
|
||||||
status := "status_example" // string | Updated status of the pet (optional)
|
status := "status_example" // string | Updated status of the pet (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute()
|
r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -492,26 +492,26 @@ uploads an image
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet to update
|
petId := int64(789) // int64 | ID of pet to update
|
||||||
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
||||||
file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional)
|
file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute()
|
resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `UploadFile`: ApiResponse
|
// response from `UploadFile`: ApiResponse
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -564,26 +564,26 @@ uploads an image (required)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet to update
|
petId := int64(789) // int64 | ID of pet to update
|
||||||
requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload
|
requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload
|
||||||
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute()
|
resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `UploadFileWithRequiredFile`: ApiResponse
|
// response from `UploadFileWithRequiredFile`: ApiResponse
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -25,22 +25,22 @@ Delete purchase order by ID
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
orderId := "orderId_example" // string | ID of the order that needs to be deleted
|
orderId := "orderId_example" // string | ID of the order that needs to be deleted
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute()
|
r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -93,23 +93,23 @@ Returns pet inventories by status
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute()
|
resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetInventory`: map[string]int32
|
// response from `GetInventory`: map[string]int32
|
||||||
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -154,24 +154,24 @@ Find purchase order by ID
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
orderId := int64(789) // int64 | ID of pet that needs to be fetched
|
orderId := int64(789) // int64 | ID of pet that needs to be fetched
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute()
|
resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetOrderById`: Order
|
// response from `GetOrderById`: Order
|
||||||
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -222,24 +222,24 @@ Place an order for a pet
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewOrder() // Order | order placed for purchasing the pet
|
body := *openapiclient.NewOrder() // Order | order placed for purchasing the pet
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `PlaceOrder`: Order
|
// response from `PlaceOrder`: Order
|
||||||
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,22 +29,22 @@ Create user
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := *openapiclient.NewUser() // User | Created user object
|
body := *openapiclient.NewUser() // User | Created user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.CreateUser(context.Background()).Body(body).Execute()
|
r, err := apiClient.UserAPI.CreateUser(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -91,22 +91,22 @@ Creates list of users with given input array
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).Body(body).Execute()
|
r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -153,22 +153,22 @@ Creates list of users with given input array
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).Body(body).Execute()
|
r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -217,22 +217,22 @@ Delete user
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | The name that needs to be deleted
|
username := "username_example" // string | The name that needs to be deleted
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute()
|
r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -283,24 +283,24 @@ Get user by user name
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | The name that needs to be fetched. Use user1 for testing.
|
username := "username_example" // string | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute()
|
resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetUserByName`: User
|
// response from `GetUserByName`: User
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -351,25 +351,25 @@ Logs user into the system
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | The user name for login
|
username := "username_example" // string | The user name for login
|
||||||
password := "password_example" // string | The password for login in clear text
|
password := "password_example" // string | The password for login in clear text
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute()
|
resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `LoginUser`: string
|
// response from `LoginUser`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -417,21 +417,21 @@ Logs out current logged in user session
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute()
|
r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -476,23 +476,23 @@ Updated user
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | name that need to be deleted
|
username := "username_example" // string | name that need to be deleted
|
||||||
body := *openapiclient.NewUser() // User | Updated user object
|
body := *openapiclient.NewUser() // User | Updated user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).Body(body).Execute()
|
r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ func (o Animal) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Animal) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Animal) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -103,7 +103,7 @@ func (o BigCat) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *BigCat) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *BigCat) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -103,7 +103,7 @@ func (o Cat) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Cat) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Cat) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -120,7 +120,7 @@ func (o Category) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Category) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Category) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -103,7 +103,7 @@ func (o Dog) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Dog) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Dog) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -226,7 +226,7 @@ func (o EnumTest) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -525,7 +525,7 @@ func (o FormatTest) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -190,7 +190,7 @@ func (o Name) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Name) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Name) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -254,7 +254,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -194,7 +194,7 @@ func (o TypeHolderDefault) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *TypeHolderDefault) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *TypeHolderDefault) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -217,7 +217,7 @@ func (o TypeHolderExample) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *TypeHolderExample) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *TypeHolderExample) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -13,20 +13,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
|
|||||||
|
|
||||||
Install the following dependencies:
|
Install the following dependencies:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
go get github.com/stretchr/testify/assert
|
go get github.com/stretchr/testify/assert
|
||||||
go get golang.org/x/net/context
|
go get golang.org/x/net/context
|
||||||
```
|
```
|
||||||
|
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import x_auth_id_alias "github.com/GIT_USER_ID/GIT_REPO_ID"
|
import x_auth_id_alias "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
```
|
```
|
||||||
|
|
||||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ Default configuration comes with `Servers` field that contains server objects as
|
|||||||
|
|
||||||
For using other server than the one defined on index 0 set context value `x_auth_id_alias.ContextServerIndex` of type `int`.
|
For using other server than the one defined on index 0 set context value `x_auth_id_alias.ContextServerIndex` of type `int`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerIndex, 1)
|
ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerIndex, 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerInde
|
|||||||
|
|
||||||
Templated server URL is formatted using default variables from configuration or from context value `x_auth_id_alias.ContextServerVariables` of type `map[string]string`.
|
Templated server URL is formatted using default variables from configuration or from context value `x_auth_id_alias.ContextServerVariables` of type `map[string]string`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerVariables, map[string]string{
|
ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerVariables, map[string]string{
|
||||||
"basePath": "v2",
|
"basePath": "v2",
|
||||||
})
|
})
|
||||||
@ -60,7 +60,7 @@ Each operation can use different server URL defined using `OperationServers` map
|
|||||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
||||||
Similar rules for overriding default operation server index and variables applies by using `x_auth_id_alias.ContextOperationServerIndices` and `x_auth_id_alias.ContextOperationServerVariables` context maps.
|
Similar rules for overriding default operation server index and variables applies by using `x_auth_id_alias.ContextOperationServerIndices` and `x_auth_id_alias.ContextOperationServerVariables` context maps.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextOperationServerIndices, map[string]int{
|
ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextOperationServerIndices, map[string]int{
|
||||||
"{classname}Service.{nickname}": 2,
|
"{classname}Service.{nickname}": 2,
|
||||||
})
|
})
|
||||||
@ -101,7 +101,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(
|
auth := context.WithValue(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
x_auth_id_alias.ContextAPIKeys,
|
x_auth_id_alias.ContextAPIKeys,
|
||||||
@ -122,7 +122,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(
|
auth := context.WithValue(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
x_auth_id_alias.ContextAPIKeys,
|
x_auth_id_alias.ContextAPIKeys,
|
||||||
|
@ -25,23 +25,23 @@ Use any API key
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UsageAPI.AnyKey(context.Background()).Execute()
|
resp, r, err := apiClient.UsageAPI.AnyKey(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.AnyKey``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.AnyKey``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `AnyKey`: map[string]interface{}
|
// response from `AnyKey`: map[string]interface{}
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.AnyKey`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.AnyKey`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -86,23 +86,23 @@ Use both API keys
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UsageAPI.BothKeys(context.Background()).Execute()
|
resp, r, err := apiClient.UsageAPI.BothKeys(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.BothKeys``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.BothKeys``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `BothKeys`: map[string]interface{}
|
// response from `BothKeys`: map[string]interface{}
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.BothKeys`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.BothKeys`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -147,23 +147,23 @@ Use API key in header
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UsageAPI.KeyInHeader(context.Background()).Execute()
|
resp, r, err := apiClient.UsageAPI.KeyInHeader(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInHeader``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInHeader``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `KeyInHeader`: map[string]interface{}
|
// response from `KeyInHeader`: map[string]interface{}
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInHeader`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInHeader`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -208,23 +208,23 @@ Use API key in query
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UsageAPI.KeyInQuery(context.Background()).Execute()
|
resp, r, err := apiClient.UsageAPI.KeyInQuery(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInQuery``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInQuery``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `KeyInQuery`: map[string]interface{}
|
// response from `KeyInQuery`: map[string]interface{}
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInQuery`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInQuery`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
|
|||||||
|
|
||||||
Install the following dependencies:
|
Install the following dependencies:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
go get github.com/stretchr/testify/assert
|
go get github.com/stretchr/testify/assert
|
||||||
go get golang.org/x/oauth2
|
go get golang.org/x/oauth2
|
||||||
go get golang.org/x/net/context
|
go get golang.org/x/net/context
|
||||||
@ -21,13 +21,13 @@ go get golang.org/x/net/context
|
|||||||
|
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"
|
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
```
|
```
|
||||||
|
|
||||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ Default configuration comes with `Servers` field that contains server objects as
|
|||||||
|
|
||||||
For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`.
|
For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
|||||||
|
|
||||||
Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`.
|
Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{
|
ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{
|
||||||
"basePath": "v2",
|
"basePath": "v2",
|
||||||
})
|
})
|
||||||
@ -61,7 +61,7 @@ Each operation can use different server URL defined using `OperationServers` map
|
|||||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
||||||
Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps.
|
Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{
|
ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{
|
||||||
"{classname}Service.{nickname}": 2,
|
"{classname}Service.{nickname}": 2,
|
||||||
})
|
})
|
||||||
@ -104,14 +104,14 @@ Authentication schemes defined for the API:
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING")
|
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING")
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
|
|
||||||
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import "golang.org/x/oauth2"
|
import "golang.org/x/oauth2"
|
||||||
|
|
||||||
/* Perform OAuth2 round trip request and obtain a token */
|
/* Perform OAuth2 round trip request and obtain a token */
|
||||||
|
@ -22,24 +22,24 @@ Add a new pet to the store
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute()
|
resp, r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `AddPet`: Pet
|
// response from `AddPet`: Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.AddPet`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.AddPet`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -13,7 +13,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
|
|||||||
|
|
||||||
Install the following dependencies:
|
Install the following dependencies:
|
||||||
|
|
||||||
```shell
|
```sh
|
||||||
go get github.com/stretchr/testify/assert
|
go get github.com/stretchr/testify/assert
|
||||||
go get golang.org/x/oauth2
|
go get golang.org/x/oauth2
|
||||||
go get golang.org/x/net/context
|
go get golang.org/x/net/context
|
||||||
@ -21,13 +21,13 @@ go get golang.org/x/net/context
|
|||||||
|
|
||||||
Put the package under your project folder and add the following in import:
|
Put the package under your project folder and add the following in import:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"
|
import petstore "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
```
|
```
|
||||||
|
|
||||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ Default configuration comes with `Servers` field that contains server objects as
|
|||||||
|
|
||||||
For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`.
|
For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1)
|
|||||||
|
|
||||||
Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`.
|
Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{
|
ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{
|
||||||
"basePath": "v2",
|
"basePath": "v2",
|
||||||
})
|
})
|
||||||
@ -61,7 +61,7 @@ Each operation can use different server URL defined using `OperationServers` map
|
|||||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
||||||
Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps.
|
Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{
|
ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{
|
||||||
"{classname}Service.{nickname}": 2,
|
"{classname}Service.{nickname}": 2,
|
||||||
})
|
})
|
||||||
@ -205,14 +205,14 @@ Authentication schemes defined for the API:
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING")
|
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING")
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
|
|
||||||
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
import "golang.org/x/oauth2"
|
import "golang.org/x/oauth2"
|
||||||
|
|
||||||
/* Perform OAuth2 round trip request and obtain a token */
|
/* Perform OAuth2 round trip request and obtain a token */
|
||||||
@ -232,7 +232,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(
|
auth := context.WithValue(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
petstore.ContextAPIKeys,
|
petstore.ContextAPIKeys,
|
||||||
@ -253,7 +253,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(
|
auth := context.WithValue(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
petstore.ContextAPIKeys,
|
petstore.ContextAPIKeys,
|
||||||
@ -270,10 +270,10 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{
|
auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{
|
||||||
UserName: "username",
|
UserName: "username",
|
||||||
Password: "password",
|
Password: "password",
|
||||||
})
|
})
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
@ -284,7 +284,7 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "BEARER_TOKEN_STRING")
|
auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "BEARER_TOKEN_STRING")
|
||||||
r, err := client.Service.Operation(auth, args)
|
r, err := client.Service.Operation(auth, args)
|
||||||
```
|
```
|
||||||
@ -295,7 +295,7 @@ r, err := client.Service.Operation(auth, args)
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
```golang
|
```go
|
||||||
authConfig := petstore.HttpSignatureAuth{
|
authConfig := petstore.HttpSignatureAuth{
|
||||||
KeyId: "my-key-id",
|
KeyId: "my-key-id",
|
||||||
PrivateKeyPath: "rsa.pem",
|
PrivateKeyPath: "rsa.pem",
|
||||||
|
@ -22,24 +22,24 @@ To test special tags
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
client := *openapiclient.NewClient() // Client | client model
|
client := *openapiclient.NewClient() // Client | client model
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).Client(client).Execute()
|
resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).Client(client).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `Call123TestSpecialTags`: Client
|
// response from `Call123TestSpecialTags`: Client
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -20,23 +20,23 @@ Method | HTTP request | Description
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.DefaultAPI.FooGet(context.Background()).Execute()
|
resp, r, err := apiClient.DefaultAPI.FooGet(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.FooGet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.FooGet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FooGet`: FooGetDefaultResponse
|
// response from `FooGet`: FooGetDefaultResponse
|
||||||
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.FooGet`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.FooGet`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -37,23 +37,23 @@ Health check endpoint
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeHealthGet(context.Background()).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeHealthGet(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeHealthGet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeHealthGet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeHealthGet`: HealthCheckResult
|
// response from `FakeHealthGet`: HealthCheckResult
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeHealthGet`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeHealthGet`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -98,24 +98,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := true // bool | Input boolean as post body (optional)
|
body := true // bool | Input boolean as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterBooleanSerialize`: bool
|
// response from `FakeOuterBooleanSerialize`: bool
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -164,24 +164,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
outerComposite := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional)
|
outerComposite := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).OuterComposite(outerComposite).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).OuterComposite(outerComposite).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterCompositeSerialize`: OuterComposite
|
// response from `FakeOuterCompositeSerialize`: OuterComposite
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -230,24 +230,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := float32(8.14) // float32 | Input number as post body (optional)
|
body := float32(8.14) // float32 | Input number as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterNumberSerialize`: float32
|
// response from `FakeOuterNumberSerialize`: float32
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -296,24 +296,24 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
body := "body_example" // string | Input string as post body (optional)
|
body := "body_example" // string | Input string as post body (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute()
|
resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FakeOuterStringSerialize`: string
|
// response from `FakeOuterStringSerialize`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -360,25 +360,25 @@ parameter name mapping test
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
underscoreType := int64(789) // int64 | _type
|
underscoreType := int64(789) // int64 | _type
|
||||||
type_ := "type__example" // string | type
|
type_ := "type__example" // string | type
|
||||||
typeWithUnderscore := "typeWithUnderscore_example" // string | type_
|
typeWithUnderscore := "typeWithUnderscore_example" // string | type_
|
||||||
httpDebugOption := "httpDebugOption_example" // string | http debug option (to test parameter naming option)
|
httpDebugOption := "httpDebugOption_example" // string | http debug option (to test parameter naming option)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.GetParameterNameMapping(context.Background()).UnderscoreType(underscoreType).Type_(type_).TypeWithUnderscore(typeWithUnderscore).HttpDebugOption(httpDebugOption).Execute()
|
r, err := apiClient.FakeAPI.GetParameterNameMapping(context.Background()).UnderscoreType(underscoreType).Type_(type_).TypeWithUnderscore(typeWithUnderscore).HttpDebugOption(httpDebugOption).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.GetParameterNameMapping``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.GetParameterNameMapping``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -430,22 +430,22 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fileSchemaTestClass := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass |
|
fileSchemaTestClass := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(fileSchemaTestClass).Execute()
|
r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(fileSchemaTestClass).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -492,23 +492,23 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
query := "query_example" // string |
|
query := "query_example" // string |
|
||||||
user := *openapiclient.NewUser() // User |
|
user := *openapiclient.NewUser() // User |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).User(user).Execute()
|
r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).User(user).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -558,24 +558,24 @@ To test \"client\" model
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
client := *openapiclient.NewClient() // Client | client model
|
client := *openapiclient.NewClient() // Client | client model
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Client(client).Execute()
|
resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Client(client).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestClientModel`: Client
|
// response from `TestClientModel`: Client
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -624,36 +624,36 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
number := float32(8.14) // float32 | None
|
number := float32(8.14) // float32 | None
|
||||||
double := float64(1.2) // float64 | None
|
double := float64(1.2) // float64 | None
|
||||||
patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None
|
patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None
|
||||||
byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None
|
byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None
|
||||||
integer := int32(56) // int32 | None (optional)
|
integer := int32(56) // int32 | None (optional)
|
||||||
int32_ := int32(56) // int32 | None (optional)
|
int32_ := int32(56) // int32 | None (optional)
|
||||||
int64_ := int64(789) // int64 | None (optional)
|
int64_ := int64(789) // int64 | None (optional)
|
||||||
float := float32(3.4) // float32 | None (optional)
|
float := float32(3.4) // float32 | None (optional)
|
||||||
string_ := "string__example" // string | None (optional)
|
string_ := "string__example" // string | None (optional)
|
||||||
binary := os.NewFile(1234, "some_file") // *os.File | None (optional)
|
binary := os.NewFile(1234, "some_file") // *os.File | None (optional)
|
||||||
date := time.Now() // string | None (optional)
|
date := time.Now() // string | None (optional)
|
||||||
dateTime := time.Now() // time.Time | None (optional)
|
dateTime := time.Now() // time.Time | None (optional)
|
||||||
password := "password_example" // string | None (optional)
|
password := "password_example" // string | None (optional)
|
||||||
callback := "callback_example" // string | None (optional)
|
callback := "callback_example" // string | None (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute()
|
r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -715,29 +715,29 @@ To test enum parameters
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional)
|
enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional)
|
||||||
enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg")
|
enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg")
|
||||||
enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional)
|
enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional)
|
||||||
enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg")
|
enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg")
|
||||||
enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional)
|
enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional)
|
||||||
enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional)
|
enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional)
|
||||||
enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$")
|
enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$")
|
||||||
enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg")
|
enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg")
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute()
|
r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -793,27 +793,27 @@ Fake endpoint to test group parameters (optional)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
requiredStringGroup := int32(56) // int32 | Required String in group parameters
|
requiredStringGroup := int32(56) // int32 | Required String in group parameters
|
||||||
requiredBooleanGroup := true // bool | Required Boolean in group parameters
|
requiredBooleanGroup := true // bool | Required Boolean in group parameters
|
||||||
requiredInt64Group := int64(789) // int64 | Required Integer in group parameters
|
requiredInt64Group := int64(789) // int64 | Required Integer in group parameters
|
||||||
stringGroup := int32(56) // int32 | String in group parameters (optional)
|
stringGroup := int32(56) // int32 | String in group parameters (optional)
|
||||||
booleanGroup := true // bool | Boolean in group parameters (optional)
|
booleanGroup := true // bool | Boolean in group parameters (optional)
|
||||||
int64Group := int64(789) // int64 | Integer in group parameters (optional)
|
int64Group := int64(789) // int64 | Integer in group parameters (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute()
|
r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -867,22 +867,22 @@ test inline additionalProperties
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
requestBody := map[string]string{"key": "Inner_example"} // map[string]string | request body
|
requestBody := map[string]string{"key": "Inner_example"} // map[string]string | request body
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).RequestBody(requestBody).Execute()
|
r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).RequestBody(requestBody).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -931,22 +931,22 @@ test inline free-form additionalProperties
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
testInlineFreeformAdditionalPropertiesRequest := *openapiclient.NewTestInlineFreeformAdditionalPropertiesRequest() // TestInlineFreeformAdditionalPropertiesRequest | request body
|
testInlineFreeformAdditionalPropertiesRequest := *openapiclient.NewTestInlineFreeformAdditionalPropertiesRequest() // TestInlineFreeformAdditionalPropertiesRequest | request body
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestInlineFreeformAdditionalProperties(context.Background()).TestInlineFreeformAdditionalPropertiesRequest(testInlineFreeformAdditionalPropertiesRequest).Execute()
|
r, err := apiClient.FakeAPI.TestInlineFreeformAdditionalProperties(context.Background()).TestInlineFreeformAdditionalPropertiesRequest(testInlineFreeformAdditionalPropertiesRequest).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineFreeformAdditionalProperties``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineFreeformAdditionalProperties``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -995,23 +995,23 @@ test json serialization of form data
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
param := "param_example" // string | field1
|
param := "param_example" // string | field1
|
||||||
param2 := "param2_example" // string | field2
|
param2 := "param2_example" // string | field2
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute()
|
r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1059,23 +1059,23 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
testPet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional)
|
testPet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional)
|
||||||
inputOptions := *openapiclient.NewCategory("Name_example") // Category | (optional)
|
inputOptions := *openapiclient.NewCategory("Name_example") // Category | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestQueryDeepObject(context.Background()).TestPet(testPet).InputOptions(inputOptions).Execute()
|
r, err := apiClient.FakeAPI.TestQueryDeepObject(context.Background()).TestPet(testPet).InputOptions(inputOptions).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryDeepObject``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryDeepObject``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1125,26 +1125,26 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pipe := []string{"Inner_example"} // []string |
|
pipe := []string{"Inner_example"} // []string |
|
||||||
ioutil := []string{"Inner_example"} // []string |
|
ioutil := []string{"Inner_example"} // []string |
|
||||||
http := []string{"Inner_example"} // []string |
|
http := []string{"Inner_example"} // []string |
|
||||||
url := []string{"Inner_example"} // []string |
|
url := []string{"Inner_example"} // []string |
|
||||||
context := []string{"Inner_example"} // []string |
|
context := []string{"Inner_example"} // []string |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute()
|
r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1197,25 +1197,25 @@ No authorization required
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
queryUnique := []string{"Inner_example"} // []string |
|
queryUnique := []string{"Inner_example"} // []string |
|
||||||
headerUnique := []string{"Inner_example"} // []string |
|
headerUnique := []string{"Inner_example"} // []string |
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat(context.Background()).QueryUnique(queryUnique).HeaderUnique(headerUnique).Execute()
|
resp, r, err := apiClient.FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat(context.Background()).QueryUnique(queryUnique).HeaderUnique(headerUnique).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: []Pet
|
// response from `TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: []Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -22,24 +22,24 @@ To test class name in snake case
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
client := *openapiclient.NewClient() // Client | client model
|
client := *openapiclient.NewClient() // Client | client model
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Client(client).Execute()
|
resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Client(client).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `TestClassname`: Client
|
// response from `TestClassname`: Client
|
||||||
fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -30,22 +30,22 @@ Add a new pet to the store
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute()
|
r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -94,23 +94,23 @@ Deletes a pet
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | Pet id to delete
|
petId := int64(789) // int64 | Pet id to delete
|
||||||
apiKey := "apiKey_example" // string | (optional)
|
apiKey := "apiKey_example" // string | (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute()
|
r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -164,24 +164,24 @@ Finds Pets by status
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
status := []string{"Status_example"} // []string | Status values that need to be considered for filter
|
status := []string{"Status_example"} // []string | Status values that need to be considered for filter
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute()
|
resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FindPetsByStatus`: []Pet
|
// response from `FindPetsByStatus`: []Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -230,24 +230,24 @@ Finds Pets by tags
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
tags := []string{"Inner_example"} // []string | Tags to filter by
|
tags := []string{"Inner_example"} // []string | Tags to filter by
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute()
|
resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `FindPetsByTags`: []Pet
|
// response from `FindPetsByTags`: []Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -296,24 +296,24 @@ Find pet by ID
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet to return
|
petId := int64(789) // int64 | ID of pet to return
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute()
|
resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetPetById`: Pet
|
// response from `GetPetById`: Pet
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -366,22 +366,22 @@ Update an existing pet
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.UpdatePet(context.Background()).Pet(pet).Execute()
|
r, err := apiClient.PetAPI.UpdatePet(context.Background()).Pet(pet).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -430,24 +430,24 @@ Updates a pet in the store with form data
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet that needs to be updated
|
petId := int64(789) // int64 | ID of pet that needs to be updated
|
||||||
name := "name_example" // string | Updated name of the pet (optional)
|
name := "name_example" // string | Updated name of the pet (optional)
|
||||||
status := "status_example" // string | Updated status of the pet (optional)
|
status := "status_example" // string | Updated status of the pet (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute()
|
r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -502,26 +502,26 @@ uploads an image
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet to update
|
petId := int64(789) // int64 | ID of pet to update
|
||||||
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
||||||
file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional)
|
file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute()
|
resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `UploadFile`: ApiResponse
|
// response from `UploadFile`: ApiResponse
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -576,26 +576,26 @@ uploads an image (required)
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
petId := int64(789) // int64 | ID of pet to update
|
petId := int64(789) // int64 | ID of pet to update
|
||||||
requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload
|
requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload
|
||||||
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional)
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute()
|
resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `UploadFileWithRequiredFile`: ApiResponse
|
// response from `UploadFileWithRequiredFile`: ApiResponse
|
||||||
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -25,22 +25,22 @@ Delete purchase order by ID
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
orderId := "orderId_example" // string | ID of the order that needs to be deleted
|
orderId := "orderId_example" // string | ID of the order that needs to be deleted
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute()
|
r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -93,23 +93,23 @@ Returns pet inventories by status
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute()
|
resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetInventory`: map[string]int32
|
// response from `GetInventory`: map[string]int32
|
||||||
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -154,24 +154,24 @@ Find purchase order by ID
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
orderId := int64(789) // int64 | ID of pet that needs to be fetched
|
orderId := int64(789) // int64 | ID of pet that needs to be fetched
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute()
|
resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetOrderById`: Order
|
// response from `GetOrderById`: Order
|
||||||
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -224,24 +224,24 @@ Place an order for a pet
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
order := *openapiclient.NewOrder() // Order | order placed for purchasing the pet
|
order := *openapiclient.NewOrder() // Order | order placed for purchasing the pet
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Order(order).Execute()
|
resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Order(order).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `PlaceOrder`: Order
|
// response from `PlaceOrder`: Order
|
||||||
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,22 +29,22 @@ Create user
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
user := *openapiclient.NewUser() // User | Created user object
|
user := *openapiclient.NewUser() // User | Created user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.CreateUser(context.Background()).User(user).Execute()
|
r, err := apiClient.UserAPI.CreateUser(context.Background()).User(user).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -93,22 +93,22 @@ Creates list of users with given input array
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).User(user).Execute()
|
r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).User(user).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -157,22 +157,22 @@ Creates list of users with given input array
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).User(user).Execute()
|
r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).User(user).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -221,22 +221,22 @@ Delete user
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | The name that needs to be deleted
|
username := "username_example" // string | The name that needs to be deleted
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute()
|
r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -289,24 +289,24 @@ Get user by user name
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | The name that needs to be fetched. Use user1 for testing.
|
username := "username_example" // string | The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute()
|
resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `GetUserByName`: User
|
// response from `GetUserByName`: User
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -359,25 +359,25 @@ Logs user into the system
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | The user name for login
|
username := "username_example" // string | The user name for login
|
||||||
password := "password_example" // string | The password for login in clear text
|
password := "password_example" // string | The password for login in clear text
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute()
|
resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
// response from `LoginUser`: string
|
// response from `LoginUser`: string
|
||||||
fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp)
|
fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -427,21 +427,21 @@ Logs out current logged in user session
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute()
|
r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -486,23 +486,23 @@ Updated user
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
username := "username_example" // string | name that need to be deleted
|
username := "username_example" // string | name that need to be deleted
|
||||||
user := *openapiclient.NewUser() // User | Updated user object
|
user := *openapiclient.NewUser() // User | Updated user object
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
configuration := openapiclient.NewConfiguration()
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).User(user).Execute()
|
r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).User(user).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err)
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ func (o Animal) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Animal) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Animal) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -124,7 +124,7 @@ func (o AppleReq) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *AppleReq) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *AppleReq) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -124,7 +124,7 @@ func (o BananaReq) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *BananaReq) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *BananaReq) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -111,7 +111,7 @@ func (o Cat) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Cat) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Cat) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -126,7 +126,7 @@ func (o Category) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Category) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Category) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -111,7 +111,7 @@ func (o Dog) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Dog) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Dog) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -89,7 +89,7 @@ func (o DuplicatedPropParent) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *DuplicatedPropParent) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *DuplicatedPropParent) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -358,7 +358,7 @@ func (o EnumTest) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -569,7 +569,7 @@ func (o FormatTest) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -196,7 +196,7 @@ func (o Name) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Name) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Name) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -264,7 +264,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Pet) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -160,7 +160,7 @@ func (o Whale) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Whale) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Whale) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -124,7 +124,7 @@ func (o Zebra) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Zebra) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Zebra) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
// This validates that all required properties are included in the JSON object
|
// This validates that all required properties are included in the JSON object
|
||||||
// by unmarshalling the object into a generic map with string keys and checking
|
// by unmarshalling the object into a generic map with string keys and checking
|
||||||
// that every required field exists as a key in the generic map.
|
// that every required field exists as a key in the generic map.
|
||||||
requiredProperties := []string{
|
requiredProperties := []string{
|
||||||
|
@ -1,70 +1,71 @@
|
|||||||
package handlers
|
package handlers
|
||||||
import (
|
import (
|
||||||
"gitlab.com/openapitools/petstore/models"
|
"gitlab.com/openapitools/petstore/models"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddPet - Add a new pet to the store
|
// AddPet - Add a new pet to the store
|
||||||
func (c *Container) AddPet(ctx echo.Context) error {
|
func (c *Container) AddPet(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DeletePet - Deletes a pet
|
// DeletePet - Deletes a pet
|
||||||
func (c *Container) DeletePet(ctx echo.Context) error {
|
func (c *Container) DeletePet(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// FindPetsByStatus - Finds Pets by status
|
// FindPetsByStatus - Finds Pets by status
|
||||||
func (c *Container) FindPetsByStatus(ctx echo.Context) error {
|
func (c *Container) FindPetsByStatus(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// FindPetsByTags - Finds Pets by tags
|
// FindPetsByTags - Finds Pets by tags
|
||||||
// Deprecated
|
// Deprecated
|
||||||
func (c *Container) FindPetsByTags(ctx echo.Context) error {
|
func (c *Container) FindPetsByTags(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GetPetById - Find pet by ID
|
// GetPetById - Find pet by ID
|
||||||
func (c *Container) GetPetById(ctx echo.Context) error {
|
func (c *Container) GetPetById(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdatePet - Update an existing pet
|
// UpdatePet - Update an existing pet
|
||||||
func (c *Container) UpdatePet(ctx echo.Context) error {
|
func (c *Container) UpdatePet(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdatePetWithForm - Updates a pet in the store with form data
|
// UpdatePetWithForm - Updates a pet in the store with form data
|
||||||
func (c *Container) UpdatePetWithForm(ctx echo.Context) error {
|
func (c *Container) UpdatePetWithForm(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UploadFile - uploads an image
|
// UploadFile - uploads an image
|
||||||
func (c *Container) UploadFile(ctx echo.Context) error {
|
func (c *Container) UploadFile(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,37 +1,38 @@
|
|||||||
package handlers
|
package handlers
|
||||||
import (
|
import (
|
||||||
"gitlab.com/openapitools/petstore/models"
|
"gitlab.com/openapitools/petstore/models"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeleteOrder - Delete purchase order by ID
|
// DeleteOrder - Delete purchase order by ID
|
||||||
func (c *Container) DeleteOrder(ctx echo.Context) error {
|
func (c *Container) DeleteOrder(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GetInventory - Returns pet inventories by status
|
// GetInventory - Returns pet inventories by status
|
||||||
func (c *Container) GetInventory(ctx echo.Context) error {
|
func (c *Container) GetInventory(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GetOrderById - Find purchase order by ID
|
// GetOrderById - Find purchase order by ID
|
||||||
func (c *Container) GetOrderById(ctx echo.Context) error {
|
func (c *Container) GetOrderById(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// PlaceOrder - Place an order for a pet
|
// PlaceOrder - Place an order for a pet
|
||||||
func (c *Container) PlaceOrder(ctx echo.Context) error {
|
func (c *Container) PlaceOrder(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,69 +1,70 @@
|
|||||||
package handlers
|
package handlers
|
||||||
import (
|
import (
|
||||||
"gitlab.com/openapitools/petstore/models"
|
"gitlab.com/openapitools/petstore/models"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreateUser - Create user
|
// CreateUser - Create user
|
||||||
func (c *Container) CreateUser(ctx echo.Context) error {
|
func (c *Container) CreateUser(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CreateUsersWithArrayInput - Creates list of users with given input array
|
// CreateUsersWithArrayInput - Creates list of users with given input array
|
||||||
func (c *Container) CreateUsersWithArrayInput(ctx echo.Context) error {
|
func (c *Container) CreateUsersWithArrayInput(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CreateUsersWithListInput - Creates list of users with given input array
|
// CreateUsersWithListInput - Creates list of users with given input array
|
||||||
func (c *Container) CreateUsersWithListInput(ctx echo.Context) error {
|
func (c *Container) CreateUsersWithListInput(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// DeleteUser - Delete user
|
// DeleteUser - Delete user
|
||||||
func (c *Container) DeleteUser(ctx echo.Context) error {
|
func (c *Container) DeleteUser(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GetUserByName - Get user by user name
|
// GetUserByName - Get user by user name
|
||||||
func (c *Container) GetUserByName(ctx echo.Context) error {
|
func (c *Container) GetUserByName(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// LoginUser - Logs user into the system
|
// LoginUser - Logs user into the system
|
||||||
func (c *Container) LoginUser(ctx echo.Context) error {
|
func (c *Container) LoginUser(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// LogoutUser - Logs out current logged in user session
|
// LogoutUser - Logs out current logged in user session
|
||||||
func (c *Container) LogoutUser(ctx echo.Context) error {
|
func (c *Container) LogoutUser(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// UpdateUser - Updated user
|
// UpdateUser - Updated user
|
||||||
func (c *Container) UpdateUser(ctx echo.Context) error {
|
func (c *Container) UpdateUser(ctx echo.Context) error {
|
||||||
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
return ctx.JSON(http.StatusOK, models.HelloWorld {
|
||||||
Message: "Hello World",
|
Message: "Hello World",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,6 @@ type Container struct {
|
|||||||
|
|
||||||
// NewContainer returns an empty or an initialized container for your handlers.
|
// NewContainer returns an empty or an initialized container for your handlers.
|
||||||
func NewContainer() (Container, error) {
|
func NewContainer() (Container, error) {
|
||||||
c := Container{}
|
c := Container{}
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
e := echo.New()
|
e := echo.New()
|
||||||
|
|
||||||
//todo: handle the error!
|
//todo: handle the error!
|
||||||
c, _ := handlers.NewContainer()
|
c, _ := handlers.NewContainer()
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
@ -80,4 +80,4 @@ func main() {
|
|||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Logger.Fatal(e.Start(":8080"))
|
e.Logger.Fatal(e.Start(":8080"))
|
||||||
}
|
}
|
||||||
|
@ -2,5 +2,5 @@ package models
|
|||||||
|
|
||||||
// HelloWorld is a sample data structure to make sure each endpoint return something.
|
// HelloWorld is a sample data structure to make sure each endpoint return something.
|
||||||
type HelloWorld struct {
|
type HelloWorld struct {
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user