trainer

package
v0.0.0-...-56ef6d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 12 Imported by: 0

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

View Source
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

func NewMakeHourUnavailableRequestWithBody

func NewMakeHourUnavailableRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewMakeHourUnavailableRequestWithBody generates requests for MakeHourUnavailable with any type of 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 (c *Client) MakeHourAvailableWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) MakeHourUnavailable

func (c *Client) MakeHourUnavailable(ctx context.Context, body MakeHourUnavailableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) MakeHourUnavailableWithBody

func (c *Client) MakeHourUnavailableWithBody(ctx context.Context, contentType string, body io.Reader, 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)

	// MakeHourUnavailable request with any body
	MakeHourUnavailableWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	MakeHourUnavailable(ctx context.Context, body MakeHourUnavailableJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

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)

	// MakeHourUnavailable request with any body
	MakeHourUnavailableWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MakeHourUnavailableResponse, error)

	MakeHourUnavailableWithResponse(ctx context.Context, body MakeHourUnavailableJSONRequestBody, 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 Error

type Error struct {
	Message string `json:"message"`
	Slug    string `json:"slug"`
}

Error defines model for Error.

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

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

type HourUpdate struct {
	Hours []time.Time `json:"hours"`
}

HourUpdate defines model for HourUpdate.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

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 {
	Body         []byte
	HTTPResponse *http.Response
	JSON204      *[]Date
	JSONDefault  *Error
}

func ParseMakeHourUnavailableResponse

func ParseMakeHourUnavailableResponse(rsp *http.Response) (*MakeHourUnavailableResponse, error)

ParseMakeHourUnavailableResponse parses an HTTP response from a MakeHourUnavailableWithResponse call

func (MakeHourUnavailableResponse) Status

Status returns HTTPResponse.Status

func (MakeHourUnavailableResponse) StatusCode

func (r MakeHourUnavailableResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL