Documentation
¶
Overview ¶
Package swaggerpetstore
This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
Index ¶
- Constants
- Variables
- func NewBaseController(cb callBuilderFactory) *baseController
- type ApiKeyCredentials
- type ClientInterface
- type Configuration
- type ConfigurationOptions
- func WithApiKeyCredentials(apiKeyCredentials ApiKeyCredentials) ConfigurationOptions
- func WithEnvironment(environment Environment) ConfigurationOptions
- func WithHttpConfiguration(httpConfiguration HttpConfiguration) ConfigurationOptions
- func WithPetstoreAuthCredentials(petstoreAuthCredentials PetstoreAuthCredentials) ConfigurationOptions
- type Environment
- type HttpConfiguration
- type HttpConfigurationOptions
- type PetController
- func (p *PetController) AddPet(ctx context.Context, body *models.Pet) (*http.Response, error)
- func (p *PetController) DeletePet(ctx context.Context, petId int64, apiKey *string) (*http.Response, error)
- func (p *PetController) FindPetsByStatus(ctx context.Context, status []models.Status2Enum) (models.ApiResponse[[]models.Pet], error)
- func (p *PetController) FindPetsByTags(ctx context.Context, tags []string) (models.ApiResponse[[]models.Pet], error)
- func (p *PetController) GetPetById(ctx context.Context, petId int64) (models.ApiResponse[models.Pet], error)
- func (p *PetController) UpdatePet(ctx context.Context, body *models.Pet) (*http.Response, error)
- func (p *PetController) UpdatePetWithForm(ctx context.Context, petId int64, name *string, status *string) (*http.Response, error)
- func (p *PetController) UploadFile(ctx context.Context, petId int64, additionalMetadata *string, ...) (models.ApiResponse[models.MApiResponse], error)
- type PetstoreAuthCredentials
- func (p PetstoreAuthCredentials) Authenticator() https.HttpInterceptor
- func (p PetstoreAuthCredentials) OAuthClientId() string
- func (p PetstoreAuthCredentials) OAuthRedirectUri() string
- func (p PetstoreAuthCredentials) OAuthScopes() []models.OAuthScopePetstoreAuthEnum
- func (p PetstoreAuthCredentials) OAuthToken() models.OAuthToken
- func (p PetstoreAuthCredentials) Validate() error
- func (p PetstoreAuthCredentials) WithOAuthClientId(oAuthClientId string) PetstoreAuthCredentials
- func (p PetstoreAuthCredentials) WithOAuthRedirectUri(oAuthRedirectUri string) PetstoreAuthCredentials
- func (p PetstoreAuthCredentials) WithOAuthScopes(oAuthScopes []models.OAuthScopePetstoreAuthEnum) PetstoreAuthCredentials
- func (p PetstoreAuthCredentials) WithOAuthToken(oAuthToken models.OAuthToken) PetstoreAuthCredentials
- type PetstoreAuthManager
- type RetryConfiguration
- type RetryConfigurationOptions
- type Server
- type StoreController
- func (s *StoreController) DeleteOrder(ctx context.Context, orderId int64) (*http.Response, error)
- func (s *StoreController) GetInventory(ctx context.Context) (models.ApiResponse[map[string]int], error)
- func (s *StoreController) GetOrderById(ctx context.Context, orderId int64) (models.ApiResponse[models.Order], error)
- func (s *StoreController) PlaceOrder(ctx context.Context, body *models.Order) (models.ApiResponse[models.Order], error)
- type UserController
- func (u *UserController) CreateUser(ctx context.Context, body *models.User) (*http.Response, error)
- func (u *UserController) CreateUsersWithArrayInput(ctx context.Context, body []models.User) (*http.Response, error)
- func (u *UserController) CreateUsersWithListInput(ctx context.Context, body []models.User) (*http.Response, error)
- func (u *UserController) DeleteUser(ctx context.Context, username string) (*http.Response, error)
- func (u *UserController) GetUserByName(ctx context.Context, username string) (models.ApiResponse[models.User], error)
- func (u *UserController) LoginUser(ctx context.Context, username string, password string) (models.ApiResponse[string], error)
- func (u *UserController) LogoutUser(ctx context.Context) (*http.Response, error)
- func (u *UserController) UpdateUser(ctx context.Context, username string, body *models.User) (*http.Response, error)
Constants ¶
const UserAgent = "APIMATIC 3.0"
Variables ¶
var NewAndAuth = https.NewAndAuth
NewAndAuth creates a new AndAuth.
var NewAuth = https.NewAuth
NewAuth creates a new Auth.
var NewHttpConfiguration = https.NewHttpConfiguration
NewHttpConfiguration creates a new HttpConfiguration.
var NewOrAuth = https.NewOrAuth
NewOrAuth creates a new OrAuth.
var NewRetryConfiguration = https.NewRetryConfiguration
NewRetryConfiguration creates a new RetryConfiguration.
var WithBackoffFactor = https.WithBackoffFactor
WithBackoffFactor sets the BackoffFactor.
var WithHttpMethodsToRetry = https.WithHttpMethodsToRetry
WithHttpMethodsToRetry sets the HttpMethodsToRetry.
var WithHttpStatusCodesToRetry = https.WithHttpStatusCodesToRetry
WithHttpStatusCodesToRetry sets the HttpStatusCodesToRetry.
var WithMaxRetryAttempts = https.WithMaxRetryAttempts
WithMaxRetryAttempts sets the MaxRetryAttempts.
var WithMaximumRetryWaitTime = https.WithMaximumRetryWaitTime
WithMaximumRetryWaitTime sets the MaximumRetryWaitTime.
var WithRetryConfiguration = https.WithRetryConfiguration
WithRetryConfiguration sets the RetryConfiguration.
var WithRetryInterval = https.WithRetryInterval
WithRetryInterval sets the RetryInterval.
var WithRetryOnTimeout = https.WithRetryOnTimeout
WithRetryOnTimeout sets the RetryOnTimeout.
var WithTimeout = https.WithTimeout
WithTimeout sets the Timeout.
var WithTransport = https.WithTransport
WithTransport sets the Transport.
Functions ¶
func NewBaseController ¶
func NewBaseController(cb callBuilderFactory) *baseController
NewBaseController creates a new instance of baseController. It takes a callBuilderFactory as a parameter and returns a pointer to the baseController.
Types ¶
type ApiKeyCredentials ¶
type ApiKeyCredentials struct {
// contains filtered or unexported fields
}
ApiKeyCredentials represents the credentials required for `api_key` authentication.
func NewApiKeyCredentials ¶
func NewApiKeyCredentials(apiKey string) ApiKeyCredentials
NewApiKeyCredentials creates a new instance of ApiKeyCredentials with provided parameters.
func (ApiKeyCredentials) ApiKey ¶
func (a ApiKeyCredentials) ApiKey() string
ApiKey returns the apiKey associated with the ApiKeyCredentials.
func (ApiKeyCredentials) Authenticator ¶
func (a ApiKeyCredentials) Authenticator() https.HttpInterceptor
Authenticator function returns HttpInterceptor function that provides authentication for API calls.
func (ApiKeyCredentials) Validate ¶
func (a ApiKeyCredentials) Validate() error
Validate function returns validation error associated with the ApiKeyCredentials.
func (ApiKeyCredentials) WithApiKey ¶
func (a ApiKeyCredentials) WithApiKey(apiKey string) ApiKeyCredentials
WithApiKey sets apiKey in ApiKeyCredentials.
type ClientInterface ¶
type ClientInterface interface { Configuration() Configuration CloneWithConfiguration(options ...ConfigurationOptions) ClientInterface PetController() *PetController StoreController() *StoreController UserController() *UserController PetstoreAuthManager() *PetstoreAuthManager }
Client is an interface representing the main client for accessing configuration and controllers.
func NewClient ¶
func NewClient(configuration Configuration) ClientInterface
NewClient is the constructor for creating a new client instance. It takes a Configuration object as a parameter and returns the Client interface.
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration holds configuration settings.
func CreateConfiguration ¶
func CreateConfiguration(options ...ConfigurationOptions) Configuration
CreateConfiguration creates a new Configuration with the provided options.
func CreateConfigurationFromEnvironment ¶
func CreateConfigurationFromEnvironment(options ...ConfigurationOptions) Configuration
CreateConfigurationFromEnvironment creates a new Configuration with default settings. It also configures various Configuration options.
func DefaultConfiguration ¶
func DefaultConfiguration() Configuration
DefaultConfiguration returns the default Configuration.
func (Configuration) ApiKeyCredentials ¶
func (c Configuration) ApiKeyCredentials() ApiKeyCredentials
ApiKeyCredentials returns the ApiKeyCredentials from the Configuration.
func (Configuration) Environment ¶
func (c Configuration) Environment() Environment
Environment returns the Environment from the Configuration.
func (Configuration) HttpConfiguration ¶
func (c Configuration) HttpConfiguration() HttpConfiguration
HttpConfiguration returns the HttpConfiguration from the Configuration.
func (Configuration) PetstoreAuthCredentials ¶
func (c Configuration) PetstoreAuthCredentials() PetstoreAuthCredentials
PetstoreAuthCredentials returns the PetstoreAuthCredentials from the Configuration.
type ConfigurationOptions ¶
type ConfigurationOptions func(*Configuration)
ConfigurationOptions represents a function type that can be used to apply options to the Configuration struct.
func WithApiKeyCredentials ¶
func WithApiKeyCredentials(apiKeyCredentials ApiKeyCredentials) ConfigurationOptions
WithApiKeyCredentials is an option that sets the ApiKeyCredentials in the Configuration.
func WithEnvironment ¶
func WithEnvironment(environment Environment) ConfigurationOptions
WithEnvironment is an option that sets the Environment in the Configuration.
func WithHttpConfiguration ¶
func WithHttpConfiguration(httpConfiguration HttpConfiguration) ConfigurationOptions
WithHttpConfiguration is an option that sets the HttpConfiguration in the Configuration.
func WithPetstoreAuthCredentials ¶
func WithPetstoreAuthCredentials(petstoreAuthCredentials PetstoreAuthCredentials) ConfigurationOptions
WithPetstoreAuthCredentials is an option that sets the PetstoreAuthCredentials in the Configuration.
type Environment ¶
type Environment string
Environment represents available environments.
const (
PRODUCTION Environment = "production"
)
type HttpConfiguration ¶
type HttpConfiguration = https.HttpConfiguration
HttpConfiguration holds the configuration options for the client.
func CreateHttpConfiguration ¶
func CreateHttpConfiguration(options ...HttpConfigurationOptions) HttpConfiguration
CreateHttpConfiguration creates a new HttpConfiguration with the provided options.
func DefaultHttpConfiguration ¶
func DefaultHttpConfiguration() HttpConfiguration
DefaultHttpConfiguration returns the default HttpConfiguration for HTTP requests. It also configures various HttpConfiguration options.
type HttpConfigurationOptions ¶
type HttpConfigurationOptions = https.HttpConfigurationOptions
HttpConfigurationOptions is a function type that modifies the HttpConfiguration.
type PetController ¶
type PetController struct {
// contains filtered or unexported fields
}
PetController represents a controller struct.
func NewPetController ¶
func NewPetController(baseController baseController) *PetController
NewPetController creates a new instance of PetController. It takes a baseController as a parameter and returns a pointer to the PetController.
func (*PetController) AddPet ¶
AddPet takes context, body as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. Add a new pet to the store
func (*PetController) DeletePet ¶
func (p *PetController) DeletePet( ctx context.Context, petId int64, apiKey *string) ( *http.Response, error)
DeletePet takes context, petId, apiKey as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. Deletes a pet
func (*PetController) FindPetsByStatus ¶
func (p *PetController) FindPetsByStatus( ctx context.Context, status []models.Status2Enum) ( models.ApiResponse[[]models.Pet], error)
FindPetsByStatus takes context, status as parameters and returns an models.ApiResponse with []models.Pet data and an error if there was an issue with the request or response. Multiple status values can be provided with comma separated strings
func (*PetController) FindPetsByTags ¶
func (p *PetController) FindPetsByTags( ctx context.Context, tags []string) ( models.ApiResponse[[]models.Pet], error)
FindPetsByTags takes context, tags as parameters and returns an models.ApiResponse with []models.Pet data and an error if there was an issue with the request or response. Deprecated: findPetsByTags is deprecated Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
func (*PetController) GetPetById ¶
func (p *PetController) GetPetById( ctx context.Context, petId int64) ( models.ApiResponse[models.Pet], error)
GetPetById takes context, petId as parameters and returns an models.ApiResponse with models.Pet data and an error if there was an issue with the request or response. Returns a single pet
func (*PetController) UpdatePet ¶
UpdatePet takes context, body as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. Update an existing pet
func (*PetController) UpdatePetWithForm ¶
func (p *PetController) UpdatePetWithForm( ctx context.Context, petId int64, name *string, status *string) ( *http.Response, error)
UpdatePetWithForm takes context, petId, name, status as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. Updates a pet in the store with form data
func (*PetController) UploadFile ¶
func (p *PetController) UploadFile( ctx context.Context, petId int64, additionalMetadata *string, file *models.FileWrapper) ( models.ApiResponse[models.MApiResponse], error)
UploadFile takes context, petId, additionalMetadata, file as parameters and returns an models.ApiResponse with models.MApiResponse data and an error if there was an issue with the request or response. uploads an image
type PetstoreAuthCredentials ¶
type PetstoreAuthCredentials struct {
// contains filtered or unexported fields
}
PetstoreAuthCredentials represents the credentials required for `petstore_auth` authentication.
func NewPetstoreAuthCredentials ¶
func NewPetstoreAuthCredentials( oAuthClientId string, oAuthRedirectUri string) PetstoreAuthCredentials
NewPetstoreAuthCredentials creates a new instance of PetstoreAuthCredentials with provided parameters.
func (PetstoreAuthCredentials) Authenticator ¶
func (p PetstoreAuthCredentials) Authenticator() https.HttpInterceptor
Authenticator function returns HttpInterceptor function that provides authentication for API calls.
func (PetstoreAuthCredentials) OAuthClientId ¶
func (p PetstoreAuthCredentials) OAuthClientId() string
OAuthClientId returns the oAuthClientId associated with the PetstoreAuthCredentials.
func (PetstoreAuthCredentials) OAuthRedirectUri ¶
func (p PetstoreAuthCredentials) OAuthRedirectUri() string
OAuthRedirectUri returns the oAuthRedirectUri associated with the PetstoreAuthCredentials.
func (PetstoreAuthCredentials) OAuthScopes ¶
func (p PetstoreAuthCredentials) OAuthScopes() []models.OAuthScopePetstoreAuthEnum
OAuthScopes returns the oAuthScopes associated with the PetstoreAuthCredentials.
func (PetstoreAuthCredentials) OAuthToken ¶
func (p PetstoreAuthCredentials) OAuthToken() models.OAuthToken
OAuthToken returns the oAuthToken associated with the PetstoreAuthCredentials.
func (PetstoreAuthCredentials) Validate ¶
func (p PetstoreAuthCredentials) Validate() error
Validate function returns validation error associated with the PetstoreAuthCredentials.
func (PetstoreAuthCredentials) WithOAuthClientId ¶
func (p PetstoreAuthCredentials) WithOAuthClientId(oAuthClientId string) PetstoreAuthCredentials
WithOAuthClientId sets oAuthClientId in PetstoreAuthCredentials.
func (PetstoreAuthCredentials) WithOAuthRedirectUri ¶
func (p PetstoreAuthCredentials) WithOAuthRedirectUri(oAuthRedirectUri string) PetstoreAuthCredentials
WithOAuthRedirectUri sets oAuthRedirectUri in PetstoreAuthCredentials.
func (PetstoreAuthCredentials) WithOAuthScopes ¶
func (p PetstoreAuthCredentials) WithOAuthScopes(oAuthScopes []models.OAuthScopePetstoreAuthEnum) PetstoreAuthCredentials
WithOAuthScopes sets oAuthScopes in PetstoreAuthCredentials.
func (PetstoreAuthCredentials) WithOAuthToken ¶
func (p PetstoreAuthCredentials) WithOAuthToken(oAuthToken models.OAuthToken) PetstoreAuthCredentials
WithOAuthToken sets oAuthToken in PetstoreAuthCredentials.
type PetstoreAuthManager ¶
type PetstoreAuthManager struct {
// contains filtered or unexported fields
}
PetstoreAuthManager is a manager responsible for handling authorization related operations.
func (*PetstoreAuthManager) BuildAuthorizationUrl ¶
func (p *PetstoreAuthManager) BuildAuthorizationUrl(state *string) string
BuildAuthorizationUrl checks the expiry of OAuth Token.
func (*PetstoreAuthManager) OAuthTokenIsExpired ¶
func (p *PetstoreAuthManager) OAuthTokenIsExpired() bool
OAuthTokenIsExpired checks the expiry of OAuth Token.
type RetryConfiguration ¶
type RetryConfiguration = https.RetryConfiguration
RetryConfiguration holds the configuration options for the client.
func CreateRetryConfiguration ¶
func CreateRetryConfiguration(options ...RetryConfigurationOptions) RetryConfiguration
CreateRetryConfiguration creates a new RetryConfiguration with the provided options.
func DefaultRetryConfiguration ¶
func DefaultRetryConfiguration() RetryConfiguration
DefaultRetryConfiguration returns the default RetryConfiguration for HTTP requests. It also configures various retry options.
type RetryConfigurationOptions ¶
type RetryConfigurationOptions = https.RetryConfigurationOptions
RetryConfigurationOptions is a function type that modifies the RetryConfiguration.
type StoreController ¶
type StoreController struct {
// contains filtered or unexported fields
}
StoreController represents a controller struct.
func NewStoreController ¶
func NewStoreController(baseController baseController) *StoreController
NewStoreController creates a new instance of StoreController. It takes a baseController as a parameter and returns a pointer to the StoreController.
func (*StoreController) DeleteOrder ¶
DeleteOrder takes context, orderId as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
func (*StoreController) GetInventory ¶
func (s *StoreController) GetInventory(ctx context.Context) ( models.ApiResponse[map[string]int], error)
GetInventory takes context as parameters and returns an models.ApiResponse with map[string]int data and an error if there was an issue with the request or response. Returns a map of status codes to quantities
func (*StoreController) GetOrderById ¶
func (s *StoreController) GetOrderById( ctx context.Context, orderId int64) ( models.ApiResponse[models.Order], error)
GetOrderById takes context, orderId as parameters and returns an models.ApiResponse with models.Order data and an error if there was an issue with the request or response. For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
func (*StoreController) PlaceOrder ¶
func (s *StoreController) PlaceOrder( ctx context.Context, body *models.Order) ( models.ApiResponse[models.Order], error)
PlaceOrder takes context, body as parameters and returns an models.ApiResponse with models.Order data and an error if there was an issue with the request or response. Place an order for a pet
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController represents a controller struct.
func NewUserController ¶
func NewUserController(baseController baseController) *UserController
NewUserController creates a new instance of UserController. It takes a baseController as a parameter and returns a pointer to the UserController.
func (*UserController) CreateUser ¶
func (u *UserController) CreateUser( ctx context.Context, body *models.User) ( *http.Response, error)
CreateUser takes context, body as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. This can only be done by the logged in user.
func (*UserController) CreateUsersWithArrayInput ¶
func (u *UserController) CreateUsersWithArrayInput( ctx context.Context, body []models.User) ( *http.Response, error)
CreateUsersWithArrayInput takes context, body as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. Creates list of users with given input array
func (*UserController) CreateUsersWithListInput ¶
func (u *UserController) CreateUsersWithListInput( ctx context.Context, body []models.User) ( *http.Response, error)
CreateUsersWithListInput takes context, body as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. Creates list of users with given input array
func (*UserController) DeleteUser ¶
DeleteUser takes context, username as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. This can only be done by the logged in user.
func (*UserController) GetUserByName ¶
func (u *UserController) GetUserByName( ctx context.Context, username string) ( models.ApiResponse[models.User], error)
GetUserByName takes context, username as parameters and returns an models.ApiResponse with models.User data and an error if there was an issue with the request or response. Get user by user name
func (*UserController) LoginUser ¶
func (u *UserController) LoginUser( ctx context.Context, username string, password string) ( models.ApiResponse[string], error)
LoginUser takes context, username, password as parameters and returns an models.ApiResponse with string data and an error if there was an issue with the request or response. Logs user into the system
func (*UserController) LogoutUser ¶
LogoutUser takes context as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. Logs out current logged in user session
func (*UserController) UpdateUser ¶
func (u *UserController) UpdateUser( ctx context.Context, username string, body *models.User) ( *http.Response, error)
UpdateUser takes context, username, body as parameters and returns an models.ApiResponse with data and an error if there was an issue with the request or response. This can only be done by the logged in user.