Documentation ¶
Overview ¶
Package trainer provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.
Package trainer provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.
Index ¶
- Constants
- func NewGetTrainerAvailableHoursRequest(server string, params *GetTrainerAvailableHoursParams) (*http.Request, error)
- func NewMakeHourAvailableRequest(server string, body MakeHourAvailableJSONRequestBody) (*http.Request, error)
- func NewMakeHourAvailableRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewMakeHourUnavailableRequest(server string, body MakeHourUnavailableJSONRequestBody) (*http.Request, error)
- func NewMakeHourUnavailableRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- type Client
- func (c *Client) GetTrainerAvailableHours(ctx context.Context, params *GetTrainerAvailableHoursParams, ...) (*http.Response, error)
- func (c *Client) MakeHourAvailable(ctx context.Context, body MakeHourAvailableJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) MakeHourAvailableWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) MakeHourUnavailable(ctx context.Context, body MakeHourUnavailableJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) MakeHourUnavailableWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetTrainerAvailableHoursWithResponse(ctx context.Context, params *GetTrainerAvailableHoursParams, ...) (*GetTrainerAvailableHoursResponse, error)
- func (c *ClientWithResponses) MakeHourAvailableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*MakeHourAvailableResponse, error)
- func (c *ClientWithResponses) MakeHourAvailableWithResponse(ctx context.Context, body MakeHourAvailableJSONRequestBody, ...) (*MakeHourAvailableResponse, error)
- func (c *ClientWithResponses) MakeHourUnavailableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*MakeHourUnavailableResponse, error)
- func (c *ClientWithResponses) MakeHourUnavailableWithResponse(ctx context.Context, body MakeHourUnavailableJSONRequestBody, ...) (*MakeHourUnavailableResponse, error)
- type ClientWithResponsesInterface
- type Date
- type Error
- type GetTrainerAvailableHoursParams
- type GetTrainerAvailableHoursResponse
- type Hour
- type HourUpdate
- type HttpRequestDoer
- type MakeHourAvailableJSONBody
- type MakeHourAvailableJSONRequestBody
- type MakeHourAvailableResponse
- type MakeHourUnavailableJSONBody
- type MakeHourUnavailableJSONRequestBody
- type MakeHourUnavailableResponse
- type RequestEditorFn
Constants ¶
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewGetTrainerAvailableHoursRequest ¶
func NewGetTrainerAvailableHoursRequest(server string, params *GetTrainerAvailableHoursParams) (*http.Request, error)
NewGetTrainerAvailableHoursRequest generates requests for GetTrainerAvailableHours
func NewMakeHourAvailableRequest ¶
func NewMakeHourAvailableRequest(server string, body MakeHourAvailableJSONRequestBody) (*http.Request, error)
NewMakeHourAvailableRequest calls the generic MakeHourAvailable builder with application/json body
func NewMakeHourAvailableRequestWithBody ¶
func NewMakeHourAvailableRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewMakeHourAvailableRequestWithBody generates requests for MakeHourAvailable with any type of body
func NewMakeHourUnavailableRequest ¶
func NewMakeHourUnavailableRequest(server string, body MakeHourUnavailableJSONRequestBody) (*http.Request, error)
NewMakeHourUnavailableRequest calls the generic MakeHourUnavailable builder with application/json body
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 NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetTrainerAvailableHours ¶
func (c *Client) GetTrainerAvailableHours(ctx context.Context, params *GetTrainerAvailableHoursParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) MakeHourAvailable ¶
func (c *Client) MakeHourAvailable(ctx context.Context, body MakeHourAvailableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) MakeHourAvailableWithBody ¶
func (*Client) MakeHourUnavailable ¶
func (c *Client) MakeHourUnavailable(ctx context.Context, body MakeHourUnavailableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface { // GetTrainerAvailableHours request GetTrainerAvailableHours(ctx context.Context, params *GetTrainerAvailableHoursParams, reqEditors ...RequestEditorFn) (*http.Response, error) // MakeHourAvailable request with any body MakeHourAvailableWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) MakeHourAvailable(ctx context.Context, body MakeHourAvailableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) MakeHourUnavailableWithBody(ctx context.Context, contentType string, body io.Reader, 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) GetTrainerAvailableHoursWithResponse ¶
func (c *ClientWithResponses) GetTrainerAvailableHoursWithResponse(ctx context.Context, params *GetTrainerAvailableHoursParams, reqEditors ...RequestEditorFn) (*GetTrainerAvailableHoursResponse, error)
GetTrainerAvailableHoursWithResponse request returning *GetTrainerAvailableHoursResponse
func (*ClientWithResponses) MakeHourAvailableWithBodyWithResponse ¶
func (c *ClientWithResponses) MakeHourAvailableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MakeHourAvailableResponse, error)
MakeHourAvailableWithBodyWithResponse request with arbitrary body returning *MakeHourAvailableResponse
func (*ClientWithResponses) MakeHourAvailableWithResponse ¶
func (c *ClientWithResponses) MakeHourAvailableWithResponse(ctx context.Context, body MakeHourAvailableJSONRequestBody, reqEditors ...RequestEditorFn) (*MakeHourAvailableResponse, error)
func (*ClientWithResponses) MakeHourUnavailableWithBodyWithResponse ¶
func (c *ClientWithResponses) MakeHourUnavailableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MakeHourUnavailableResponse, error)
MakeHourUnavailableWithBodyWithResponse request with arbitrary body returning *MakeHourUnavailableResponse
func (*ClientWithResponses) MakeHourUnavailableWithResponse ¶
func (c *ClientWithResponses) MakeHourUnavailableWithResponse(ctx context.Context, body MakeHourUnavailableJSONRequestBody, reqEditors ...RequestEditorFn) (*MakeHourUnavailableResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // GetTrainerAvailableHours request GetTrainerAvailableHoursWithResponse(ctx context.Context, params *GetTrainerAvailableHoursParams, reqEditors ...RequestEditorFn) (*GetTrainerAvailableHoursResponse, error) // MakeHourAvailable request with any body MakeHourAvailableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MakeHourAvailableResponse, error) MakeHourAvailableWithResponse(ctx context.Context, body MakeHourAvailableJSONRequestBody, reqEditors ...RequestEditorFn) (*MakeHourAvailableResponse, error) MakeHourUnavailableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MakeHourUnavailableResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Date ¶
type Date struct { Date openapi_types.Date `json:"date"` HasFreeHours bool `json:"hasFreeHours"` Hours []Hour `json:"hours"` }
Date defines model for Date.
type GetTrainerAvailableHoursParams ¶
type GetTrainerAvailableHoursParams struct { DateFrom time.Time `json:"dateFrom"` DateTo time.Time `json:"dateTo"` }
GetTrainerAvailableHoursParams defines parameters for GetTrainerAvailableHours.
type GetTrainerAvailableHoursResponse ¶
type GetTrainerAvailableHoursResponse struct { Body []byte HTTPResponse *http.Response JSON200 *[]Date JSONDefault *Error }
func ParseGetTrainerAvailableHoursResponse ¶
func ParseGetTrainerAvailableHoursResponse(rsp *http.Response) (*GetTrainerAvailableHoursResponse, error)
ParseGetTrainerAvailableHoursResponse parses an HTTP response from a GetTrainerAvailableHoursWithResponse call
func (GetTrainerAvailableHoursResponse) Status ¶
func (r GetTrainerAvailableHoursResponse) Status() string
Status returns HTTPResponse.Status
func (GetTrainerAvailableHoursResponse) StatusCode ¶
func (r GetTrainerAvailableHoursResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Hour ¶
type Hour struct { Available bool `json:"available"` HasTrainingScheduled bool `json:"hasTrainingScheduled"` Hour time.Time `json:"hour"` }
Hour defines model for Hour.
type HourUpdate ¶
HourUpdate defines model for HourUpdate.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type MakeHourAvailableJSONBody ¶
type MakeHourAvailableJSONBody HourUpdate
MakeHourAvailableJSONBody defines parameters for MakeHourAvailable.
type MakeHourAvailableJSONRequestBody ¶
type MakeHourAvailableJSONRequestBody MakeHourAvailableJSONBody
MakeHourAvailableJSONRequestBody defines body for MakeHourAvailable for application/json ContentType.
type MakeHourAvailableResponse ¶
type MakeHourAvailableResponse struct { Body []byte HTTPResponse *http.Response JSON204 *[]Date JSONDefault *Error }
func ParseMakeHourAvailableResponse ¶
func ParseMakeHourAvailableResponse(rsp *http.Response) (*MakeHourAvailableResponse, error)
ParseMakeHourAvailableResponse parses an HTTP response from a MakeHourAvailableWithResponse call
func (MakeHourAvailableResponse) Status ¶
func (r MakeHourAvailableResponse) Status() string
Status returns HTTPResponse.Status
func (MakeHourAvailableResponse) StatusCode ¶
func (r MakeHourAvailableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MakeHourUnavailableJSONBody ¶
type MakeHourUnavailableJSONBody HourUpdate
MakeHourUnavailableJSONBody defines parameters for MakeHourUnavailable.
type MakeHourUnavailableJSONRequestBody ¶
type MakeHourUnavailableJSONRequestBody MakeHourUnavailableJSONBody
MakeHourUnavailableJSONRequestBody defines body for MakeHourUnavailable for application/json ContentType.
type MakeHourUnavailableResponse ¶
type MakeHourUnavailableResponse struct {}
func ParseMakeHourUnavailableResponse ¶
func ParseMakeHourUnavailableResponse(rsp *http.Response) (*MakeHourUnavailableResponse, error)
ParseMakeHourUnavailableResponse parses an HTTP response from a MakeHourUnavailableWithResponse call
func (MakeHourUnavailableResponse) Status ¶
func (r MakeHourUnavailableResponse) Status() string
Status returns HTTPResponse.Status
func (MakeHourUnavailableResponse) StatusCode ¶
func (r MakeHourUnavailableResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode