Documentation
¶
Index ¶
- Constants
- Variables
- func BindFormExplodeParam(paramName string, required bool, queryParams url.Values, dest any) error
- func BindSimpleParam(paramName string, paramLocation ParamLocation, value string, dest any) error
- func BindStringToObject(src string, dst any) error
- func GetOpenAPISpecJSON() ([]byte, error)
- func NewCreateItemRequest(server string, body createItemJSONRequestBody) (*http.Request, error)
- func NewCreateItemRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewCreateOrderRequest(server string, body createOrderJSONRequestBody) (*http.Request, error)
- func NewCreateOrderRequestWithApplicationJsonPatchJsonBody(server string, body createOrderApplicationJsonPatchJsonRequestBody) (*http.Request, error)
- func NewCreateOrderRequestWithApplicationMergePatchJsonBody(server string, body createOrderApplicationMergePatchJsonRequestBody) (*http.Request, error)
- func NewCreateOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewCreatePetRequest(server string, body createPetJSONRequestBody) (*http.Request, error)
- func NewCreatePetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGetQuxRequest(server string) (*http.Request, error)
- func NewGetStatusRequest(server string) (*http.Request, error)
- func NewGetZapRequest(server string) (*http.Request, error)
- func NewListEntitiesRequest(server string) (*http.Request, error)
- func NewListItemsRequest(server string) (*http.Request, error)
- func NewPatchResourceRequest(server string, id string, body patchResourceJSONRequestBody) (*http.Request, error)
- func NewPatchResourceRequestWithApplicationJsonPatchJsonBody(server string, id string, ...) (*http.Request, error)
- func NewPatchResourceRequestWithApplicationMergePatchJsonBody(server string, id string, ...) (*http.Request, error)
- func NewPatchResourceRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostFooRequest(server string, params *PostFooParams, body postFooJSONRequestBody) (*http.Request, error)
- func NewPostFooRequestWithBody(server string, params *PostFooParams, contentType string, body io.Reader) (*http.Request, error)
- func NewPostQuxRequest(server string, body postQuxJSONRequestBody) (*http.Request, error)
- func NewPostQuxRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostZapRequest(server string, body postZapJSONRequestBody) (*http.Request, error)
- func NewPostZapRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewQueryRequest(server string, body queryJSONRequestBody) (*http.Request, error)
- func NewQueryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func StyleFormExplodeParam(paramName string, paramLocation ParamLocation, value any) (string, error)
- func StyleSimpleParam(paramName string, paramLocation ParamLocation, value any) (string, error)
- type Bar
- type Bar2
- type Binder
- type Client
- func (c *Client) CreateItem(ctx context.Context, body createItemJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateItemWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) CreateOrder(ctx context.Context, body createOrderJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateOrderWithApplicationJsonPatchJsonBody(ctx context.Context, body createOrderApplicationJsonPatchJsonRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateOrderWithApplicationMergePatchJsonBody(ctx context.Context, body createOrderApplicationMergePatchJsonRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateOrderWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) CreatePet(ctx context.Context, body createPetJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreatePetWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListEntities(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListItems(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PatchResource(ctx context.Context, id string, body patchResourceJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PatchResourceWithApplicationJsonPatchJsonBody(ctx context.Context, id string, ...) (*http.Response, error)
- func (c *Client) PatchResourceWithApplicationMergePatchJsonBody(ctx context.Context, id string, ...) (*http.Response, error)
- func (c *Client) PatchResourceWithBody(ctx context.Context, id string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostFoo(ctx context.Context, params *PostFooParams, body postFooJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostFooWithBody(ctx context.Context, params *PostFooParams, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostQux(ctx context.Context, body postQuxJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostQuxWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostZap(ctx context.Context, body postZapJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostZapWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Query(ctx context.Context, body queryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) QueryWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientHttpError
- type ClientInterface
- type ClientOption
- type CreateItemJSONRequest
- type CreateItemResponse
- type CreateOrderJSONRequest1
- type CreateOrderJSONRequest2
- type CreateOrderJSONRequest3
- type CreatePetJSONRequest
- type CustomQux
- type Date
- type GetEntities200Response
- type GetQuxJSONResponse
- type GetStatusResponse
- type GetZapJSONResponse
- type HttpRequestDoer
- type JSONPatch
- type JSONPatchItem
- type ListEntitiesJSONResponse
- type ListItemsResponse
- type Metadata
- type Nullable
- func (n Nullable[T]) Get() (T, error)
- func (n Nullable[T]) IsNull() bool
- func (n Nullable[T]) IsSpecified() bool
- func (n Nullable[T]) MarshalJSON() ([]byte, error)
- func (n Nullable[T]) MustGet() T
- func (n *Nullable[T]) Set(value T)
- func (n *Nullable[T]) SetNull()
- func (n *Nullable[T]) SetUnspecified()
- func (n *Nullable[T]) UnmarshalJSON(data []byte) error
- type Order
- type ParamLocation
- type PatchResourceJSONResponse2001
- type PatchResourceJSONResponse2002
- type PatchResourcesID200ResponseJSONOneOf11
- type PatchResourcesID200ResponseJSONOneOf12
- type PatchResourcesID200ResponseJSONOneOf21
- type PatchResourcesID200ResponseJSONOneOf22
- type Pet
- type PostFooJSONRequest
- type PostFooJSONResponse
- type PostFooParams
- type PostOrdersRequest
- type QueryJSONRequest
- type QueryResponse
- type RequestEditorFn
- type Resource
- type ResourceMVO
- type SimpleClient
- func (c *SimpleClient) CreateItem(ctx context.Context, body createItemJSONRequestBody, ...) (CreateItemResponse, error)
- func (c *SimpleClient) CreateOrder(ctx context.Context, body createOrderJSONRequestBody, ...) (Order, error)
- func (c *SimpleClient) CreatePet(ctx context.Context, body createPetJSONRequestBody, ...) (Pet, error)
- func (c *SimpleClient) GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (map[string]any, error)
- func (c *SimpleClient) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (GetStatusResponse, error)
- func (c *SimpleClient) GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (map[string]any, error)
- func (c *SimpleClient) ListEntities(ctx context.Context, reqEditors ...RequestEditorFn) (map[string]any, error)
- func (c *SimpleClient) ListItems(ctx context.Context, reqEditors ...RequestEditorFn) (ListItemsResponse, error)
- func (c *SimpleClient) PostFoo(ctx context.Context, params *PostFooParams, body postFooJSONRequestBody, ...) (map[string]any, error)
- func (c *SimpleClient) Query(ctx context.Context, body queryJSONRequestBody, reqEditors ...RequestEditorFn) (QueryResponse, error)
- type Widget
- type Zap
Constants ¶
const DateFormat = "2006-01-02"
Variables ¶
var ErrNullableIsNull = errors.New("nullable value is null")
ErrNullableIsNull is returned when trying to get a value from a null Nullable.
var ErrNullableNotSpecified = errors.New("nullable value is not specified")
ErrNullableNotSpecified is returned when trying to get a value from an unspecified Nullable.
Functions ¶
func BindFormExplodeParam ¶
BindFormExplodeParam binds a form-style parameter with explode to a destination. Form style is the default for query and cookie parameters. This handles the exploded case where arrays come as multiple query params. Arrays: ?param=a¶m=b -> []string{"a", "b"} (values passed as slice) Objects: ?key1=value1&key2=value2 -> struct{Key1, Key2} (queryParams passed)
func BindSimpleParam ¶
func BindSimpleParam(paramName string, paramLocation ParamLocation, value string, dest any) error
BindSimpleParam binds a simple-style parameter without explode to a destination. Simple style is the default for path and header parameters. Arrays: a,b,c -> []string{"a", "b", "c"} Objects: key1,value1,key2,value2 -> struct{Key1, Key2}
func BindStringToObject ¶
BindStringToObject binds a string value to a destination object. It handles primitives, encoding.TextUnmarshaler, and the Binder interface.
func GetOpenAPISpecJSON ¶
GetOpenAPISpecJSON returns the raw OpenAPI spec as JSON bytes.
func NewCreateItemRequest ¶
NewCreateItemRequest creates a POST request for /items with application/json body
func NewCreateItemRequestWithBody ¶
func NewCreateItemRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateItemRequestWithBody creates a POST request for /items with any body
func NewCreateOrderRequest ¶
NewCreateOrderRequest creates a POST request for /orders with application/json body
func NewCreateOrderRequestWithApplicationJsonPatchJsonBody ¶
func NewCreateOrderRequestWithApplicationJsonPatchJsonBody(server string, body createOrderApplicationJsonPatchJsonRequestBody) (*http.Request, error)
NewCreateOrderRequestWithApplicationJsonPatchJsonBody creates a POST request for /orders with application/json-patch+json body
func NewCreateOrderRequestWithApplicationMergePatchJsonBody ¶
func NewCreateOrderRequestWithApplicationMergePatchJsonBody(server string, body createOrderApplicationMergePatchJsonRequestBody) (*http.Request, error)
NewCreateOrderRequestWithApplicationMergePatchJsonBody creates a POST request for /orders with application/merge-patch+json body
func NewCreateOrderRequestWithBody ¶
func NewCreateOrderRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateOrderRequestWithBody creates a POST request for /orders with any body
func NewCreatePetRequest ¶
NewCreatePetRequest creates a POST request for /pets with application/json body
func NewCreatePetRequestWithBody ¶
func NewCreatePetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreatePetRequestWithBody creates a POST request for /pets with any body
func NewGetQuxRequest ¶
NewGetQuxRequest creates a GET request for /qux
func NewGetStatusRequest ¶
NewGetStatusRequest creates a GET request for /status
func NewGetZapRequest ¶
NewGetZapRequest creates a GET request for /zap
func NewListEntitiesRequest ¶
NewListEntitiesRequest creates a GET request for /entities
func NewListItemsRequest ¶
NewListItemsRequest creates a GET request for /items
func NewPatchResourceRequest ¶
func NewPatchResourceRequest(server string, id string, body patchResourceJSONRequestBody) (*http.Request, error)
NewPatchResourceRequest creates a PATCH request for /resources/{id} with application/json body
func NewPatchResourceRequestWithApplicationJsonPatchJsonBody ¶
func NewPatchResourceRequestWithApplicationJsonPatchJsonBody(server string, id string, body patchResourceApplicationJsonPatchJsonRequestBody) (*http.Request, error)
NewPatchResourceRequestWithApplicationJsonPatchJsonBody creates a PATCH request for /resources/{id} with application/json-patch+json body
func NewPatchResourceRequestWithApplicationMergePatchJsonBody ¶
func NewPatchResourceRequestWithApplicationMergePatchJsonBody(server string, id string, body patchResourceApplicationMergePatchJsonRequestBody) (*http.Request, error)
NewPatchResourceRequestWithApplicationMergePatchJsonBody creates a PATCH request for /resources/{id} with application/merge-patch+json body
func NewPatchResourceRequestWithBody ¶
func NewPatchResourceRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error)
NewPatchResourceRequestWithBody creates a PATCH request for /resources/{id} with any body
func NewPostFooRequest ¶
func NewPostFooRequest(server string, params *PostFooParams, body postFooJSONRequestBody) (*http.Request, error)
NewPostFooRequest creates a POST request for /foo with application/json body
func NewPostFooRequestWithBody ¶
func NewPostFooRequestWithBody(server string, params *PostFooParams, contentType string, body io.Reader) (*http.Request, error)
NewPostFooRequestWithBody creates a POST request for /foo with any body
func NewPostQuxRequest ¶
NewPostQuxRequest creates a POST request for /qux with application/json body
func NewPostQuxRequestWithBody ¶
func NewPostQuxRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostQuxRequestWithBody creates a POST request for /qux with any body
func NewPostZapRequest ¶
NewPostZapRequest creates a POST request for /zap with application/json body
func NewPostZapRequestWithBody ¶
func NewPostZapRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostZapRequestWithBody creates a POST request for /zap with any body
func NewQueryRequest ¶
NewQueryRequest creates a POST request for /query with application/json body
func NewQueryRequestWithBody ¶
func NewQueryRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewQueryRequestWithBody creates a POST request for /query with any body
func StyleFormExplodeParam ¶
func StyleFormExplodeParam(paramName string, paramLocation ParamLocation, value any) (string, error)
StyleFormExplodeParam serializes a value using form style (RFC 6570) with exploding. Form style is the default for query and cookie parameters. Primitives: paramName=value Arrays: paramName=a¶mName=b¶mName=c Objects: key1=value1&key2=value2
func StyleSimpleParam ¶
func StyleSimpleParam(paramName string, paramLocation ParamLocation, value any) (string, error)
StyleSimpleParam serializes a value using simple style (RFC 6570) without exploding. Simple style is the default for path and header parameters. Arrays are comma-separated: a,b,c Objects are key,value pairs: key1,value1,key2,value2
Types ¶
type Bar ¶
type Bar struct {
Value *string `json:"value,omitempty" form:"value,omitempty"`
}
#/components/schemas/Bar
func (*Bar) ApplyDefaults ¶
func (s *Bar) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type Bar2 ¶
type Bar2 struct {
Value *float32 `json:"value,omitempty" form:"value,omitempty"`
}
#/components/schemas/Bar2
func (*Bar2) ApplyDefaults ¶
func (s *Bar2) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the OpenAPI spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
NewClient creates a new Client with reasonable defaults.
func (*Client) CreateItem ¶
func (c *Client) CreateItem(ctx context.Context, body createItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateItem makes a POST request to /items with application/json body
func (*Client) CreateItemWithBody ¶
func (*Client) CreateOrder ¶
func (c *Client) CreateOrder(ctx context.Context, body createOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateOrder makes a POST request to /orders with application/json body
func (*Client) CreateOrderWithApplicationJsonPatchJsonBody ¶
func (c *Client) CreateOrderWithApplicationJsonPatchJsonBody(ctx context.Context, body createOrderApplicationJsonPatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateOrderWithApplicationJsonPatchJsonBody makes a POST request to /orders with application/json-patch+json body
func (*Client) CreateOrderWithApplicationMergePatchJsonBody ¶
func (c *Client) CreateOrderWithApplicationMergePatchJsonBody(ctx context.Context, body createOrderApplicationMergePatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateOrderWithApplicationMergePatchJsonBody makes a POST request to /orders with application/merge-patch+json body
func (*Client) CreateOrderWithBody ¶
func (*Client) CreatePet ¶
func (c *Client) CreatePet(ctx context.Context, body createPetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
CreatePet makes a POST request to /pets with application/json body
func (*Client) CreatePetWithBody ¶
func (*Client) ListEntities ¶
func (*Client) PatchResource ¶
func (c *Client) PatchResource(ctx context.Context, id string, body patchResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchResource makes a PATCH request to /resources/{id} with application/json body
func (*Client) PatchResourceWithApplicationJsonPatchJsonBody ¶
func (c *Client) PatchResourceWithApplicationJsonPatchJsonBody(ctx context.Context, id string, body patchResourceApplicationJsonPatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchResourceWithApplicationJsonPatchJsonBody makes a PATCH request to /resources/{id} with application/json-patch+json body
func (*Client) PatchResourceWithApplicationMergePatchJsonBody ¶
func (c *Client) PatchResourceWithApplicationMergePatchJsonBody(ctx context.Context, id string, body patchResourceApplicationMergePatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchResourceWithApplicationMergePatchJsonBody makes a PATCH request to /resources/{id} with application/merge-patch+json body
func (*Client) PatchResourceWithBody ¶
func (*Client) PostFoo ¶
func (c *Client) PostFoo(ctx context.Context, params *PostFooParams, body postFooJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PostFoo makes a POST request to /foo with application/json body
func (*Client) PostFooWithBody ¶
func (*Client) PostQux ¶
func (c *Client) PostQux(ctx context.Context, body postQuxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PostQux makes a POST request to /qux with application/json body
func (*Client) PostQuxWithBody ¶
func (*Client) PostZap ¶
func (c *Client) PostZap(ctx context.Context, body postZapJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PostZap makes a POST request to /zap with application/json body
func (*Client) PostZapWithBody ¶
type ClientHttpError ¶
ClientHttpError represents an HTTP error response from the server. The type parameter E is the type of the parsed error body.
func (*ClientHttpError[E]) Error ¶
func (e *ClientHttpError[E]) Error() string
type ClientInterface ¶
type ClientInterface interface {
// ListEntities makes a GET request to /entities
ListEntities(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostFooWithBody makes a POST request to /foo
PostFooWithBody(ctx context.Context, params *PostFooParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostFoo(ctx context.Context, params *PostFooParams, body postFooJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListItems makes a GET request to /items
ListItems(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateItemWithBody makes a POST request to /items
CreateItemWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateItem(ctx context.Context, body createItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateOrderWithBody makes a POST request to /orders
CreateOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateOrder(ctx context.Context, body createOrderJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateOrderWithApplicationJsonPatchJsonBody(ctx context.Context, body createOrderApplicationJsonPatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateOrderWithApplicationMergePatchJsonBody(ctx context.Context, body createOrderApplicationMergePatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreatePetWithBody makes a POST request to /pets
CreatePetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreatePet(ctx context.Context, body createPetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueryWithBody makes a POST request to /query
QueryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
Query(ctx context.Context, body queryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetQux makes a GET request to /qux
GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostQuxWithBody makes a POST request to /qux
PostQuxWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostQux(ctx context.Context, body postQuxJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PatchResourceWithBody makes a PATCH request to /resources/{id}
PatchResourceWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchResource(ctx context.Context, id string, body patchResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchResourceWithApplicationJsonPatchJsonBody(ctx context.Context, id string, body patchResourceApplicationJsonPatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchResourceWithApplicationMergePatchJsonBody(ctx context.Context, id string, body patchResourceApplicationMergePatchJsonRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetStatus makes a GET request to /status
GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetZap makes a GET request to /zap
GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostZapWithBody makes a POST request to /zap
PostZapWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostZap(ctx context.Context, body postZapJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
ClientInterface is the interface specification for the client.
type ClientOption ¶
ClientOption allows setting custom parameters during construction.
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type CreateItemJSONRequest ¶
type CreateItemJSONRequest struct {
Name *string `json:"name,omitempty" form:"name,omitempty"`
}
#/paths//items/post/requestBody/content/application/json/schema
func (*CreateItemJSONRequest) ApplyDefaults ¶
func (s *CreateItemJSONRequest) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type CreateItemResponse ¶
type CreateItemResponse struct {
ID *string `json:"id,omitempty" form:"id,omitempty"`
Name *string `json:"name,omitempty" form:"name,omitempty"`
}
#/components/schemas/CreateItemResponse
func (*CreateItemResponse) ApplyDefaults ¶
func (s *CreateItemResponse) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type CreateOrderJSONRequest1 ¶
type CreateOrderJSONRequest1 struct {
ID *string `json:"id,omitempty" form:"id,omitempty"`
Product *string `json:"product,omitempty" form:"product,omitempty"`
}
#/paths//orders/post/requestBody/content/application/json/schema
func (*CreateOrderJSONRequest1) ApplyDefaults ¶
func (s *CreateOrderJSONRequest1) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type CreateOrderJSONRequest2 ¶
type CreateOrderJSONRequest2 struct {
Product *string `json:"product,omitempty" form:"product,omitempty"`
}
#/paths//orders/post/requestBody/content/application/merge-patch+json/schema
func (*CreateOrderJSONRequest2) ApplyDefaults ¶
func (s *CreateOrderJSONRequest2) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type CreateOrderJSONRequest3 ¶
type CreateOrderJSONRequest3 = []PostOrdersRequest
#/paths//orders/post/requestBody/content/application/json-patch+json/schema
type CreatePetJSONRequest ¶
type CreatePetJSONRequest struct {
Name *string `json:"name,omitempty" form:"name,omitempty"`
Species *string `json:"species,omitempty" form:"species,omitempty"`
}
#/paths//pets/post/requestBody/content/application/json/schema
func (*CreatePetJSONRequest) ApplyDefaults ¶
func (s *CreatePetJSONRequest) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type CustomQux ¶
type CustomQux struct {
Label *string `json:"label,omitempty" form:"label,omitempty"`
}
#/components/schemas/Qux
func (*CustomQux) ApplyDefaults ¶
func (s *CustomQux) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type Date ¶
func (Date) MarshalJSON ¶
func (Date) MarshalText ¶
MarshalText implements encoding.TextMarshaler for Date.
func (*Date) UnmarshalJSON ¶
func (*Date) UnmarshalText ¶
type GetEntities200Response ¶
type GetEntities200Response = []Widget
#/paths//entities/get/responses/200/content/application/json/schema/properties/data
type GetQuxJSONResponse ¶
type GetQuxJSONResponse struct {
Data *string `json:"data,omitempty" form:"data,omitempty"`
}
#/paths//qux/get/responses/200/content/application/json/schema
func (*GetQuxJSONResponse) ApplyDefaults ¶
func (s *GetQuxJSONResponse) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type GetStatusResponse ¶
type GetStatusResponse struct {
Status *string `json:"status,omitempty" form:"status,omitempty"`
Timestamp *string `json:"timestamp,omitempty" form:"timestamp,omitempty"`
}
#/components/schemas/GetStatusResponse
func (*GetStatusResponse) ApplyDefaults ¶
func (s *GetStatusResponse) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type GetZapJSONResponse ¶
type GetZapJSONResponse struct {
Result *string `json:"result,omitempty" form:"result,omitempty"`
}
#/paths//zap/get/responses/200/content/application/json/schema
func (*GetZapJSONResponse) ApplyDefaults ¶
func (s *GetZapJSONResponse) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type HttpRequestDoer ¶
HttpRequestDoer performs HTTP requests. The standard http.Client implements this interface.
type JSONPatchItem ¶
type JSONPatchItem struct {
Op *string `json:"op,omitempty" form:"op,omitempty"`
Path *string `json:"path,omitempty" form:"path,omitempty"`
}
#/components/schemas/JsonPatch/items
func (*JSONPatchItem) ApplyDefaults ¶
func (s *JSONPatchItem) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type ListEntitiesJSONResponse ¶
type ListEntitiesJSONResponse struct {
Data []Widget `json:"data,omitempty" form:"data,omitempty"`
Metadata string `json:"metadata,omitempty" form:"metadata,omitempty"`
}
#/paths//entities/get/responses/200/content/application/json/schema
func (*ListEntitiesJSONResponse) ApplyDefaults ¶
func (s *ListEntitiesJSONResponse) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type Nullable ¶
Nullable is a generic type that can distinguish between: - Field not provided (unspecified) - Field explicitly set to null - Field has a value
This is implemented as a map[bool]T where: - Empty map: unspecified - map[false]T: explicitly null - map[true]T: has a value
func NewNullNullable ¶
NewNullNullable creates a Nullable that is explicitly null.
func NewNullableWithValue ¶
NewNullableWithValue creates a Nullable with the given value.
func (Nullable[T]) IsSpecified ¶
IsSpecified returns true if the field was provided (either null or a value).
func (Nullable[T]) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (Nullable[T]) MustGet ¶
func (n Nullable[T]) MustGet() T
MustGet returns the value or panics if null or unspecified.
func (*Nullable[T]) SetNull ¶
func (n *Nullable[T]) SetNull()
SetNull marks the field as explicitly null.
func (*Nullable[T]) SetUnspecified ¶
func (n *Nullable[T]) SetUnspecified()
SetUnspecified clears the field (as if it was never set).
func (*Nullable[T]) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Order ¶
type Order struct {
ID *string `json:"id,omitempty" form:"id,omitempty"`
Product *string `json:"product,omitempty" form:"product,omitempty"`
}
#/components/schemas/Order
func (*Order) ApplyDefaults ¶
func (s *Order) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type ParamLocation ¶
type ParamLocation int
ParamLocation indicates where a parameter is located in an HTTP request.
const ( ParamLocationUndefined ParamLocation = iota ParamLocationQuery ParamLocationPath ParamLocationHeader ParamLocationCookie )
type PatchResourceJSONResponse2001 ¶
type PatchResourceJSONResponse2001 struct {
Resource *Resource
PatchResourcesID200ResponseJSONOneOf11 *PatchResourcesID200ResponseJSONOneOf11
PatchResourcesID200ResponseJSONOneOf21 *PatchResourcesID200ResponseJSONOneOf21
}
#/paths//resources/{id}/patch/responses/200/content/application/json-patch+json/schema
func (*PatchResourceJSONResponse2001) ApplyDefaults ¶
func (u *PatchResourceJSONResponse2001) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
func (PatchResourceJSONResponse2001) MarshalJSON ¶
func (u PatchResourceJSONResponse2001) MarshalJSON() ([]byte, error)
func (*PatchResourceJSONResponse2001) UnmarshalJSON ¶
func (u *PatchResourceJSONResponse2001) UnmarshalJSON(data []byte) error
type PatchResourceJSONResponse2002 ¶
type PatchResourceJSONResponse2002 struct {
Resource *Resource
PatchResourcesID200ResponseJSONOneOf12 *PatchResourcesID200ResponseJSONOneOf12
PatchResourcesID200ResponseJSONOneOf22 *PatchResourcesID200ResponseJSONOneOf22
}
#/paths//resources/{id}/patch/responses/200/content/application/json-patch-query+json/schema
func (*PatchResourceJSONResponse2002) ApplyDefaults ¶
func (u *PatchResourceJSONResponse2002) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
func (PatchResourceJSONResponse2002) MarshalJSON ¶
func (u PatchResourceJSONResponse2002) MarshalJSON() ([]byte, error)
func (*PatchResourceJSONResponse2002) UnmarshalJSON ¶
func (u *PatchResourceJSONResponse2002) UnmarshalJSON(data []byte) error
type PatchResourcesID200ResponseJSONOneOf11 ¶
type PatchResourcesID200ResponseJSONOneOf11 = []Resource
#/paths//resources/{id}/patch/responses/200/content/application/json-patch+json/schema/oneOf/1
type PatchResourcesID200ResponseJSONOneOf12 ¶
type PatchResourcesID200ResponseJSONOneOf12 = []Resource
#/paths//resources/{id}/patch/responses/200/content/application/json-patch-query+json/schema/oneOf/1
type PatchResourcesID200ResponseJSONOneOf21 ¶
#/paths//resources/{id}/patch/responses/200/content/application/json-patch+json/schema/oneOf/2
type PatchResourcesID200ResponseJSONOneOf22 ¶
#/paths//resources/{id}/patch/responses/200/content/application/json-patch-query+json/schema/oneOf/2
type Pet ¶
type Pet struct {
ID *int `json:"id,omitempty" form:"id,omitempty"`
Name *string `json:"name,omitempty" form:"name,omitempty"`
}
#/components/schemas/Pet
func (*Pet) ApplyDefaults ¶
func (s *Pet) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type PostFooJSONRequest ¶
type PostFooJSONRequest struct {
Value *int `json:"value,omitempty" form:"value,omitempty"`
}
#/paths//foo/post/requestBody/content/application/json/schema
func (*PostFooJSONRequest) ApplyDefaults ¶
func (s *PostFooJSONRequest) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type PostFooJSONResponse ¶
type PostFooJSONResponse struct {
Value1 *Bar `json:"value1,omitempty" form:"value1,omitempty"`
Value2 *Bar2 `json:"value2,omitempty" form:"value2,omitempty"`
}
#/paths//foo/post/responses/200/content/application/json/schema
func (*PostFooJSONResponse) ApplyDefaults ¶
func (s *PostFooJSONResponse) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type PostFooParams ¶
type PostFooParams struct {
// bar (optional)
Bar *string `form:"bar" json:"bar"`
}
PostFooParams defines parameters for PostFoo.
type PostOrdersRequest ¶
type PostOrdersRequest struct {
Op *string `json:"op,omitempty" form:"op,omitempty"`
Path *string `json:"path,omitempty" form:"path,omitempty"`
Value *string `json:"value,omitempty" form:"value,omitempty"`
}
#/paths//orders/post/requestBody/content/application/json-patch+json/schema/items
func (*PostOrdersRequest) ApplyDefaults ¶
func (s *PostOrdersRequest) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type QueryJSONRequest ¶
type QueryJSONRequest struct {
Q *string `json:"q,omitempty" form:"q,omitempty"`
}
#/paths//query/post/requestBody/content/application/json/schema
func (*QueryJSONRequest) ApplyDefaults ¶
func (s *QueryJSONRequest) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type QueryResponse ¶
type QueryResponse struct {
Results []string `json:"results,omitempty" form:"results,omitempty"`
}
#/components/schemas/QueryResponse
func (*QueryResponse) ApplyDefaults ¶
func (s *QueryResponse) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function.
type Resource ¶
type Resource struct {
ID *string `json:"id,omitempty" form:"id,omitempty"`
Name *string `json:"name,omitempty" form:"name,omitempty"`
Status *string `json:"status,omitempty" form:"status,omitempty"`
}
#/components/schemas/Resource
func (*Resource) ApplyDefaults ¶
func (s *Resource) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type ResourceMVO ¶
type ResourceMVO struct {
Name *string `json:"name,omitempty" form:"name,omitempty"`
Status *string `json:"status,omitempty" form:"status,omitempty"`
}
#/components/schemas/Resource_MVO
func (*ResourceMVO) ApplyDefaults ¶
func (s *ResourceMVO) ApplyDefaults()
ApplyDefaults sets default values for fields that are nil.
type SimpleClient ¶
type SimpleClient struct {
*Client
}
SimpleClient wraps Client with typed responses for operations that have unambiguous response types. Methods return the success type directly, and HTTP errors are returned as *ClientHttpError[E] where E is the error type.
func NewSimpleClient ¶
func NewSimpleClient(server string, opts ...ClientOption) (*SimpleClient, error)
NewSimpleClient creates a new SimpleClient which wraps a Client.
func (*SimpleClient) CreateItem ¶
func (c *SimpleClient) CreateItem(ctx context.Context, body createItemJSONRequestBody, reqEditors ...RequestEditorFn) (CreateItemResponse, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) CreateOrder ¶
func (c *SimpleClient) CreateOrder(ctx context.Context, body createOrderJSONRequestBody, reqEditors ...RequestEditorFn) (Order, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) CreatePet ¶
func (c *SimpleClient) CreatePet(ctx context.Context, body createPetJSONRequestBody, reqEditors ...RequestEditorFn) (Pet, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) GetQux ¶
func (c *SimpleClient) GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (map[string]any, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) GetStatus ¶
func (c *SimpleClient) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (GetStatusResponse, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) GetZap ¶
func (c *SimpleClient) GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (map[string]any, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) ListEntities ¶
func (c *SimpleClient) ListEntities(ctx context.Context, reqEditors ...RequestEditorFn) (map[string]any, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) ListItems ¶
func (c *SimpleClient) ListItems(ctx context.Context, reqEditors ...RequestEditorFn) (ListItemsResponse, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) PostFoo ¶
func (c *SimpleClient) PostFoo(ctx context.Context, params *PostFooParams, body postFooJSONRequestBody, reqEditors ...RequestEditorFn) (map[string]any, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].
func (*SimpleClient) Query ¶
func (c *SimpleClient) Query(ctx context.Context, body queryJSONRequestBody, reqEditors ...RequestEditorFn) (QueryResponse, error)
On success, returns the response body. On HTTP error, returns *ClientHttpError[struct{}].