Documentation
¶
Overview ¶
Package client provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.
Index ¶
- Constants
- func NewGetLightByIdRequest(server string, id Id) (*http.Request, error)
- func NewGetLightsRequest(server string) (*http.Request, error)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type Error
- type ErrorsResponse
- type GetLightByIdResponse
- type GetLightsResponse
- type HttpRequestDoer
- type Id
- type Light
- type LightMetadata
- type LightsResponse
- type RequestEditorFn
Constants ¶
const ApplicationKeyHeader = "hue-application-key"
ApplicationKeyHeader is used to authenticate requests from the client to Philips Hue Bridge
const (
ApplicationKeyScopes = "ApplicationKey.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewGetLightByIdRequest ¶
NewGetLightByIdRequest generates requests for GetLightById
Types ¶
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 NewAuthenticatedClient ¶
Creates an authenticacted client with all required options
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetLightById ¶
type ClientInterface ¶
type ClientInterface interface {
// GetLights request
GetLights(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetLightById request
GetLightById(ctx context.Context, id Id, 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 NewAuthenticatedClientWithResponses ¶
func NewAuthenticatedClientWithResponses(server string, applicationKey string) (*ClientWithResponses, error)
Creates an authenticacted client with responses and with all required options
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetLightByIdWithResponse ¶
func (c *ClientWithResponses) GetLightByIdWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetLightByIdResponse, error)
GetLightByIdWithResponse request returning *GetLightByIdResponse
func (*ClientWithResponses) GetLightsWithResponse ¶
func (c *ClientWithResponses) GetLightsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLightsResponse, error)
GetLightsWithResponse request returning *GetLightsResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetLightsWithResponse request
GetLightsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLightsResponse, error)
// GetLightByIdWithResponse request
GetLightByIdWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetLightByIdResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Error ¶
type Error struct {
// Description The description of the error
Description string `json:"description"`
}
Error Error object
type ErrorsResponse ¶
type ErrorsResponse struct {
// Errors The error objects
Errors []Error `json:"errors"`
}
ErrorsResponse Error response
type GetLightByIdResponse ¶
type GetLightByIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *LightsResponse
JSONDefault *ErrorsResponse
}
func ParseGetLightByIdResponse ¶
func ParseGetLightByIdResponse(rsp *http.Response) (*GetLightByIdResponse, error)
ParseGetLightByIdResponse parses an HTTP response from a GetLightByIdWithResponse call
func (GetLightByIdResponse) Status ¶
func (r GetLightByIdResponse) Status() string
Status returns HTTPResponse.Status
func (GetLightByIdResponse) StatusCode ¶
func (r GetLightByIdResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetLightsResponse ¶
type GetLightsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *LightsResponse
JSONDefault *ErrorsResponse
}
func ParseGetLightsResponse ¶
func ParseGetLightsResponse(rsp *http.Response) (*GetLightsResponse, error)
ParseGetLightsResponse parses an HTTP response from a GetLightsWithResponse call
func (GetLightsResponse) Status ¶
func (r GetLightsResponse) Status() string
Status returns HTTPResponse.Status
func (GetLightsResponse) StatusCode ¶
func (r GetLightsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Light ¶
type Light struct {
// Id The id of the resource
Id Id `json:"id"`
// Metadata The metadadta for the light resource
Metadata LightMetadata `json:"metadata"`
}
Light Light object
type LightMetadata ¶
type LightMetadata struct {
// Name The name of the light resource
Name string `json:"name"`
}
LightMetadata The metadadta for the light resource
type LightsResponse ¶
type LightsResponse struct {
// Data Content of the response
Data []Light `json:"data"`
}
LightsResponse Light response