Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- Constants
- func NewDeleteSwitchIdRequest(server string, id int) (*http.Request, error)
- func NewGetAuthConfigRequest(server string) (*http.Request, error)
- func NewGetHealthRequest(server string) (*http.Request, error)
- func NewGetSwitchIdRequest(server string, id int) (*http.Request, error)
- func NewGetSwitchRequest(server string, params *GetSwitchParams) (*http.Request, error)
- func NewGetVapidRequest(server string) (*http.Request, error)
- func NewPostSwitchIdDisableRequest(server string, id int) (*http.Request, error)
- func NewPostSwitchIdResetRequest(server string, id int) (*http.Request, error)
- func NewPostSwitchRequest(server string, body PostSwitchJSONRequestBody) (*http.Request, error)
- func NewPostSwitchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPutSwitchIdRequest(server string, id int, body PutSwitchIdJSONRequestBody) (*http.Request, error)
- func NewPutSwitchIdRequestWithBody(server string, id int, contentType string, body io.Reader) (*http.Request, error)
- type AuthConfig
- type Client
- func (c *Client) DeleteSwitchId(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetAuthConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetSwitch(ctx context.Context, params *GetSwitchParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetSwitchId(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetVapid(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostSwitch(ctx context.Context, body PostSwitchJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostSwitchIdDisable(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostSwitchIdReset(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostSwitchWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PutSwitchId(ctx context.Context, id int, body PutSwitchIdJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PutSwitchIdWithBody(ctx context.Context, id int, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) DeleteSwitchIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*DeleteSwitchIdResponse, error)
- func (c *ClientWithResponses) GetAuthConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuthConfigResponse, error)
- func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
- func (c *ClientWithResponses) GetSwitchIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetSwitchIdResponse, error)
- func (c *ClientWithResponses) GetSwitchWithResponse(ctx context.Context, params *GetSwitchParams, reqEditors ...RequestEditorFn) (*GetSwitchResponse, error)
- func (c *ClientWithResponses) GetVapidWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVapidResponse, error)
- func (c *ClientWithResponses) PostSwitchIdDisableWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*PostSwitchIdDisableResponse, error)
- func (c *ClientWithResponses) PostSwitchIdResetWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*PostSwitchIdResetResponse, error)
- func (c *ClientWithResponses) PostSwitchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostSwitchResponse, error)
- func (c *ClientWithResponses) PostSwitchWithResponse(ctx context.Context, body PostSwitchJSONRequestBody, ...) (*PostSwitchResponse, error)
- func (c *ClientWithResponses) PutSwitchIdWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, ...) (*PutSwitchIdResponse, error)
- func (c *ClientWithResponses) PutSwitchIdWithResponse(ctx context.Context, id int, body PutSwitchIdJSONRequestBody, ...) (*PutSwitchIdResponse, error)
- type ClientWithResponsesInterface
- type DeleteSwitchIdResponse
- type Error
- type GetAuthConfigResponse
- type GetHealthResponse
- type GetSwitchIdResponse
- type GetSwitchParams
- type GetSwitchResponse
- type GetVapidResponse
- type Health
- type HealthStatus
- type HttpRequestDoer
- type PostSwitchIdDisableResponse
- type PostSwitchIdResetResponse
- type PostSwitchJSONRequestBody
- type PostSwitchResponse
- type PushSubscription
- type PutSwitchIdJSONRequestBody
- type PutSwitchIdResponse
- type RequestEditorFn
- type Switch
- type SwitchStatus
Constants ¶
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewDeleteSwitchIdRequest ¶
NewDeleteSwitchIdRequest generates requests for DeleteSwitchId
func NewGetAuthConfigRequest ¶
NewGetAuthConfigRequest generates requests for GetAuthConfig
func NewGetHealthRequest ¶
NewGetHealthRequest generates requests for GetHealth
func NewGetSwitchIdRequest ¶
NewGetSwitchIdRequest generates requests for GetSwitchId
func NewGetSwitchRequest ¶
func NewGetSwitchRequest(server string, params *GetSwitchParams) (*http.Request, error)
NewGetSwitchRequest generates requests for GetSwitch
func NewGetVapidRequest ¶
NewGetVapidRequest generates requests for GetVapid
func NewPostSwitchIdDisableRequest ¶
NewPostSwitchIdDisableRequest generates requests for PostSwitchIdDisable
func NewPostSwitchIdResetRequest ¶
NewPostSwitchIdResetRequest generates requests for PostSwitchIdReset
func NewPostSwitchRequest ¶
func NewPostSwitchRequest(server string, body PostSwitchJSONRequestBody) (*http.Request, error)
NewPostSwitchRequest calls the generic PostSwitch builder with application/json body
func NewPostSwitchRequestWithBody ¶
func NewPostSwitchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostSwitchRequestWithBody generates requests for PostSwitch with any type of body
func NewPutSwitchIdRequest ¶
func NewPutSwitchIdRequest(server string, id int, body PutSwitchIdJSONRequestBody) (*http.Request, error)
NewPutSwitchIdRequest calls the generic PutSwitchId builder with application/json body
Types ¶
type AuthConfig ¶
type AuthConfig struct {
// Audience OIDC client ID / audience
Audience *string `json:"audience,omitempty"`
// Enabled Whether authentication is enabled
Enabled bool `json:"enabled"`
// IssuerUrl OIDC issuer URL
IssuerUrl *string `json:"issuerUrl,omitempty"`
}
AuthConfig Authentication configuration returned to the UI for OIDC discovery
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 swagger 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)
Creates a new Client, with reasonable defaults
func (*Client) DeleteSwitchId ¶
func (*Client) GetAuthConfig ¶
func (*Client) GetSwitch ¶
func (c *Client) GetSwitch(ctx context.Context, params *GetSwitchParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetSwitchId ¶
func (*Client) PostSwitch ¶
func (c *Client) PostSwitch(ctx context.Context, body PostSwitchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostSwitchIdDisable ¶
func (*Client) PostSwitchIdReset ¶
func (*Client) PostSwitchWithBody ¶
func (*Client) PutSwitchId ¶
func (c *Client) PutSwitchId(ctx context.Context, id int, body PutSwitchIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// GetAuthConfig request
GetAuthConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetHealth request
GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetSwitch request
GetSwitch(ctx context.Context, params *GetSwitchParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostSwitchWithBody request with any body
PostSwitchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostSwitch(ctx context.Context, body PostSwitchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteSwitchId request
DeleteSwitchId(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetSwitchId request
GetSwitchId(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutSwitchIdWithBody request with any body
PutSwitchIdWithBody(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PutSwitchId(ctx context.Context, id int, body PutSwitchIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostSwitchIdDisable request
PostSwitchIdDisable(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostSwitchIdReset request
PostSwitchIdReset(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetVapid request
GetVapid(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
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 ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) DeleteSwitchIdWithResponse ¶
func (c *ClientWithResponses) DeleteSwitchIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*DeleteSwitchIdResponse, error)
DeleteSwitchIdWithResponse request returning *DeleteSwitchIdResponse
func (*ClientWithResponses) GetAuthConfigWithResponse ¶
func (c *ClientWithResponses) GetAuthConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuthConfigResponse, error)
GetAuthConfigWithResponse request returning *GetAuthConfigResponse
func (*ClientWithResponses) GetHealthWithResponse ¶
func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
GetHealthWithResponse request returning *GetHealthResponse
func (*ClientWithResponses) GetSwitchIdWithResponse ¶
func (c *ClientWithResponses) GetSwitchIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetSwitchIdResponse, error)
GetSwitchIdWithResponse request returning *GetSwitchIdResponse
func (*ClientWithResponses) GetSwitchWithResponse ¶
func (c *ClientWithResponses) GetSwitchWithResponse(ctx context.Context, params *GetSwitchParams, reqEditors ...RequestEditorFn) (*GetSwitchResponse, error)
GetSwitchWithResponse request returning *GetSwitchResponse
func (*ClientWithResponses) GetVapidWithResponse ¶
func (c *ClientWithResponses) GetVapidWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVapidResponse, error)
GetVapidWithResponse request returning *GetVapidResponse
func (*ClientWithResponses) PostSwitchIdDisableWithResponse ¶
func (c *ClientWithResponses) PostSwitchIdDisableWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*PostSwitchIdDisableResponse, error)
PostSwitchIdDisableWithResponse request returning *PostSwitchIdDisableResponse
func (*ClientWithResponses) PostSwitchIdResetWithResponse ¶
func (c *ClientWithResponses) PostSwitchIdResetWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*PostSwitchIdResetResponse, error)
PostSwitchIdResetWithResponse request returning *PostSwitchIdResetResponse
func (*ClientWithResponses) PostSwitchWithBodyWithResponse ¶
func (c *ClientWithResponses) PostSwitchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSwitchResponse, error)
PostSwitchWithBodyWithResponse request with arbitrary body returning *PostSwitchResponse
func (*ClientWithResponses) PostSwitchWithResponse ¶
func (c *ClientWithResponses) PostSwitchWithResponse(ctx context.Context, body PostSwitchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSwitchResponse, error)
func (*ClientWithResponses) PutSwitchIdWithBodyWithResponse ¶
func (c *ClientWithResponses) PutSwitchIdWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSwitchIdResponse, error)
PutSwitchIdWithBodyWithResponse request with arbitrary body returning *PutSwitchIdResponse
func (*ClientWithResponses) PutSwitchIdWithResponse ¶
func (c *ClientWithResponses) PutSwitchIdWithResponse(ctx context.Context, id int, body PutSwitchIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSwitchIdResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetAuthConfigWithResponse request
GetAuthConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuthConfigResponse, error)
// GetHealthWithResponse request
GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
// GetSwitchWithResponse request
GetSwitchWithResponse(ctx context.Context, params *GetSwitchParams, reqEditors ...RequestEditorFn) (*GetSwitchResponse, error)
// PostSwitchWithBodyWithResponse request with any body
PostSwitchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSwitchResponse, error)
PostSwitchWithResponse(ctx context.Context, body PostSwitchJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSwitchResponse, error)
// DeleteSwitchIdWithResponse request
DeleteSwitchIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*DeleteSwitchIdResponse, error)
// GetSwitchIdWithResponse request
GetSwitchIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetSwitchIdResponse, error)
// PutSwitchIdWithBodyWithResponse request with any body
PutSwitchIdWithBodyWithResponse(ctx context.Context, id int, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSwitchIdResponse, error)
PutSwitchIdWithResponse(ctx context.Context, id int, body PutSwitchIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSwitchIdResponse, error)
// PostSwitchIdDisableWithResponse request
PostSwitchIdDisableWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*PostSwitchIdDisableResponse, error)
// PostSwitchIdResetWithResponse request
PostSwitchIdResetWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*PostSwitchIdResetResponse, error)
// GetVapidWithResponse request
GetVapidWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVapidResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type DeleteSwitchIdResponse ¶
type DeleteSwitchIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON401 *Error
JSON404 *Error
JSON500 *Error
}
func ParseDeleteSwitchIdResponse ¶
func ParseDeleteSwitchIdResponse(rsp *http.Response) (*DeleteSwitchIdResponse, error)
ParseDeleteSwitchIdResponse parses an HTTP response from a DeleteSwitchIdWithResponse call
func (DeleteSwitchIdResponse) Status ¶
func (r DeleteSwitchIdResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteSwitchIdResponse) StatusCode ¶
func (r DeleteSwitchIdResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetAuthConfigResponse ¶
type GetAuthConfigResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *AuthConfig
}
func ParseGetAuthConfigResponse ¶
func ParseGetAuthConfigResponse(rsp *http.Response) (*GetAuthConfigResponse, error)
ParseGetAuthConfigResponse parses an HTTP response from a GetAuthConfigWithResponse call
func (GetAuthConfigResponse) Status ¶
func (r GetAuthConfigResponse) Status() string
Status returns HTTPResponse.Status
func (GetAuthConfigResponse) StatusCode ¶
func (r GetAuthConfigResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetHealthResponse ¶
type GetHealthResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Health
JSON503 *Health
}
func ParseGetHealthResponse ¶
func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error)
ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call
func (GetHealthResponse) Status ¶
func (r GetHealthResponse) Status() string
Status returns HTTPResponse.Status
func (GetHealthResponse) StatusCode ¶
func (r GetHealthResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetSwitchIdResponse ¶
type GetSwitchIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Switch
JSON401 *Error
JSON404 *Error
JSON500 *Error
}
func ParseGetSwitchIdResponse ¶
func ParseGetSwitchIdResponse(rsp *http.Response) (*GetSwitchIdResponse, error)
ParseGetSwitchIdResponse parses an HTTP response from a GetSwitchIdWithResponse call
func (GetSwitchIdResponse) Status ¶
func (r GetSwitchIdResponse) Status() string
Status returns HTTPResponse.Status
func (GetSwitchIdResponse) StatusCode ¶
func (r GetSwitchIdResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetSwitchParams ¶
type GetSwitchParams struct {
// Limit Limit the number of switches returned (default is 100)
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
GetSwitchParams defines parameters for GetSwitch.
type GetSwitchResponse ¶
type GetSwitchResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Switch
JSON401 *Error
JSON500 *Error
}
func ParseGetSwitchResponse ¶
func ParseGetSwitchResponse(rsp *http.Response) (*GetSwitchResponse, error)
ParseGetSwitchResponse parses an HTTP response from a GetSwitchWithResponse call
func (GetSwitchResponse) Status ¶
func (r GetSwitchResponse) Status() string
Status returns HTTPResponse.Status
func (GetSwitchResponse) StatusCode ¶
func (r GetSwitchResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetVapidResponse ¶
func ParseGetVapidResponse ¶
func ParseGetVapidResponse(rsp *http.Response) (*GetVapidResponse, error)
ParseGetVapidResponse parses an HTTP response from a GetVapidWithResponse call
func (GetVapidResponse) Status ¶
func (r GetVapidResponse) Status() string
Status returns HTTPResponse.Status
func (GetVapidResponse) StatusCode ¶
func (r GetVapidResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Health ¶
type Health struct {
Status HealthStatus `json:"status"`
}
Health Status of health check which checks for database r/w access
type HealthStatus ¶
type HealthStatus string
HealthStatus defines model for Health.Status.
const ( HealthStatusFailed HealthStatus = "failed" HealthStatusOk HealthStatus = "ok" )
Defines values for HealthStatus.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type PostSwitchIdDisableResponse ¶
type PostSwitchIdDisableResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Switch
JSON401 *Error
JSON404 *Error
JSON500 *Error
}
func ParsePostSwitchIdDisableResponse ¶
func ParsePostSwitchIdDisableResponse(rsp *http.Response) (*PostSwitchIdDisableResponse, error)
ParsePostSwitchIdDisableResponse parses an HTTP response from a PostSwitchIdDisableWithResponse call
func (PostSwitchIdDisableResponse) Status ¶
func (r PostSwitchIdDisableResponse) Status() string
Status returns HTTPResponse.Status
func (PostSwitchIdDisableResponse) StatusCode ¶
func (r PostSwitchIdDisableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostSwitchIdResetResponse ¶
type PostSwitchIdResetResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Switch
JSON401 *Error
JSON404 *Error
JSON500 *Error
}
func ParsePostSwitchIdResetResponse ¶
func ParsePostSwitchIdResetResponse(rsp *http.Response) (*PostSwitchIdResetResponse, error)
ParsePostSwitchIdResetResponse parses an HTTP response from a PostSwitchIdResetWithResponse call
func (PostSwitchIdResetResponse) Status ¶
func (r PostSwitchIdResetResponse) Status() string
Status returns HTTPResponse.Status
func (PostSwitchIdResetResponse) StatusCode ¶
func (r PostSwitchIdResetResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostSwitchJSONRequestBody ¶
type PostSwitchJSONRequestBody = Switch
PostSwitchJSONRequestBody defines body for PostSwitch for application/json ContentType.
type PostSwitchResponse ¶
type PostSwitchResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Switch
JSON400 *Error
JSON401 *Error
JSON500 *Error
}
func ParsePostSwitchResponse ¶
func ParsePostSwitchResponse(rsp *http.Response) (*PostSwitchResponse, error)
ParsePostSwitchResponse parses an HTTP response from a PostSwitchWithResponse call
func (PostSwitchResponse) Status ¶
func (r PostSwitchResponse) Status() string
Status returns HTTPResponse.Status
func (PostSwitchResponse) StatusCode ¶
func (r PostSwitchResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PushSubscription ¶
type PushSubscription struct {
Endpoint *string `json:"endpoint,omitempty"`
Keys *struct {
Auth *string `json:"auth,omitempty"`
P256dh *string `json:"p256dh,omitempty"`
} `json:"keys,omitempty"`
}
PushSubscription Details to send push notifications. Secret fields that aren't available to be read via the API
type PutSwitchIdJSONRequestBody ¶
type PutSwitchIdJSONRequestBody = Switch
PutSwitchIdJSONRequestBody defines body for PutSwitchId for application/json ContentType.
type PutSwitchIdResponse ¶
type PutSwitchIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Switch
JSON400 *Error
JSON401 *Error
JSON404 *Error
JSON500 *Error
}
func ParsePutSwitchIdResponse ¶
func ParsePutSwitchIdResponse(rsp *http.Response) (*PutSwitchIdResponse, error)
ParsePutSwitchIdResponse parses an HTTP response from a PutSwitchIdWithResponse call
func (PutSwitchIdResponse) Status ¶
func (r PutSwitchIdResponse) Status() string
Status returns HTTPResponse.Status
func (PutSwitchIdResponse) StatusCode ¶
func (r PutSwitchIdResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type Switch ¶
type Switch struct {
// CheckInInterval Timer countdown until a switch is triggered
CheckInInterval string `json:"checkInInterval" validate:"required"`
// DeleteAfterTriggered Whether to delete the switch after triggering
DeleteAfterTriggered *bool `json:"deleteAfterTriggered,omitempty"`
// Encrypted Where or not to encrypt switch data. Data will no longer be readable via the API
Encrypted *bool `json:"encrypted,omitempty"`
// FailureReason Reason for failure when status is failed
FailureReason *string `json:"failureReason,omitempty"`
// Id Autogenerated switch ID when switch is created
Id *int `json:"id,omitempty"`
Message string `json:"message" validate:"required,min=1"`
// Notifiers List of notification channels powered by shoutrrr
Notifiers []string `json:"notifiers" validate:"required,min=1"`
// PushSubscription Optional PWA push subscription for background alerts
PushSubscription *PushSubscription `json:"pushSubscription,omitempty"`
// ReminderEnabled If push notifications have been configured
ReminderEnabled *bool `json:"reminderEnabled,omitempty"`
// ReminderSent If push notifications have been triggered
ReminderSent *bool `json:"reminderSent,omitempty"`
// ReminderThreshold How long before expiration to send a push notification
ReminderThreshold *string `json:"reminderThreshold,omitempty"`
// Status Current switch status
Status *SwitchStatus `json:"status,omitempty"`
// TriggerAt Time to trigger in Unix time format to trigger switch
TriggerAt *int64 `json:"triggerAt,omitempty"`
// UserId User ID of the switch owner
UserId *string `json:"userId,omitempty"`
}
Switch defines model for Switch.
type SwitchStatus ¶
type SwitchStatus string
SwitchStatus Current switch status
const ( SwitchStatusActive SwitchStatus = "active" SwitchStatusDisabled SwitchStatus = "disabled" SwitchStatusFailed SwitchStatus = "failed" SwitchStatusTriggered SwitchStatus = "triggered" )
Defines values for SwitchStatus.