petstore

package
v3.3.4+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

README

Go API client for petstore

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: " \

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./petstore"

Documentation for API Endpoints

All URIs are relative to http://petstore.swagger.io:80/v2

Class Method HTTP request Description
AnotherFakeApi Call123TestSpecialTags Patch /another-fake/dummy To test special tags
FakeApi FakeOuterBooleanSerialize Post /fake/outer/boolean
FakeApi FakeOuterCompositeSerialize Post /fake/outer/composite
FakeApi FakeOuterNumberSerialize Post /fake/outer/number
FakeApi FakeOuterStringSerialize Post /fake/outer/string
FakeApi TestBodyWithFileSchema Put /fake/body-with-file-schema
FakeApi TestBodyWithQueryParams Put /fake/body-with-query-params
FakeApi TestClientModel Patch /fake To test "client" model
FakeApi TestEndpointParameters Post /fake Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
FakeApi TestEnumParameters Get /fake To test enum parameters
FakeApi TestInlineAdditionalProperties Post /fake/inline-additionalProperties test inline additionalProperties
FakeApi TestJsonFormData Get /fake/jsonFormData test json serialization of form data
FakeClassnameTags123Api TestClassname Patch /fake_classname_test To test class name in snake case
PetApi AddPet Post /pet Add a new pet to the store
PetApi DeletePet Delete /pet/{petId} Deletes a pet
PetApi FindPetsByStatus Get /pet/findByStatus Finds Pets by status
PetApi FindPetsByTags Get /pet/findByTags Finds Pets by tags
PetApi GetPetById Get /pet/{petId} Find pet by ID
PetApi UpdatePet Put /pet Update an existing pet
PetApi UpdatePetWithForm Post /pet/{petId} Updates a pet in the store with form data
PetApi UploadFile Post /pet/{petId}/uploadImage uploads an image
PetApi UploadFileWithRequiredFile Post /fake/{petId}/uploadImageWithRequiredFile uploads an image (required)
StoreApi DeleteOrder Delete /store/order/{order_id} Delete purchase order by ID
StoreApi GetInventory Get /store/inventory Returns pet inventories by status
StoreApi GetOrderById Get /store/order/{order_id} Find purchase order by ID
StoreApi PlaceOrder Post /store/order Place an order for a pet
UserApi CreateUser Post /user Create user
UserApi CreateUsersWithArrayInput Post /user/createWithArray Creates list of users with given input array
UserApi CreateUsersWithListInput Post /user/createWithList Creates list of users with given input array
UserApi DeleteUser Delete /user/{username} Delete user
UserApi GetUserByName Get /user/{username} Get user by user name
UserApi LoginUser Get /user/login Logs user into the system
UserApi LogoutUser Get /user/logout Logs out current logged in user session
UserApi UpdateUser Put /user/{username} Updated user

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

api_key_query

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

http_basic_test

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

petstore_auth

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	AnotherFakeApi *AnotherFakeApiService

	FakeApi *FakeApiService

	FakeClassnameTags123Api *FakeClassnameTags123ApiService

	PetApi *PetApiService

	StoreApi *StoreApiService

	UserApi *UserApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the OpenAPI Petstore API v1.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type AdditionalPropertiesClass

type AdditionalPropertiesClass struct {
	MapProperty      map[string]string            `json:"map_property,omitempty" xml:"map_property"`
	MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty" xml:"map_of_map_property"`
}

type Animal

type Animal struct {
	ClassName string `json:"className" xml:"className"`
	Color     string `json:"color,omitempty" xml:"color"`
}

type AnimalFarm

type AnimalFarm struct {
}

type AnotherFakeApiService

type AnotherFakeApiService service

func (*AnotherFakeApiService) Call123TestSpecialTags

func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error)

AnotherFakeApiService To test special tags To test special tags and operation ID starting with number

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param client client model

@return Client

type ApiResponse

