Documentation
¶
Overview ¶
Package productwebclient provides primitives to interact the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Package productwebclient provides primitives to interact the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Index ¶
- func NewCreateProductRequest(server string, body CreateProductJSONRequestBody) (*http.Request, error)
- func NewCreateProductRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewGetAllProductsRequest(server string) (*http.Request, error)
- func NewGetProductByIdRequest(server string, productId ProductIdParameter) (*http.Request, error)
- type Client
- func (c *Client) CreateProduct(ctx context.Context, body CreateProductJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateProductWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GetAllProducts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetProductById(ctx context.Context, productId ProductIdParameter, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateProductWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateProductResponse, error)
- func (c *ClientWithResponses) CreateProductWithResponse(ctx context.Context, body CreateProductJSONRequestBody) (*CreateProductResponse, error)
- func (c *ClientWithResponses) GetAllProductsWithResponse(ctx context.Context) (*GetAllProductsResponse, error)
- func (c *ClientWithResponses) GetProductByIdWithResponse(ctx context.Context, productId ProductIdParameter) (*GetProductByIdResponse, error)
- type ClientWithResponsesInterface
- type CreateProductJSONBody
- type CreateProductJSONRequestBody
- type CreateProductResponse
- type GetAllProductsResponse
- type GetAllProductsSuccessResponse
- type GetProductByIdResponse
- type GetProductByIdSuccessResponse
- type HttpRequestDoer
- type Product
- type ProductCreated
- type ProductCreationSuccessResponse
- type ProductIdParameter
- type RequestEditorFn
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreateProductRequest ¶
func NewCreateProductRequest(server string, body CreateProductJSONRequestBody) (*http.Request, error)
NewCreateProductRequest calls the generic CreateProduct builder with application/json body
func NewCreateProductRequestWithBody ¶
func NewCreateProductRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateProductRequestWithBody generates requests for CreateProduct with any type of body
func NewGetAllProductsRequest ¶ added in v1.6.0
NewGetAllProductsRequest generates requests for GetAllProducts
func NewGetProductByIdRequest ¶
func NewGetProductByIdRequest(server string, productId ProductIdParameter) (*http.Request, error)
NewGetProductByIdRequest generates requests for GetProductById
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) CreateProduct ¶
func (c *Client) CreateProduct(ctx context.Context, body CreateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateProductWithBody ¶
func (*Client) GetAllProducts ¶ added in v1.6.0
func (*Client) GetProductById ¶
func (c *Client) GetProductById(ctx context.Context, productId ProductIdParameter, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface { // GetAllProducts request GetAllProducts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateProduct request with any body CreateProductWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) CreateProduct(ctx context.Context, body CreateProductJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetProductById request GetProductById(ctx context.Context, productId ProductIdParameter, 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) CreateProductWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateProductWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateProductResponse, error)
CreateProductWithBodyWithResponse request with arbitrary body returning *CreateProductResponse
func (*ClientWithResponses) CreateProductWithResponse ¶
func (c *ClientWithResponses) CreateProductWithResponse(ctx context.Context, body CreateProductJSONRequestBody) (*CreateProductResponse, error)
func (*ClientWithResponses) GetAllProductsWithResponse ¶ added in v1.6.0
func (c *ClientWithResponses) GetAllProductsWithResponse(ctx context.Context) (*GetAllProductsResponse, error)
GetAllProductsWithResponse request returning *GetAllProductsResponse
func (*ClientWithResponses) GetProductByIdWithResponse ¶
func (c *ClientWithResponses) GetProductByIdWithResponse(ctx context.Context, productId ProductIdParameter) (*GetProductByIdResponse, error)
GetProductByIdWithResponse request returning *GetProductByIdResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // GetAllProducts request GetAllProductsWithResponse(ctx context.Context) (*GetAllProductsResponse, error) // CreateProduct request with any body CreateProductWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateProductResponse, error) CreateProductWithResponse(ctx context.Context, body CreateProductJSONRequestBody) (*CreateProductResponse, error) // GetProductById request GetProductByIdWithResponse(ctx context.Context, productId ProductIdParameter) (*GetProductByIdResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateProductJSONBody ¶
type CreateProductJSONBody Product
CreateProductJSONBody defines parameters for CreateProduct.
type CreateProductJSONRequestBody ¶
type CreateProductJSONRequestBody CreateProductJSONBody
CreateProductJSONRequestBody defines body for CreateProduct for application/json ContentType.
type CreateProductResponse ¶
type CreateProductResponse struct { Body []byte HTTPResponse *http.Response JSON201 *ProductCreated }
func ParseCreateProductResponse ¶
func ParseCreateProductResponse(rsp *http.Response) (*CreateProductResponse, error)
ParseCreateProductResponse parses an HTTP response from a CreateProductWithResponse call
func (CreateProductResponse) Status ¶
func (r CreateProductResponse) Status() string
Status returns HTTPResponse.Status
func (CreateProductResponse) StatusCode ¶
func (r CreateProductResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetAllProductsResponse ¶ added in v1.6.0
func ParseGetAllProductsResponse ¶ added in v1.6.0
func ParseGetAllProductsResponse(rsp *http.Response) (*GetAllProductsResponse, error)
ParseGetAllProductsResponse parses an HTTP response from a GetAllProductsWithResponse call
func (GetAllProductsResponse) Status ¶ added in v1.6.0
func (r GetAllProductsResponse) Status() string
Status returns HTTPResponse.Status
func (GetAllProductsResponse) StatusCode ¶ added in v1.6.0
func (r GetAllProductsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetAllProductsSuccessResponse ¶ added in v1.6.0
type GetAllProductsSuccessResponse []Product
GetAllProductsSuccessResponse defines model for GetAllProductsSuccessResponse.
type GetProductByIdResponse ¶
func ParseGetProductByIdResponse ¶
func ParseGetProductByIdResponse(rsp *http.Response) (*GetProductByIdResponse, error)
ParseGetProductByIdResponse parses an HTTP response from a GetProductByIdWithResponse call
func (GetProductByIdResponse) Status ¶
func (r GetProductByIdResponse) Status() string
Status returns HTTPResponse.Status
func (GetProductByIdResponse) StatusCode ¶
func (r GetProductByIdResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetProductByIdSuccessResponse ¶
type GetProductByIdSuccessResponse Product
GetProductByIdSuccessResponse defines model for GetProductByIdSuccessResponse.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Product ¶
type Product struct { CategoryRef *string `json:"categoryRef,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Variants *[]Variant `json:"variants,omitempty"` }
Product defines model for Product.
type ProductCreated ¶
type ProductCreated struct {
Id *string `json:"id,omitempty"`
}
ProductCreated defines model for ProductCreated.
type ProductCreationSuccessResponse ¶
type ProductCreationSuccessResponse ProductCreated
ProductCreationSuccessResponse defines model for ProductCreationSuccessResponse.
type ProductIdParameter ¶
type ProductIdParameter string
ProductIdParameter defines model for ProductIdParameter.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function