package
0.0.6
Repository: https://github.com/dnesting/sense.git
Documentation: pkg.go.dev

# Functions

AsErr is a helper that returns nil only if parent is nil and withErrorReason does not have a value in its ErrorReason field.
For reference, a typical Response struct in the generated API client for a call that specifies 200 and 401 are valid responses normally looks like this: type AuthenticateResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Hello JSON401 *struct { ErrorReason *string `json:"error_reason,omitempty"` MfaToken *string `json:"mfa_token,omitempty"` Status *string `json:"status,omitempty"` } JSONDefault *Error }.
NewAuthenticateRequestWithBody generates requests for Authenticate with any type of body.
NewAuthenticateRequestWithFormdataBody calls the generic Authenticate builder with application/x-www-form-urlencoded body.
Creates a new Client, with reasonable defaults.
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling.
NewGetDevicesRequest generates requests for GetDevices.
NewGetEnvironmentsRequest generates requests for GetEnvironments.
NewRenewAuthTokenRequestWithBody generates requests for RenewAuthToken with any type of body.
NewRenewAuthTokenRequestWithFormdataBody calls the generic RenewAuthToken builder with application/x-www-form-urlencoded body.
ParseAuthenticateResponse parses an HTTP response from a AuthenticateWithResponse call.
ParseGetDevicesResponse parses an HTTP response from a GetDevicesWithResponse call.
ParseGetEnvironmentsResponse parses an HTTP response from a GetEnvironmentsWithResponse call.
ParseRenewAuthTokenResponse parses an HTTP response from a RenewAuthTokenWithResponse call.
WithBaseURL overrides the baseURL.
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client.
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request.

# Variables

AuthPayloadKey is something we use to smuggle the auth response payload out via the auth token.
ErrAuthenticationNeeded is wrapped by any errors resulting from a 401 response.

# Structs

AuthenticateFormdataBody defines parameters for Authenticate.
No description provided by the author
Client which conforms to the OpenAPI3 specification for this service.
ClientWithResponses builds on ClientInterface to offer response payloads.
Device defines model for device.
Error defines model for error.
GetDevicesParams defines parameters for GetDevices.
No description provided by the author
No description provided by the author
Hello defines model for hello.
Monitor defines model for monitor.
MonitorAttributes defines model for monitor_attributes.
NotificationSettings defines model for notification_settings.
RenewAuthTokenFormdataBody defines parameters for RenewAuthToken.
No description provided by the author
UserSettings defines model for user_settings.

# Interfaces

The interface specification for the client above.
ClientWithResponsesInterface is the interface specification for the client with responses above.
Doer performs HTTP requests.

# Type aliases

AuthenticateFormdataRequestBody defines body for Authenticate for application/x-www-form-urlencoded ContentType.
ClientOption allows setting custom parameters during construction.
DeviceTags defines model for device_tags.
RenewAuthTokenFormdataRequestBody defines body for RenewAuthToken for application/x-www-form-urlencoded ContentType.
RequestEditorFn is the function signature for the RequestEditor callback function.