Documentation ¶
Index ¶
- func Bool(value bool) param.Field[bool]
- func F[T any](value T) param.Field[T]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type Client
- type Error
- type Pet
- type PetListParams
- type PetNewParams
- type PetService
- func (r *PetService) Get(ctx context.Context, petID string, opts ...option.RequestOption) (res *Pet, err error)
- func (r *PetService) List(ctx context.Context, query PetListParams, opts ...option.RequestOption) (res *Pets, err error)
- func (r *PetService) New(ctx context.Context, body PetNewParams, opts ...option.RequestOption) (err error)
- type Pets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type Client ¶
type Client struct { Options []option.RequestOption Pets *PetService }
Client creates a struct with services and top level methods that help with interacting with the meorphis-test-9 API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r *Client)
NewClient generates a new client with the default option read from the environment (). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
type Pet ¶
type Pet struct { ID int64 `json:"id,required"` Name string `json:"name,required"` Tag string `json:"tag"` JSON petJSON `json:"-"` }
func (*Pet) UnmarshalJSON ¶
type PetListParams ¶
type PetListParams struct { // How many items to return at one time (max 100) Limit param.Field[int64] `query:"limit"` }
func (PetListParams) URLQuery ¶
func (r PetListParams) URLQuery() (v url.Values)
URLQuery serializes PetListParams's query parameters as `url.Values`.
type PetNewParams ¶
type PetNewParams struct { ID param.Field[int64] `json:"id,required"` Name param.Field[string] `json:"name,required"` Tag param.Field[string] `json:"tag"` }
func (PetNewParams) MarshalJSON ¶
func (r PetNewParams) MarshalJSON() (data []byte, err error)
type PetService ¶
type PetService struct {
Options []option.RequestOption
}
PetService contains methods and other services that help with interacting with the meorphis-test-9 API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPetService method instead.
func NewPetService ¶
func NewPetService(opts ...option.RequestOption) (r *PetService)
NewPetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PetService) Get ¶
func (r *PetService) Get(ctx context.Context, petID string, opts ...option.RequestOption) (res *Pet, err error)
Info for a specific pet
func (*PetService) List ¶
func (r *PetService) List(ctx context.Context, query PetListParams, opts ...option.RequestOption) (res *Pets, err error)
List all pets
func (*PetService) New ¶
func (r *PetService) New(ctx context.Context, body PetNewParams, opts ...option.RequestOption) (err error)
Create a pet