{"modulePath":"github.com/DefinitelyATestOrg/test-api-go","version":"v0.20.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package brucetestapi\n\n## Functions\n\n```go\nfunc Bool(b bool) param.Opt[bool]\n```\n\n```go\nfunc BoolPtr(v bool) *bool\n```\n\n```go\nfunc DefaultClientOptions() []option.RequestOption\n```\nDefaultClientOptions read from the environment (BRUCE\\_TEST\\_API\\_API\\_KEY, BRUCE\\_TEST\\_API\\_BASE\\_URL). This should be used to initialize new clients.\n\n```go\nfunc File(rdr io.Reader, filename string, contentType string) file\n```\n\n```go\nfunc Float(f float64) param.Opt[float64]\n```\n\n```go\nfunc FloatPtr(v float64) *float64\n```\n\n```go\nfunc Int(i int64) param.Opt[int64]\n```\n\n```go\nfunc IntPtr(v int64) *int64\n```\n\n```go\nfunc Opt[T comparable](v T) param.Opt[T]\n```\n\n```go\nfunc Ptr[T any](v T) *T\n```\n\n```go\nfunc String(s string) param.Opt[string]\n```\n\n```go\nfunc StringPtr(v string) *string\n```\n\n```go\nfunc Time(t time.Time) param.Opt[time.Time]\n```\n\n```go\nfunc TimePtr(v time.Time) *time.Time\n```\n\n## Types\n\n```go\ntype Client struct {\n\tOptions []option.RequestOption\n}\n```\nClient creates a struct with services and top level methods that help with interacting with the bruce-test-api API. You should not instantiate this client directly, and instead use the [NewClient](#NewClient) method instead.\n\n```go\nfunc NewClient(opts ...option.RequestOption) (r Client)\n```\nNewClient generates a new client with the default option read from the environment (BRUCE\\_TEST\\_API\\_API\\_KEY, BRUCE\\_TEST\\_API\\_BASE\\_URL). 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.\n\n```go\nfunc (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error\n```\nDelete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See \\[Execute] documentation on the params and response.\n\n```go\nfunc (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error\n```\nExecute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.\n\nIf a byte slice or an [io.Reader](/io#Reader) is supplied to params, it will be used as-is for the request body.\n\nThe params is by default serialized into the body using [encoding/json](/encoding/json). If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned [url.Values](/net/url#Values) will be used as query strings to the url.\n\nIf your params struct uses [param.Field](/github.com/DefinitelyATestOrg/test-api-go/packages/param#Field), you must provide either \\[MarshalJSON], \\[URLQuery], and/or \\[MarshalForm] functions. It is undefined behavior to use a struct uses [param.Field](/github.com/DefinitelyATestOrg/test-api-go/packages/param#Field) without specifying how it is serialized.\n\nAny \"…Params\" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.\n\nThe response body will be deserialized into the res variable, depending on its type:\n\n  - A pointer to a [\\*http.Response](/net/http#Response) is populated by the raw response.\n  - A pointer to a byte array will be populated with the contents of the request body.\n  - A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.\n  - A nil value will not read the response body.\n\nFor even greater flexibility, see [option.WithResponseInto](/github.com/DefinitelyATestOrg/test-api-go/option#WithResponseInto) and [option.WithResponseBodyInto](/github.com/DefinitelyATestOrg/test-api-go/option#WithResponseBodyInto).\n\n```go\nfunc (r *Client) FormTest(ctx context.Context, userID string, params FormTestParams, opts ...option.RequestOption) (err error)\n```\nMixed parameter types\n\n```go\nfunc (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error\n```\nGet makes a GET request with the given URL, params, and optionally deserializes to a response. See \\[Execute] documentation on the params and response.\n\n```go\nfunc (r *Client) JsonTest(ctx context.Context, userID string, params JsonTestParams, opts ...option.RequestOption) (err error)\n```\nMixed parameter types\n\n```go\nfunc (r *Client) ListFoos(ctx context.Context, query ListFoosParams, opts ...option.RequestOption) (res *pagination.PageNumber[ListFoosResponse], err error)\n```\nGet foos\n\n```go\nfunc (r *Client) ListFoosAutoPaging(ctx context.Context, query ListFoosParams, opts ...option.RequestOption) *pagination.PageNumberAutoPager[ListFoosResponse]\n```\nGet foos\n\n```go\nfunc (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error\n```\nPatch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See \\[Execute] documentation on the params and response.\n\n```go\nfunc (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error\n```\nPost makes a POST request with the given URL, params, and optionally deserializes to a response. See \\[Execute] documentation on the params and response.\n\n```go\nfunc (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error\n```\nPut makes a PUT request with the given URL, params, and optionally deserializes to a response. See \\[Execute] documentation on the params and response.\n\n```go\nfunc (r *Client) UpdateCount(ctx context.Context, body UpdateCountParams, opts ...option.RequestOption) (err error)\n```\n\n```go\ntype Error = apierror.Error\n```\n\n```go\ntype FormTestParams struct {\n\tVersion     int64                     `path:\"version,required\" json:\"-\"`\n\tDate        time.Time                 `query:\"date,required\" format:\"date\" json:\"-\"`\n\tDatetime    time.Time                 `query:\"datetime,required\" format:\"date-time\" json:\"-\"`\n\tTime        string                    `query:\"time,required\" format:\"time\" json:\"-\"`\n\tLimit       param.Opt[int64]          `query:\"limit,omitzero\" json:\"-\"`\n\tBlorp       param.Opt[string]         `json:\"blorp,omitzero\"`\n\tXTraceID    param.Opt[string]         `header:\"X-Trace-ID,omitzero\" json:\"-\"`\n\tFilter      FormTestParamsFilter      `query:\"filter,omitzero\" json:\"-\"`\n\tTags        []string                  `query:\"tags,omitzero\" json:\"-\"`\n\tPreferences FormTestParamsPreferences `json:\"preferences,omitzero\"`\n\tXFlags      []string                  `header:\"X-Flags,omitzero\" json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r FormTestParams) MarshalMultipart() (data []byte, contentType string, err error)\n```\n\n```go\nfunc (r FormTestParams) URLQuery() (v url.Values, err error)\n```\nURLQuery serializes [FormTestParams](#FormTestParams)'s query parameters as \\`url.Values\\`.\n\n```go\ntype FormTestParamsFilter struct {\n\tStatus param.Opt[string]        `query:\"status,omitzero\" json:\"-\"`\n\tMeta   FormTestParamsFilterMeta `query:\"meta,omitzero\" json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r FormTestParamsFilter) URLQuery() (v url.Values, err error)\n```\nURLQuery serializes [FormTestParamsFilter](#FormTestParamsFilter)'s query parameters as \\`url.Values\\`.\n\n```go\ntype FormTestParamsFilterMeta struct {\n\tLevel param.Opt[int64] `query:\"level,omitzero\" json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r FormTestParamsFilterMeta) URLQuery() (v url.Values, err error)\n```\nURLQuery serializes [FormTestParamsFilterMeta](#FormTestParamsFilterMeta)'s query parameters as \\`url.Values\\`.\n\n```go\ntype FormTestParamsPreferences struct {\n\tAlerts param.Opt[bool]   `json:\"alerts,omitzero\"`\n\tTheme  param.Opt[string] `json:\"theme,omitzero\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r FormTestParamsPreferences) MarshalJSON() (data []byte, err error)\n```\n\n```go\nfunc (r *FormTestParamsPreferences) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype JsonTestParams struct {\n\tVersion     int64                     `path:\"version,required\" json:\"-\"`\n\tDate        time.Time                 `query:\"date,required\" format:\"date\" json:\"-\"`\n\tDatetime    time.Time                 `query:\"datetime,required\" format:\"date-time\" json:\"-\"`\n\tTime        string                    `query:\"time,required\" format:\"time\" json:\"-\"`\n\tLimit       param.Opt[int64]          `query:\"limit,omitzero\" json:\"-\"`\n\tBlorp       param.Opt[string]         `json:\"blorp,omitzero\"`\n\tXTraceID    param.Opt[string]         `header:\"X-Trace-ID,omitzero\" json:\"-\"`\n\tFilter      JsonTestParamsFilter      `query:\"filter,omitzero\" json:\"-\"`\n\tTags        []string                  `query:\"tags,omitzero\" json:\"-\"`\n\tPreferences JsonTestParamsPreferences `json:\"preferences,omitzero\"`\n\tXFlags      []string                  `header:\"X-Flags,omitzero\" json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r JsonTestParams) MarshalJSON() (data []byte, err error)\n```\n\n```go\nfunc (r JsonTestParams) URLQuery() (v url.Values, err error)\n```\nURLQuery serializes [JsonTestParams](#JsonTestParams)'s query parameters as \\`url.Values\\`.\n\n```go\nfunc (r *JsonTestParams) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype JsonTestParamsFilter struct {\n\tStatus param.Opt[string]        `query:\"status,omitzero\" json:\"-\"`\n\tMeta   JsonTestParamsFilterMeta `query:\"meta,omitzero\" json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r JsonTestParamsFilter) URLQuery() (v url.Values, err error)\n```\nURLQuery serializes [JsonTestParamsFilter](#JsonTestParamsFilter)'s query parameters as \\`url.Values\\`.\n\n```go\ntype JsonTestParamsFilterMeta struct {\n\tLevel param.Opt[int64] `query:\"level,omitzero\" json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r JsonTestParamsFilterMeta) URLQuery() (v url.Values, err error)\n```\nURLQuery serializes [JsonTestParamsFilterMeta](#JsonTestParamsFilterMeta)'s query parameters as \\`url.Values\\`.\n\n```go\ntype JsonTestParamsPreferences struct {\n\tAlerts param.Opt[bool]   `json:\"alerts,omitzero\"`\n\tTheme  param.Opt[string] `json:\"theme,omitzero\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r JsonTestParamsPreferences) MarshalJSON() (data []byte, err error)\n```\n\n```go\nfunc (r *JsonTestParamsPreferences) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ListFoosParams struct {\n\t// Page number\n\tPage param.Opt[int64] `query:\"page,omitzero\" json:\"-\"`\n\t// Page size\n\tSize param.Opt[int64] `query:\"size,omitzero\" json:\"-\"`\n\tTags []string         `query:\"tags,omitzero\" json:\"-\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r ListFoosParams) URLQuery() (v url.Values, err error)\n```\nURLQuery serializes [ListFoosParams](#ListFoosParams)'s query parameters as \\`url.Values\\`.\n\n```go\ntype ListFoosResponse struct {\n\t// The baz field\n\tBaz int64 `json:\"baz,required\"`\n\t// The foo field\n\tFoo string `json:\"foo,required\"`\n\t// JSON contains metadata for fields, check presence with [respjson.Field.Valid].\n\tJSON struct {\n\t\tBaz         respjson.Field\n\t\tFoo         respjson.Field\n\t\tExtraFields map[string]respjson.Field\n\t\t// contains filtered or unexported fields\n\t} `json:\"-\"`\n}\n```\n\n```go\nfunc (r ListFoosResponse) RawJSON() string\n```\nReturns the unmodified JSON received from the API\n\n```go\nfunc (r *ListFoosResponse) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype UpdateCountParams struct {\n\tBody int64\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r UpdateCountParams) MarshalJSON() (data []byte, err error)\n```\n\n```go\nfunc (r *UpdateCountParams) UnmarshalJSON(data []byte) error\n```\n\n","path":"github.com/DefinitelyATestOrg/test-api-go","name":"brucetestapi","synopsis":"","isRedistributable":true}