type ApiResponse struct {
	Code    int32  `json:"code,omitempty" xml:"code"`
	Type    string `json:"type,omitempty" xml:"type"`
	Message string `json:"message,omitempty" xml:"message"`
}

type ArrayOfArrayOfNumberOnly

type ArrayOfArrayOfNumberOnly struct {
	ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty" xml:"ArrayArrayNumber"`
}

type ArrayOfNumberOnly

type ArrayOfNumberOnly struct {
	ArrayNumber []float32 `json:"ArrayNumber,omitempty" xml:"ArrayNumber"`
}

type ArrayTest

type ArrayTest struct {
	ArrayOfString       []string          `json:"array_of_string,omitempty" xml:"array_of_string"`
	ArrayArrayOfInteger [][]int64         `json:"array_array_of_integer,omitempty" xml:"array_array_of_integer"`
	ArrayArrayOfModel   [][]ReadOnlyFirst `json:"array_array_of_model,omitempty" xml:"array_array_of_model"`
}

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Capitalization

type Capitalization struct {
	SmallCamel       string `json:"smallCamel,omitempty" xml:"smallCamel"`
	CapitalCamel     string `json:"CapitalCamel,omitempty" xml:"CapitalCamel"`
	SmallSnake       string `json:"small_Snake,omitempty" xml:"small_Snake"`
	CapitalSnake     string `json:"Capital_Snake,omitempty" xml:"Capital_Snake"`
	SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty" xml:"SCA_ETH_Flow_Points"`
	// Name of the pet
	ATT_NAME string `json:"ATT_NAME,omitempty" xml:"ATT_NAME"`
}

type Cat

type Cat struct {
	ClassName string `json:"className" xml:"className"`
	Color     string `json:"color,omitempty" xml:"color"`
	Declawed  bool   `json:"declawed,omitempty" xml:"declawed"`
}

type Category

type Category struct {
	Id   int64  `json:"id,omitempty" xml:"id"`
	Name string `json:"name,omitempty" xml:"name"`
}

type ClassModel

type ClassModel struct {
	Class string `json:"_class,omitempty" xml:"_class"`
}

Model for testing model with \"_class\" property

type Client

type Client struct {
	Client string `json:"client,omitempty" xml:"client"`
}

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type DeletePetOpts

type DeletePetOpts struct {
	ApiKey optional.String
}

type Dog

type Dog struct {
	ClassName string `json:"className" xml:"className"`
	Color     string `json:"color,omitempty" xml:"color"`
	Breed     string `json:"breed,omitempty" xml:"breed"`
}

type EnumArrays

type EnumArrays struct {
	JustSymbol string   `json:"just_symbol,omitempty" xml:"just_symbol"`
	ArrayEnum  []string `json:"array_enum,omitempty" xml:"array_enum"`
}

type EnumClass

type EnumClass string
const (
	ABC EnumClass = "_abc"
	EFG EnumClass = "-efg"
	XYZ EnumClass = "(xyz)"
)

List of EnumClass

type EnumTest

type EnumTest struct {
	EnumString         string    `json:"enum_string,omitempty" xml:"enum_string"`
	EnumStringRequired string    `json:"enum_string_required" xml:"enum_string_required"`
	EnumInteger        int32     `json:"enum_integer,omitempty" xml:"enum_integer"`
	EnumNumber         float64   `json:"enum_number,omitempty" xml:"enum_number"`
	OuterEnum          OuterEnum `json:"outerEnum,omitempty" xml:"outerEnum"`
}

type FakeApiService

type FakeApiService service

func (*FakeApiService) FakeOuterBooleanSerialize

func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error)

func (*FakeApiService) FakeOuterCompositeSerialize

func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error)

func (*FakeApiService) FakeOuterNumberSerialize

func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error)

func (*FakeApiService) FakeOuterStringSerialize

func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error)

func (*FakeApiService) TestBodyWithFileSchema

func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error)

