output

package
v0.0.0-...-bb4e2af Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = "2006-01-02"

Variables

View Source
var ErrNullableIsNull = errors.New("nullable value is null")

ErrNullableIsNull is returned when trying to get a value from a null Nullable.

View Source
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

func BindFormExplodeParam(paramName string, required bool, queryParams url.Values, dest any) error

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&param=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

func BindStringToObject(src string, dst any) error

BindStringToObject binds a string value to a destination object. It handles primitives, encoding.TextUnmarshaler, and the Binder interface.

func GetOpenAPISpecJSON

func GetOpenAPISpecJSON() ([]byte, error)

GetOpenAPISpecJSON returns the raw OpenAPI spec as JSON bytes.

func NewCreateItemRequest

func NewCreateItemRequest(server string, body createItemJSONRequestBody) (*http.Request, error)

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

func NewCreateOrderRequest(server string, body createOrderJSONRequestBody) (*http.Request, error)

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

func NewCreatePetRequest(server string, body createPetJSONRequestBody) (*http.Request, error)

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

func NewGetQuxRequest(server string) (*http.Request, error)

NewGetQuxRequest creates a GET request for /qux

func NewGetStatusRequest

func NewGetStatusRequest(server string) (*http.Request, error)

NewGetStatusRequest creates a GET request for /status

func NewGetZapRequest

func NewGetZapRequest(server string) (*http.Request, error)

NewGetZapRequest creates a GET request for /zap

func NewListEntitiesRequest

func NewListEntitiesRequest(server string) (*http.Request, error)

NewListEntitiesRequest creates a GET request for /entities

func NewListItemsRequest

func NewListItemsRequest(server string) (*http.Request, error)

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

func NewPostQuxRequest(server string, body postQuxJSONRequestBody) (*http.Request, error)

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

func NewPostZapRequest(server string, body postZapJSONRequestBody) (*http.Request, error)

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

func NewQueryRequest(server string, body queryJSONRequestBody) (*http.Request, error)

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&paramName=b&paramName=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 Binder

type Binder interface {
	Bind(value string) error
}

Binder is an interface for types that can bind themselves from a string value.

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 (c *Client) CreateItemWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

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 (c *Client) CreateOrderWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

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 (c *Client) CreatePetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetQux

func (c *Client) GetQux(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetZap

func (c *Client) GetZap(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListEntities

func (c *Client) ListEntities(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListItems

func (c *Client) ListItems(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

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 (c *Client) PatchResourceWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

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 (c *Client) PostFooWithBody(ctx context.Context, params *PostFooParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

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 (c *Client) PostQuxWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

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

func (c *Client) PostZapWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Query

func (c *Client) Query(ctx context.Context, body queryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

Query makes a POST request to /query with application/json body

func (*Client) QueryWithBody

func (c *Client) QueryWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientHttpError

type ClientHttpError[E any] struct {
	StatusCode int
	Body       E
	RawBody    []byte
}

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

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction.

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

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

type Date struct {
	time.Time
}

func (Date) Format

func (d Date) Format(layout string) string

Format returns the date formatted according to layout.

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) MarshalText

func (d Date) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler for Date.

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

func (*Date) UnmarshalText

func (d *Date) UnmarshalText(data []byte) error

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

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

HttpRequestDoer performs HTTP requests. The standard http.Client implements this interface.

type JSONPatch

type JSONPatch = []JSONPatchItem

#/components/schemas/JsonPatch

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 ListItemsResponse

type ListItemsResponse = string

#/components/schemas/ListItemsResponse

type Metadata

type Metadata = string

type Nullable

type Nullable[T any] map[bool]T

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

func NewNullNullable[T any]() Nullable[T]

NewNullNullable creates a Nullable that is explicitly null.

func NewNullableWithValue

func NewNullableWithValue[T any](value T) Nullable[T]

NewNullableWithValue creates a Nullable with the given value.

func (Nullable[T]) Get

func (n Nullable[T]) Get() (T, error)

Get returns the value if set, or an error if null or unspecified.

func (Nullable[T]) IsNull

func (n Nullable[T]) IsNull() bool

IsNull returns true if the field is explicitly null.

func (Nullable[T]) IsSpecified

func (n Nullable[T]) IsSpecified() bool

IsSpecified returns true if the field was provided (either null or a value).

func (Nullable[T]) MarshalJSON

func (n Nullable[T]) MarshalJSON() ([]byte, error)

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]) Set

func (n *Nullable[T]) Set(value T)

Set assigns a value.

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

func (n *Nullable[T]) UnmarshalJSON(data []byte) error

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

type PatchResourcesID200ResponseJSONOneOf21 = Nullable[string]

#/paths//resources/{id}/patch/responses/200/content/application/json-patch+json/schema/oneOf/2

type PatchResourcesID200ResponseJSONOneOf22

type PatchResourcesID200ResponseJSONOneOf22 = Nullable[string]

#/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

type RequestEditorFn func(ctx context.Context, req *http.Request) error

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{}].

type Widget

type Widget = string

type Zap

type Zap = string

Jump to

Keyboard shortcuts

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