{"modulePath":"github.com/Method-Security/methodwebtest","version":"v0.0.22","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package internal\n\n## Functions\n\n```go\nfunc EncodeURL(urlFormat string, args ...interface{}) string\n```\nEncodeURL encodes the given arguments into the URL, escaping values as needed.\n\n```go\nfunc ExtractExtraProperties(bytes []byte, value interface{}, exclude ...string) (map[string]interface{}, error)\n```\nExtractExtraProperties extracts any extra properties from the given value.\n\n```go\nfunc MarshalJSONWithExtraProperties(marshaler interface{}, extraProperties map[string]interface{}) ([]byte, error)\n```\nMarshalJSONWithExtraProperties marshals the given value to JSON, including any extra properties.\n\n```go\nfunc MarshalJSONWithExtraProperty(marshaler interface{}, key string, value interface{}) ([]byte, error)\n```\nMarshalJSONWithExtraProperty marshals the given value to JSON, including the extra property.\n\n```go\nfunc MergeHeaders(left, right http.Header) http.Header\n```\nMergeHeaders merges the given headers together, where the right takes precedence over the left.\n\n```go\nfunc QueryValues(v interface{}) (url.Values, error)\n```\nQueryValues encodes url.Values from request objects.\n\nNote: This type is inspired by Google's query encoding library, but supports far less customization and is tailored to fit this SDK's use case.\n\nRef: [https://github.com/google/go-querystring](https://github.com/google/go-querystring)\n\n```go\nfunc ResolveBaseURL(values ...string) string\n```\nResolveBaseURL resolves the base URL from the given arguments, preferring the first non-empty value.\n\n```go\nfunc StringifyJSON(value interface{}) (string, error)\n```\nStringifyJSON returns a pretty JSON string representation of the given value.\n\n## Types\n\n```go\ntype CallParams struct {\n\tURL                string\n\tMethod             string\n\tMaxAttempts        uint\n\tHeaders            http.Header\n\tBodyProperties     map[string]interface{}\n\tQueryParameters    url.Values\n\tClient             core.HTTPClient\n\tRequest            interface{}\n\tResponse           interface{}\n\tResponseIsOptional bool\n\tErrorDecoder       ErrorDecoder\n}\n```\nCallParams represents the parameters used to issue an API call.\n\n```go\ntype Caller struct {\n\t// contains filtered or unexported fields\n}\n```\nCaller calls APIs and deserializes their response, if any.\n\n```go\nfunc NewCaller(params *CallerParams) *Caller\n```\nNewCaller returns a new \\*Caller backed by the given parameters.\n\n```go\nfunc (c *Caller) Call(ctx context.Context, params *CallParams) error\n```\nCall issues an API call according to the given call parameters.\n\n```go\ntype CallerParams struct {\n\tClient      core.HTTPClient\n\tMaxAttempts uint\n}\n```\nCallerParams represents the parameters used to constrcut a new \\*Caller.\n\n```go\ntype Date struct {\n\t// contains filtered or unexported fields\n}\n```\nDateTime wraps time.Time and adapts its JSON representation to conform to a RFC3339 date (e.g. 2006-01-02).\n\nRef: [https://ijmacd.github.io/rfc3339-iso8601](https://ijmacd.github.io/rfc3339-iso8601)\n\n```go\nfunc NewDate(t time.Time) *Date\n```\nNewDate returns a new \\*Date. If the given time.Time is nil, nil will be returned.\n\n```go\nfunc NewOptionalDate(t *time.Time) *Date\n```\nNewOptionalDate returns a new \\*Date. If the given time.Time is nil, nil will be returned.\n\n```go\nfunc (d *Date) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (d *Date) Time() time.Time\n```\nTime returns the Date's underlying time, if any. If the date is nil, the zero value is returned.\n\n```go\nfunc (d *Date) TimePtr() *time.Time\n```\nTimePtr returns a pointer to the Date's underlying time.Time, if any.\n\n```go\nfunc (d *Date) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype DateTime struct {\n\t// contains filtered or unexported fields\n}\n```\nDateTime wraps time.Time and adapts its JSON representation to conform to a RFC3339 date-time (e.g. 2017-07-21T17:32:28Z).\n\nRef: [https://ijmacd.github.io/rfc3339-iso8601](https://ijmacd.github.io/rfc3339-iso8601)\n\n```go\nfunc NewDateTime(t time.Time) *DateTime\n```\nNewDateTime returns a new \\*DateTime.\n\n```go\nfunc NewOptionalDateTime(t *time.Time) *DateTime\n```\nNewOptionalDateTime returns a new \\*DateTime. If the given time.Time is nil, nil will be returned.\n\n```go\nfunc (d *DateTime) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (d *DateTime) Time() time.Time\n```\nTime returns the DateTime's underlying time, if any. If the date-time is nil, the zero value is returned.\n\n```go\nfunc (d *DateTime) TimePtr() *time.Time\n```\nTimePtr returns a pointer to the DateTime's underlying time.Time, if any.\n\n```go\nfunc (d *DateTime) UnmarshalJSON(data []byte) error\n```\n\n```go\ntype ErrorCodes map[int]func(*core.APIError) error\n```\nErrorCodes maps HTTP status codes to error constructors.\n\n```go\ntype ErrorDecoder func(statusCode int, body io.Reader) error\n```\nErrorDecoder decodes \\*http.Response errors and returns a typed API error (e.g. \\*core.APIError).\n\n```go\nfunc NewErrorDecoder(errorCodes ErrorCodes) ErrorDecoder\n```\nNewErrorDecoder returns a new ErrorDecoder backed by the given error codes.\n\n```go\ntype HTTPClient interface {\n\tDo(*http.Request) (*http.Response, error)\n}\n```\nHTTPClient is an interface for a subset of the \\*http.Client.\n\n```go\ntype QueryEncoder interface {\n\tEncodeQueryValues(key string, v *url.Values) error\n}\n```\nQueryEncoder is an interface implemented by any type that wishes to encode itself into URL values in a non-standard way.\n\n```go\ntype Retrier struct {\n\t// contains filtered or unexported fields\n}\n```\nRetrier retries failed requests a configurable number of times with an exponential back-off between each retry.\n\n```go\nfunc NewRetrier(opts ...RetryOption) *Retrier\n```\nNewRetrier constructs a new \\*Retrier with the given options, if any.\n\n```go\nfunc (r *Retrier) Run(\n\tfn RetryFunc,\n\trequest *http.Request,\n\terrorDecoder ErrorDecoder,\n\topts ...RetryOption,\n) (*http.Response, error)\n```\nRun issues the request and, upon failure, retries the request if possible.\n\nThe request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit.\n\n```go\ntype RetryFunc func(*http.Request) (*http.Response, error)\n```\nRetryFunc is a retryable HTTP function call (i.e. \\*http.Client.Do).\n\n```go\ntype RetryOption func(*retryOptions)\n```\nRetryOption adapts the behavior the \\*Retrier.\n\n```go\nfunc WithMaxAttempts(attempts uint) RetryOption\n```\nWithMaxAttempts configures the maximum number of attempts of the \\*Retrier.\n\n","path":"github.com/Method-Security/methodwebtest/generated/go/internal","name":"internal","synopsis":"","isRedistributable":true}