FakeApiService For this test, the body for this request much reference a schema named `File`.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param fileSchemaTestClass

func (*FakeApiService) TestBodyWithQueryParams

func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, user User) (*http.Response, error)

FakeApiService

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param query
  • @param user

func (*FakeApiService) TestClientModel

func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Client, *http.Response, error)

FakeApiService To test \"client\" model To test \"client\" model

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param client client model

@return Client

func (*FakeApiService) TestEndpointParameters

func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error)

func (*FakeApiService) TestEnumParameters

func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error)

func (*FakeApiService) TestInlineAdditionalProperties

func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody map[string]string) (*http.Response, error)

FakeApiService test inline additionalProperties

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param requestBody request body

func (*FakeApiService) TestJsonFormData

func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error)

FakeApiService test json serialization of form data

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param param field1
  • @param param2 field2

type FakeClassnameTags123ApiService

type FakeClassnameTags123ApiService service

func (*FakeClassnameTags123ApiService) TestClassname

func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, client Client) (Client, *http.Response, error)

FakeClassnameTags123ApiService To test class name in snake case To test class name in snake case

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param client client model

@return Client

type FakeOuterBooleanSerializeOpts

type FakeOuterBooleanSerializeOpts struct {
	Body optional.Bool
}

type FakeOuterCompositeSerializeOpts

type FakeOuterCompositeSerializeOpts struct {
	OuterComposite optional.Interface
}

type FakeOuterNumberSerializeOpts

type FakeOuterNumberSerializeOpts struct {
	Body optional.Float32
}

type FakeOuterStringSerializeOpts

type FakeOuterStringSerializeOpts struct {
	Body optional.String
}

type File

type File struct {
	// Test capitalization
	SourceURI string `json:"sourceURI,omitempty" xml:"sourceURI"`
}

Must be named `File` for test.

type FileSchemaTestClass

type FileSchemaTestClass struct {
	File  File   `json:"file,omitempty" xml:"file"`
	Files []File `json:"files,omitempty" xml:"files"`
}

type FormatTest

type FormatTest struct {
	Integer  int32     `json:"integer,omitempty" xml:"integer"`
	Int32    int32     `json:"int32,omitempty" xml:"int32"`
	Int64    int64     `json:"int64,omitempty" xml:"int64"`
	Number   float32   `json:"number" xml:"number"`
	Float    float32   `json:"float,omitempty" xml:"float"`
	Double   float64   `json:"double,omitempty" xml:"double"`
	String   string    `json:"string,omitempty" xml:"string"`
	Byte     string    `json:"byte" xml:"byte"`
	Binary   *os.File  `json:"binary,omitempty" xml:"binary"`
	Date     string    `json:"date" xml:"date"`
	DateTime time.Time `json:"dateTime,omitempty" xml:"dateTime"`
	Uuid     string    `json:"uuid,omitempty" xml:"uuid"`
	Password string    `json:"password" xml:"password"`
}

type GenericOpenAPIError

