trainings

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: 11 Imported by: 0

Documentation

Overview

Package trainings 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 trainings 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 NewApproveRescheduleTrainingRequest

func NewApproveRescheduleTrainingRequest(server string, trainingUUID string) (*http.Request, error)

NewApproveRescheduleTrainingRequest generates requests for ApproveRescheduleTraining

func NewCancelTrainingRequest

func NewCancelTrainingRequest(server string, trainingUUID string) (*http.Request, error)

NewCancelTrainingRequest generates requests for CancelTraining

func NewCreateTrainingRequest

func NewCreateTrainingRequest(server string, body CreateTrainingJSONRequestBody) (*http.Request, error)

NewCreateTrainingRequest calls the generic CreateTraining builder with application/json body

func NewCreateTrainingRequestWithBody

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

NewCreateTrainingRequestWithBody generates requests for CreateTraining with any type of body

func NewGetTrainingsRequest

func NewGetTrainingsRequest(server string) (*http.Request, error)

NewGetTrainingsRequest generates requests for GetTrainings

func NewRejectRescheduleTrainingRequest

func NewRejectRescheduleTrainingRequest(server string, trainingUUID string) (*http.Request, error)

NewRejectRescheduleTrainingRequest generates requests for RejectRescheduleTraining

func NewRequestRescheduleTrainingRequest

func NewRequestRescheduleTrainingRequest(server string, trainingUUID string, body RequestRescheduleTrainingJSONRequestBody) (*http.Request, error)

NewRequestRescheduleTrainingRequest calls the generic RequestRescheduleTraining builder with application/json body

func NewRequestRescheduleTrainingRequestWithBody

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

NewRequestRescheduleTrainingRequestWithBody generates requests for RequestRescheduleTraining with any type of body

func NewRescheduleTrainingRequest

func NewRescheduleTrainingRequest(server string, trainingUUID string, body RescheduleTrainingJSONRequestBody) (*http.Request, error)

NewRescheduleTrainingRequest calls the generic RescheduleTraining builder with application/json body

func NewRescheduleTrainingRequestWithBody

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

NewRescheduleTrainingRequestWithBody generates requests for RescheduleTraining with any type of body

Types

type ApproveRescheduleTrainingResponse

type ApproveRescheduleTrainingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseApproveRescheduleTrainingResponse

func ParseApproveRescheduleTrainingResponse(rsp *http.Response) (*ApproveRescheduleTrainingResponse, error)

ParseApproveRescheduleTrainingResponse parses an HTTP response from a ApproveRescheduleTrainingWithResponse call

func (ApproveRescheduleTrainingResponse) Status

Status returns HTTPResponse.Status

func (ApproveRescheduleTrainingResponse) StatusCode

func (r ApproveRescheduleTrainingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelTrainingResponse

type CancelTrainingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseCancelTrainingResponse

func ParseCancelTrainingResponse(rsp *http.Response) (*CancelTrainingResponse, error)

ParseCancelTrainingResponse parses an HTTP response from a CancelTrainingWithResponse call

func (CancelTrainingResponse) Status

func (r CancelTrainingResponse) Status() string

Status returns HTTPResponse.Status

func (CancelTrainingResponse) StatusCode

func (r CancelTrainingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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) ApproveRescheduleTraining

func (c *Client) ApproveRescheduleTraining(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CancelTraining

func (c *Client) CancelTraining(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateTraining

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

func (*Client) CreateTrainingWithBody

func (c *Client) CreateTrainingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetTrainings

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

func (*Client) RejectRescheduleTraining

func (c *Client) RejectRescheduleTraining(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RequestRescheduleTraining

func (c *Client) RequestRescheduleTraining(ctx context.Context, trainingUUID string, body RequestRescheduleTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RequestRescheduleTrainingWithBody

func (c *Client) RequestRescheduleTrainingWithBody(ctx context.Context, trainingUUID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RescheduleTraining

func (c *Client) RescheduleTraining(ctx context.Context, trainingUUID string, body RescheduleTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RescheduleTrainingWithBody

func (c *Client) RescheduleTrainingWithBody(ctx context.Context, trainingUUID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetTrainings request
	GetTrainings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	CreateTraining(ctx context.Context, body CreateTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelTraining request
	CancelTraining(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ApproveRescheduleTraining request
	ApproveRescheduleTraining(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RejectRescheduleTraining request
	RejectRescheduleTraining(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	RequestRescheduleTraining(ctx context.Context, trainingUUID string, body RequestRescheduleTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	RescheduleTraining(ctx context.Context, trainingUUID string, body RescheduleTrainingJSONRequestBody, 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) ApproveRescheduleTrainingWithResponse

func (c *ClientWithResponses) ApproveRescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*ApproveRescheduleTrainingResponse, error)

ApproveRescheduleTrainingWithResponse request returning *ApproveRescheduleTrainingResponse

func (*ClientWithResponses) CancelTrainingWithResponse

func (c *ClientWithResponses) CancelTrainingWithResponse(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*CancelTrainingResponse, error)

CancelTrainingWithResponse request returning *CancelTrainingResponse

func (*ClientWithResponses) CreateTrainingWithBodyWithResponse

func (c *ClientWithResponses) CreateTrainingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTrainingResponse, error)

CreateTrainingWithBodyWithResponse request with arbitrary body returning *CreateTrainingResponse

func (*ClientWithResponses) CreateTrainingWithResponse

func (c *ClientWithResponses) CreateTrainingWithResponse(ctx context.Context, body CreateTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTrainingResponse, error)

func (*ClientWithResponses) GetTrainingsWithResponse

func (c *ClientWithResponses) GetTrainingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTrainingsResponse, error)

GetTrainingsWithResponse request returning *GetTrainingsResponse

func (*ClientWithResponses) RejectRescheduleTrainingWithResponse

func (c *ClientWithResponses) RejectRescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*RejectRescheduleTrainingResponse, error)

RejectRescheduleTrainingWithResponse request returning *RejectRescheduleTrainingResponse

func (*ClientWithResponses) RequestRescheduleTrainingWithBodyWithResponse

func (c *ClientWithResponses) RequestRescheduleTrainingWithBodyWithResponse(ctx context.Context, trainingUUID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestRescheduleTrainingResponse, error)

RequestRescheduleTrainingWithBodyWithResponse request with arbitrary body returning *RequestRescheduleTrainingResponse

func (*ClientWithResponses) RequestRescheduleTrainingWithResponse

func (c *ClientWithResponses) RequestRescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, body RequestRescheduleTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestRescheduleTrainingResponse, error)

func (*ClientWithResponses) RescheduleTrainingWithBodyWithResponse

func (c *ClientWithResponses) RescheduleTrainingWithBodyWithResponse(ctx context.Context, trainingUUID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RescheduleTrainingResponse, error)

RescheduleTrainingWithBodyWithResponse request with arbitrary body returning *RescheduleTrainingResponse

func (*ClientWithResponses) RescheduleTrainingWithResponse

func (c *ClientWithResponses) RescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, body RescheduleTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*RescheduleTrainingResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetTrainings request
	GetTrainingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTrainingsResponse, error)

	// CreateTraining request with any body
	CreateTrainingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTrainingResponse, error)

	CreateTrainingWithResponse(ctx context.Context, body CreateTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTrainingResponse, error)

	// CancelTraining request
	CancelTrainingWithResponse(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*CancelTrainingResponse, error)

	// ApproveRescheduleTraining request
	ApproveRescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*ApproveRescheduleTrainingResponse, error)

	// RejectRescheduleTraining request
	RejectRescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, reqEditors ...RequestEditorFn) (*RejectRescheduleTrainingResponse, error)

	// RequestRescheduleTraining request with any body
	RequestRescheduleTrainingWithBodyWithResponse(ctx context.Context, trainingUUID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RequestRescheduleTrainingResponse, error)

	RequestRescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, body RequestRescheduleTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*RequestRescheduleTrainingResponse, error)

	// RescheduleTraining request with any body
	RescheduleTrainingWithBodyWithResponse(ctx context.Context, trainingUUID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RescheduleTrainingResponse, error)

	RescheduleTrainingWithResponse(ctx context.Context, trainingUUID string, body RescheduleTrainingJSONRequestBody, reqEditors ...RequestEditorFn) (*RescheduleTrainingResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateTrainingJSONBody

type CreateTrainingJSONBody PostTraining

CreateTrainingJSONBody defines parameters for CreateTraining.

type CreateTrainingJSONRequestBody

type CreateTrainingJSONRequestBody CreateTrainingJSONBody

CreateTrainingJSONRequestBody defines body for CreateTraining for application/json ContentType.

type CreateTrainingResponse

type CreateTrainingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseCreateTrainingResponse

func ParseCreateTrainingResponse(rsp *http.Response) (*CreateTrainingResponse, error)

ParseCreateTrainingResponse parses an HTTP response from a CreateTrainingWithResponse call

func (CreateTrainingResponse) Status

func (r CreateTrainingResponse) Status() string

Status returns HTTPResponse.Status

func (CreateTrainingResponse) StatusCode

func (r CreateTrainingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error

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

Error defines model for Error.

type GetTrainingsResponse

type GetTrainingsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Trainings
	JSONDefault  *Error
}

func ParseGetTrainingsResponse

func ParseGetTrainingsResponse(rsp *http.Response) (*GetTrainingsResponse, error)

ParseGetTrainingsResponse parses an HTTP response from a GetTrainingsWithResponse call

func (GetTrainingsResponse) Status

func (r GetTrainingsResponse) Status() string

Status returns HTTPResponse.Status

func (GetTrainingsResponse) StatusCode

func (r GetTrainingsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type PostTraining

type PostTraining struct {
	Notes string    `json:"notes"`
	Time  time.Time `json:"time"`
}

PostTraining defines model for PostTraining.

type RejectRescheduleTrainingResponse

type RejectRescheduleTrainingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseRejectRescheduleTrainingResponse

func ParseRejectRescheduleTrainingResponse(rsp *http.Response) (*RejectRescheduleTrainingResponse, error)

ParseRejectRescheduleTrainingResponse parses an HTTP response from a RejectRescheduleTrainingWithResponse call

func (RejectRescheduleTrainingResponse) Status

Status returns HTTPResponse.Status

func (RejectRescheduleTrainingResponse) StatusCode

func (r RejectRescheduleTrainingResponse) 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

type RequestRescheduleTrainingJSONBody

type RequestRescheduleTrainingJSONBody PostTraining

RequestRescheduleTrainingJSONBody defines parameters for RequestRescheduleTraining.

type RequestRescheduleTrainingJSONRequestBody

type RequestRescheduleTrainingJSONRequestBody RequestRescheduleTrainingJSONBody

RequestRescheduleTrainingJSONRequestBody defines body for RequestRescheduleTraining for application/json ContentType.

type RequestRescheduleTrainingResponse

type RequestRescheduleTrainingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseRequestRescheduleTrainingResponse

func ParseRequestRescheduleTrainingResponse(rsp *http.Response) (*RequestRescheduleTrainingResponse, error)

ParseRequestRescheduleTrainingResponse parses an HTTP response from a RequestRescheduleTrainingWithResponse call

func (RequestRescheduleTrainingResponse) Status

Status returns HTTPResponse.Status

func (RequestRescheduleTrainingResponse) StatusCode

func (r RequestRescheduleTrainingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RescheduleTrainingJSONBody

type RescheduleTrainingJSONBody PostTraining

RescheduleTrainingJSONBody defines parameters for RescheduleTraining.

type RescheduleTrainingJSONRequestBody

type RescheduleTrainingJSONRequestBody RescheduleTrainingJSONBody

RescheduleTrainingJSONRequestBody defines body for RescheduleTraining for application/json ContentType.

type RescheduleTrainingResponse

type RescheduleTrainingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseRescheduleTrainingResponse

func ParseRescheduleTrainingResponse(rsp *http.Response) (*RescheduleTrainingResponse, error)

ParseRescheduleTrainingResponse parses an HTTP response from a RescheduleTrainingWithResponse call

func (RescheduleTrainingResponse) Status

Status returns HTTPResponse.Status

func (RescheduleTrainingResponse) StatusCode

func (r RescheduleTrainingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Training

type Training struct {
	CanBeCancelled     bool       `json:"canBeCancelled"`
	MoveProposedBy     *string    `json:"moveProposedBy,omitempty"`
	MoveRequiresAccept bool       `json:"moveRequiresAccept"`
	Notes              string     `json:"notes"`
	ProposedTime       *time.Time `json:"proposedTime,omitempty"`
	Time               time.Time  `json:"time"`
	User               string     `json:"user"`
	UserUuid           string     `json:"userUuid"`
	Uuid               string     `json:"uuid"`
}

Training defines model for Training.

type Trainings

type Trainings struct {
	Trainings []Training `json:"trainings"`
}

Trainings defines model for Trainings.

Jump to

Keyboard shortcuts

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