type GenericOpenAPIError struct {
	// contains filtered or unexported fields
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type HasOnlyReadOnly

type HasOnlyReadOnly struct {
	Bar string `json:"bar,omitempty" xml:"bar"`
	Foo string `json:"foo,omitempty" xml:"foo"`
}

type List

type List struct {
	Var123List string `json:"123-list,omitempty" xml:"123-list"`
}

type MapTest

type MapTest struct {
	MapMapOfString  map[string]map[string]string `json:"map_map_of_string,omitempty" xml:"map_map_of_string"`
	MapOfEnumString map[string]string            `json:"map_of_enum_string,omitempty" xml:"map_of_enum_string"`
	DirectMap       map[string]bool              `json:"direct_map,omitempty" xml:"direct_map"`
	IndirectMap     map[string]bool              `json:"indirect_map,omitempty" xml:"indirect_map"`
}

type MixedPropertiesAndAdditionalPropertiesClass

type MixedPropertiesAndAdditionalPropertiesClass struct {
	Uuid     string            `json:"uuid,omitempty" xml:"uuid"`
	DateTime time.Time         `json:"dateTime,omitempty" xml:"dateTime"`
	Map      map[string]Animal `json:"map,omitempty" xml:"map"`
}

type Model200Response

type Model200Response struct {
	Name  int32  `json:"name,omitempty" xml:"name"`
	Class string `json:"class,omitempty" xml:"class"`
}

Model for testing model name starting with number

type Name

type Name struct {
	Name         int32  `json:"name" xml:"name"`
	SnakeCase    int32  `json:"snake_case,omitempty" xml:"snake_case"`
	Property     string `json:"property,omitempty" xml:"property"`
	Var123Number int32  `json:"123Number,omitempty" xml:"123Number"`
}

Model for testing model name same as property name

type NumberOnly

type NumberOnly struct {
	JustNumber float32 `json:"JustNumber,omitempty" xml:"JustNumber"`
}

type Order

type Order struct {
	Id       int64     `json:"id,omitempty" xml:"id"`
	PetId    int64     `json:"petId,omitempty" xml:"petId"`
	Quantity int32     `json:"quantity,omitempty" xml:"quantity"`
	ShipDate time.Time `json:"shipDate,omitempty" xml:"shipDate"`
	// Order Status
	Status   string `json:"status,omitempty" xml:"status"`
	Complete bool   `json:"complete,omitempty" xml:"complete"`
}

type OuterComposite

type OuterComposite struct {
	MyNumber  float32 `json:"my_number,omitempty" xml:"my_number"`
	MyString  string  `json:"my_string,omitempty" xml:"my_string"`
	MyBoolean bool    `json:"my_boolean,omitempty" xml:"my_boolean"`
}

type OuterEnum

type OuterEnum string
const (
	PLACED    OuterEnum = "placed"
	APPROVED  OuterEnum = "approved"
	DELIVERED OuterEnum = "delivered"
)

List of OuterEnum

type Pet

type Pet struct {
	Id        int64    `json:"id,omitempty" xml:"id"`
	Category  Category `json:"category,omitempty" xml:"category"`
	Name      string   `json:"name" xml:"name"`
	PhotoUrls []string `json:"photoUrls" xml:"photoUrls"`
	Tags      []Tag    `json:"tags,omitempty" xml:"tags"`
	// pet status in the store
	Status string `json:"status,omitempty" xml:"status"`
}

type PetApiService

type PetApiService service

func (*PetApiService) AddPet

func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, error)

PetApiService Add a new pet to the store

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param pet Pet object that needs to be added to the store

func (*PetApiService) DeletePet

func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error)

func (*PetApiService) FindPetsByStatus

func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error)

PetApiService Finds Pets by status Multiple status values can be provided with comma separated strings

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param status Status values that need to be considered for filter

@return []Pet

func (*PetApiService) FindPetsByTags

func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error)

PetApiService Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param tags Tags to filter by

@return []Pet

func (*PetApiService) GetPetById

func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error)

PetApiService Find pet by ID Returns a single pet

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param petId ID of pet to return

@return Pet

func (*PetApiService) UpdatePet

func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, error)

PetApiService Update an existing pet

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param pet Pet object that needs to be added to the store

func (*PetApiService) UpdatePetWithForm

func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error)

func (*PetApiService) UploadFile

func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error)

func (*PetApiService) UploadFileWithRequiredFile

func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error)

type ReadOnlyFirst

type ReadOnlyFirst struct {
	Bar string `json:"bar,omitempty" xml:"bar"`
	Baz string `json:"baz,omitempty" xml:"baz"`
}

type Return

type Return struct {
	Return int32 `json:"return,omitempty" xml:"return"`
}

Model for testing reserved words

type SpecialModelName

type SpecialModelName struct {
	SpecialPropertyName int64 `json:"$special[property.name],omitempty" xml:"$special[property.name]"`
}

type StoreApiService

type StoreApiService service

func (*StoreApiService) DeleteOrder

func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error)

StoreApiService Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param orderId ID of the order that needs to be deleted

func (*StoreApiService) GetInventory

func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error)

StoreApiService Returns pet inventories by status Returns a map of status codes to quantities

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return map[string]int32

func (*StoreApiService) GetOrderById

func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error)

StoreApiService Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param orderId ID of pet that needs to be fetched

@return Order

func (*StoreApiService) PlaceOrder

func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *http.Response, error)

StoreApiService Place an order for a pet

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param order order placed for purchasing the pet

@return Order

type StringBooleanMap

type StringBooleanMap struct {
}

type Tag

type Tag struct {
	Id   int64  `json:"id,omitempty" xml:"id"`
	Name string `json:"name,omitempty" xml:"name"`
}

type TestEndpointParametersOpts

type TestEndpointParametersOpts struct {
	Integer  optional.Int32
	Int32_   optional.Int32
	Int64_   optional.Int64
	Float    optional.Float32
	String_  optional.String
	Binary   optional.Interface
	Date     optional.String
	DateTime optional.Time
	Password optional.String
	Callback optional.String
}

type TestEnumParametersOpts

type TestEnumParametersOpts struct {
	EnumHeaderStringArray optional.Interface
	EnumHeaderString      optional.String
	EnumQueryStringArray  optional.Interface
	EnumQueryString       optional.String
	EnumQueryInteger      optional.Int32
	EnumQueryDouble       optional.Float64
	EnumFormStringArray   optional.Interface
	EnumFormString        optional.String
}

type UpdatePetWithFormOpts

type UpdatePetWithFormOpts struct {
	Name   optional.String
	Status optional.String
}

type UploadFileOpts

type UploadFileOpts struct {
	AdditionalMetadata optional.String
	File               optional.Interface
}

type UploadFileWithRequiredFileOpts

type UploadFileWithRequiredFileOpts struct {
	AdditionalMetadata optional.String
}

type User

type User struct {
	Id        int64  `json:"id,omitempty" xml:"id"`
	Username  string `json:"username,omitempty" xml:"username"`
	FirstName string `json:"firstName,omitempty" xml:"firstName"`
	LastName  string `json:"lastName,omitempty" xml:"lastName"`
	Email     string `json:"email,omitempty" xml:"email"`
	Password  string `json:"password,omitempty" xml:"password"`
	Phone     string `json:"phone,omitempty" xml:"phone"`
	// User Status
	UserStatus int32 `json:"userStatus,omitempty" xml:"userStatus"`
}

type UserApiService

type UserApiService service

func (*UserApiService) CreateUser

func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Response, error)

UserApiService Create user This can only be done by the logged in user.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param user Created user object

func (*UserApiService) CreateUsersWithArrayInput

func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []User) (*http.Response, error)

UserApiService Creates list of users with given input array

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param user List of user object

func (*UserApiService) CreateUsersWithListInput

func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []User) (*http.Response, error)

UserApiService Creates list of users with given input array

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param user List of user object

func (*UserApiService) DeleteUser

func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error)

UserApiService Delete user This can only be done by the logged in user.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param username The name that needs to be deleted

func (*UserApiService) GetUserByName

func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error)

UserApiService Get user by user name

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param username The name that needs to be fetched. Use user1 for testing.

@return User

func (*UserApiService) LoginUser

func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error)

UserApiService Logs user into the system

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param username The user name for login
  • @param password The password for login in clear text

@return string

func (*UserApiService) LogoutUser

func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)

UserApiService Logs out current logged in user session

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

func (*UserApiService) UpdateUser

func (a *UserApiService) UpdateUser(ctx context.Context, username string, user User) (*http.Response, error)

UserApiService Updated user This can only be done by the logged in user.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param username name that need to be deleted
  • @param user Updated user object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL