feat: init
This commit is contained in:
371
client/customer/customer_client.go
Normal file
371
client/customer/customer_client.go
Normal file
@ -0,0 +1,371 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// New creates a new customer API client.
|
||||
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
||||
return &Client{transport: transport, formats: formats}
|
||||
}
|
||||
|
||||
/*
|
||||
Client for customer API
|
||||
*/
|
||||
type Client struct {
|
||||
transport runtime.ClientTransport
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ClientOption is the option for Client methods
|
||||
type ClientOption func(*runtime.ClientOperation)
|
||||
|
||||
// ClientService is the interface for Client methods
|
||||
type ClientService interface {
|
||||
DeleteAPICustomersIDRatesRateID(params *DeleteAPICustomersIDRatesRateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPICustomersIDRatesRateIDNoContent, error)
|
||||
|
||||
GetAPICustomers(params *GetAPICustomersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPICustomersOK, error)
|
||||
|
||||
GetAPICustomersID(params *GetAPICustomersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPICustomersIDOK, error)
|
||||
|
||||
GetAPICustomersIDRates(params *GetAPICustomersIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPICustomersIDRatesOK, error)
|
||||
|
||||
PatchAPICustomersID(params *PatchAPICustomersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPICustomersIDOK, error)
|
||||
|
||||
PatchAPICustomersIDMeta(params *PatchAPICustomersIDMetaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPICustomersIDMetaOK, error)
|
||||
|
||||
PostAPICustomers(params *PostAPICustomersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPICustomersOK, error)
|
||||
|
||||
PostAPICustomersIDRates(params *PostAPICustomersIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPICustomersIDRatesOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPICustomersIDRatesRateID deletes one rate for an customer
|
||||
*/
|
||||
func (a *Client) DeleteAPICustomersIDRatesRateID(params *DeleteAPICustomersIDRatesRateIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPICustomersIDRatesRateIDNoContent, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewDeleteAPICustomersIDRatesRateIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "DeleteAPICustomersIDRatesRateID",
|
||||
Method: "DELETE",
|
||||
PathPattern: "/api/customers/{id}/rates/{rateId}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &DeleteAPICustomersIDRatesRateIDReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*DeleteAPICustomersIDRatesRateIDNoContent)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for DeleteAPICustomersIDRatesRateID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomers returns a collection of customers
|
||||
*/
|
||||
func (a *Client) GetAPICustomers(params *GetAPICustomersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPICustomersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPICustomersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPICustomers",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/customers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPICustomersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAPICustomersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for GetAPICustomers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersID returns one customer
|
||||
*/
|
||||
func (a *Client) GetAPICustomersID(params *GetAPICustomersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPICustomersIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPICustomersIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPICustomersID",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/customers/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPICustomersIDReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAPICustomersIDOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for GetAPICustomersID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersIDRates returns a collection of all rates for one customer
|
||||
*/
|
||||
func (a *Client) GetAPICustomersIDRates(params *GetAPICustomersIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetAPICustomersIDRatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewGetAPICustomersIDRatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "GetAPICustomersIDRates",
|
||||
Method: "GET",
|
||||
PathPattern: "/api/customers/{id}/rates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &GetAPICustomersIDRatesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*GetAPICustomersIDRatesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for GetAPICustomersIDRates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPICustomersID updates an existing customer
|
||||
|
||||
Update an existing customer, you can pass all or just a subset of all attributes
|
||||
*/
|
||||
func (a *Client) PatchAPICustomersID(params *PatchAPICustomersIDParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPICustomersIDOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPICustomersIDParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPICustomersID",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/customers/{id}",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPICustomersIDReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PatchAPICustomersIDOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for PatchAPICustomersID: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPICustomersIDMeta sets the value of a meta field for an existing customer
|
||||
*/
|
||||
func (a *Client) PatchAPICustomersIDMeta(params *PatchAPICustomersIDMetaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAPICustomersIDMetaOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPatchAPICustomersIDMetaParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PatchAPICustomersIDMeta",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/api/customers/{id}/meta",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PatchAPICustomersIDMetaReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PatchAPICustomersIDMetaOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for PatchAPICustomersIDMeta: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPICustomers creates a new customer
|
||||
|
||||
Creates a new customer and returns it afterwards
|
||||
*/
|
||||
func (a *Client) PostAPICustomers(params *PostAPICustomersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPICustomersOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPICustomersParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPICustomers",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/customers",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPICustomersReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostAPICustomersOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for PostAPICustomers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPICustomersIDRates adds a new rate to a customer
|
||||
*/
|
||||
func (a *Client) PostAPICustomersIDRates(params *PostAPICustomersIDRatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostAPICustomersIDRatesOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewPostAPICustomersIDRatesParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "PostAPICustomersIDRates",
|
||||
Method: "POST",
|
||||
PathPattern: "/api/customers/{id}/rates",
|
||||
ProducesMediaTypes: []string{"application/json"},
|
||||
ConsumesMediaTypes: []string{"application/json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &PostAPICustomersIDRatesReader{formats: a.formats},
|
||||
AuthInfo: authInfo,
|
||||
Context: params.Context,
|
||||
Client: params.HTTPClient,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(op)
|
||||
}
|
||||
|
||||
result, err := a.transport.Submit(op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
success, ok := result.(*PostAPICustomersIDRatesOK)
|
||||
if ok {
|
||||
return success, nil
|
||||
}
|
||||
// unexpected success response
|
||||
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
|
||||
msg := fmt.Sprintf("unexpected success response for PostAPICustomersIDRates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
// SetTransport changes the transport on the client
|
||||
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
||||
a.transport = transport
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewDeleteAPICustomersIDRatesRateIDParams creates a new DeleteAPICustomersIDRatesRateIDParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewDeleteAPICustomersIDRatesRateIDParams() *DeleteAPICustomersIDRatesRateIDParams {
|
||||
return &DeleteAPICustomersIDRatesRateIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPICustomersIDRatesRateIDParamsWithTimeout creates a new DeleteAPICustomersIDRatesRateIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewDeleteAPICustomersIDRatesRateIDParamsWithTimeout(timeout time.Duration) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
return &DeleteAPICustomersIDRatesRateIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPICustomersIDRatesRateIDParamsWithContext creates a new DeleteAPICustomersIDRatesRateIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewDeleteAPICustomersIDRatesRateIDParamsWithContext(ctx context.Context) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
return &DeleteAPICustomersIDRatesRateIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPICustomersIDRatesRateIDParamsWithHTTPClient creates a new DeleteAPICustomersIDRatesRateIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewDeleteAPICustomersIDRatesRateIDParamsWithHTTPClient(client *http.Client) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
return &DeleteAPICustomersIDRatesRateIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPICustomersIDRatesRateIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the delete API customers ID rates rate ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type DeleteAPICustomersIDRatesRateIDParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The customer whose rate will be removed
|
||||
*/
|
||||
ID int64
|
||||
|
||||
/* RateID.
|
||||
|
||||
The rate to remove
|
||||
*/
|
||||
RateID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the delete API customers ID rates rate ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) WithDefaults() *DeleteAPICustomersIDRatesRateIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the delete API customers ID rates rate ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) WithTimeout(timeout time.Duration) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) WithContext(ctx context.Context) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) WithHTTPClient(client *http.Client) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) WithID(id int64) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WithRateID adds the rateID to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) WithRateID(rateID int64) *DeleteAPICustomersIDRatesRateIDParams {
|
||||
o.SetRateID(rateID)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetRateID adds the rateId to the delete API customers ID rates rate ID params
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) SetRateID(rateID int64) {
|
||||
o.RateID = rateID
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *DeleteAPICustomersIDRatesRateIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param rateId
|
||||
if err := r.SetPathParam("rateId", swag.FormatInt64(o.RateID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// DeleteAPICustomersIDRatesRateIDReader is a Reader for the DeleteAPICustomersIDRatesRateID structure.
|
||||
type DeleteAPICustomersIDRatesRateIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *DeleteAPICustomersIDRatesRateIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 204:
|
||||
result := NewDeleteAPICustomersIDRatesRateIDNoContent()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteAPICustomersIDRatesRateIDNoContent creates a DeleteAPICustomersIDRatesRateIDNoContent with default headers values
|
||||
func NewDeleteAPICustomersIDRatesRateIDNoContent() *DeleteAPICustomersIDRatesRateIDNoContent {
|
||||
return &DeleteAPICustomersIDRatesRateIDNoContent{}
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteAPICustomersIDRatesRateIDNoContent describes a response with status code 204, with default header values.
|
||||
|
||||
Returns no content: 204 on successful delete
|
||||
*/
|
||||
type DeleteAPICustomersIDRatesRateIDNoContent struct {
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this delete Api customers Id rates rate Id no content response has a 2xx status code
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this delete Api customers Id rates rate Id no content response has a 3xx status code
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this delete Api customers Id rates rate Id no content response has a 4xx status code
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this delete Api customers Id rates rate Id no content response has a 5xx status code
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this delete Api customers Id rates rate Id no content response a status code equal to that given
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) IsCode(code int) bool {
|
||||
return code == 204
|
||||
}
|
||||
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) Error() string {
|
||||
return fmt.Sprintf("[DELETE /api/customers/{id}/rates/{rateId}][%d] deleteApiCustomersIdRatesRateIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) String() string {
|
||||
return fmt.Sprintf("[DELETE /api/customers/{id}/rates/{rateId}][%d] deleteApiCustomersIdRatesRateIdNoContent ", 204)
|
||||
}
|
||||
|
||||
func (o *DeleteAPICustomersIDRatesRateIDNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
return nil
|
||||
}
|
148
client/customer/get_api_customers_id_parameters.go
Normal file
148
client/customer/get_api_customers_id_parameters.go
Normal file
@ -0,0 +1,148 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetAPICustomersIDParams creates a new GetAPICustomersIDParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetAPICustomersIDParams() *GetAPICustomersIDParams {
|
||||
return &GetAPICustomersIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDParamsWithTimeout creates a new GetAPICustomersIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPICustomersIDParamsWithTimeout(timeout time.Duration) *GetAPICustomersIDParams {
|
||||
return &GetAPICustomersIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDParamsWithContext creates a new GetAPICustomersIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPICustomersIDParamsWithContext(ctx context.Context) *GetAPICustomersIDParams {
|
||||
return &GetAPICustomersIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDParamsWithHTTPClient creates a new GetAPICustomersIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPICustomersIDParamsWithHTTPClient(client *http.Client) *GetAPICustomersIDParams {
|
||||
return &GetAPICustomersIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API customers ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPICustomersIDParams struct {
|
||||
|
||||
// ID.
|
||||
ID string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API customers ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPICustomersIDParams) WithDefaults() *GetAPICustomersIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API customers ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPICustomersIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) WithTimeout(timeout time.Duration) *GetAPICustomersIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) WithContext(ctx context.Context) *GetAPICustomersIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) WithHTTPClient(client *http.Client) *GetAPICustomersIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) WithID(id string) *GetAPICustomersIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API customers ID params
|
||||
func (o *GetAPICustomersIDParams) SetID(id string) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPICustomersIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", o.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
152
client/customer/get_api_customers_id_rates_parameters.go
Normal file
152
client/customer/get_api_customers_id_rates_parameters.go
Normal file
@ -0,0 +1,152 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetAPICustomersIDRatesParams creates a new GetAPICustomersIDRatesParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetAPICustomersIDRatesParams() *GetAPICustomersIDRatesParams {
|
||||
return &GetAPICustomersIDRatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDRatesParamsWithTimeout creates a new GetAPICustomersIDRatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPICustomersIDRatesParamsWithTimeout(timeout time.Duration) *GetAPICustomersIDRatesParams {
|
||||
return &GetAPICustomersIDRatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDRatesParamsWithContext creates a new GetAPICustomersIDRatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPICustomersIDRatesParamsWithContext(ctx context.Context) *GetAPICustomersIDRatesParams {
|
||||
return &GetAPICustomersIDRatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDRatesParamsWithHTTPClient creates a new GetAPICustomersIDRatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPICustomersIDRatesParamsWithHTTPClient(client *http.Client) *GetAPICustomersIDRatesParams {
|
||||
return &GetAPICustomersIDRatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersIDRatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API customers ID rates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPICustomersIDRatesParams struct {
|
||||
|
||||
/* ID.
|
||||
|
||||
The customer whose rates will be returned
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API customers ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPICustomersIDRatesParams) WithDefaults() *GetAPICustomersIDRatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API customers ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPICustomersIDRatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) WithTimeout(timeout time.Duration) *GetAPICustomersIDRatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) WithContext(ctx context.Context) *GetAPICustomersIDRatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) WithHTTPClient(client *http.Client) *GetAPICustomersIDRatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithID adds the id to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) WithID(id int64) *GetAPICustomersIDRatesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the get API customers ID rates params
|
||||
func (o *GetAPICustomersIDRatesParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPICustomersIDRatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/customer/get_api_customers_id_rates_responses.go
Normal file
96
client/customer/get_api_customers_id_rates_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// GetAPICustomersIDRatesReader is a Reader for the GetAPICustomersIDRates structure.
|
||||
type GetAPICustomersIDRatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPICustomersIDRatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPICustomersIDRatesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDRatesOK creates a GetAPICustomersIDRatesOK with default headers values
|
||||
func NewGetAPICustomersIDRatesOK() *GetAPICustomersIDRatesOK {
|
||||
return &GetAPICustomersIDRatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersIDRatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a collection of customer rate entities
|
||||
*/
|
||||
type GetAPICustomersIDRatesOK struct {
|
||||
Payload []*models.CustomerRate
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api customers Id rates o k response has a 2xx status code
|
||||
func (o *GetAPICustomersIDRatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api customers Id rates o k response has a 3xx status code
|
||||
func (o *GetAPICustomersIDRatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api customers Id rates o k response has a 4xx status code
|
||||
func (o *GetAPICustomersIDRatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api customers Id rates o k response has a 5xx status code
|
||||
func (o *GetAPICustomersIDRatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api customers Id rates o k response a status code equal to that given
|
||||
func (o *GetAPICustomersIDRatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDRatesOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/customers/{id}/rates][%d] getApiCustomersIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDRatesOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/customers/{id}/rates][%d] getApiCustomersIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDRatesOK) GetPayload() []*models.CustomerRate {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDRatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
98
client/customer/get_api_customers_id_responses.go
Normal file
98
client/customer/get_api_customers_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// GetAPICustomersIDReader is a Reader for the GetAPICustomersID structure.
|
||||
type GetAPICustomersIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPICustomersIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPICustomersIDOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersIDOK creates a GetAPICustomersIDOK with default headers values
|
||||
func NewGetAPICustomersIDOK() *GetAPICustomersIDOK {
|
||||
return &GetAPICustomersIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns one customer entity
|
||||
*/
|
||||
type GetAPICustomersIDOK struct {
|
||||
Payload *models.CustomerEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api customers Id o k response has a 2xx status code
|
||||
func (o *GetAPICustomersIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api customers Id o k response has a 3xx status code
|
||||
func (o *GetAPICustomersIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api customers Id o k response has a 4xx status code
|
||||
func (o *GetAPICustomersIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api customers Id o k response has a 5xx status code
|
||||
func (o *GetAPICustomersIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api customers Id o k response a status code equal to that given
|
||||
func (o *GetAPICustomersIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/customers/{id}][%d] getApiCustomersIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/customers/{id}][%d] getApiCustomersIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDOK) GetPayload() *models.CustomerEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.CustomerEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
238
client/customer/get_api_customers_parameters.go
Normal file
238
client/customer/get_api_customers_parameters.go
Normal file
@ -0,0 +1,238 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
)
|
||||
|
||||
// NewGetAPICustomersParams creates a new GetAPICustomersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewGetAPICustomersParams() *GetAPICustomersParams {
|
||||
return &GetAPICustomersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersParamsWithTimeout creates a new GetAPICustomersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewGetAPICustomersParamsWithTimeout(timeout time.Duration) *GetAPICustomersParams {
|
||||
return &GetAPICustomersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersParamsWithContext creates a new GetAPICustomersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewGetAPICustomersParamsWithContext(ctx context.Context) *GetAPICustomersParams {
|
||||
return &GetAPICustomersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersParamsWithHTTPClient creates a new GetAPICustomersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewGetAPICustomersParamsWithHTTPClient(client *http.Client) *GetAPICustomersParams {
|
||||
return &GetAPICustomersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the get API customers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type GetAPICustomersParams struct {
|
||||
|
||||
/* Order.
|
||||
|
||||
The result order. Allowed values: ASC, DESC (default: ASC)
|
||||
*/
|
||||
Order string
|
||||
|
||||
/* OrderBy.
|
||||
|
||||
The field by which results will be ordered. Allowed values: id, name (default: name)
|
||||
*/
|
||||
OrderBy string
|
||||
|
||||
/* Term.
|
||||
|
||||
Free search term
|
||||
*/
|
||||
Term *string
|
||||
|
||||
/* Visible.
|
||||
|
||||
Visibility status to filter activities (1=visible, 2=hidden, 3=both)
|
||||
*/
|
||||
Visible string
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the get API customers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPICustomersParams) WithDefaults() *GetAPICustomersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the get API customers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *GetAPICustomersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the get API customers params
|
||||
func (o *GetAPICustomersParams) WithTimeout(timeout time.Duration) *GetAPICustomersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the get API customers params
|
||||
func (o *GetAPICustomersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the get API customers params
|
||||
func (o *GetAPICustomersParams) WithContext(ctx context.Context) *GetAPICustomersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the get API customers params
|
||||
func (o *GetAPICustomersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the get API customers params
|
||||
func (o *GetAPICustomersParams) WithHTTPClient(client *http.Client) *GetAPICustomersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the get API customers params
|
||||
func (o *GetAPICustomersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithOrder adds the order to the get API customers params
|
||||
func (o *GetAPICustomersParams) WithOrder(order string) *GetAPICustomersParams {
|
||||
o.SetOrder(order)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOrder adds the order to the get API customers params
|
||||
func (o *GetAPICustomersParams) SetOrder(order string) {
|
||||
o.Order = order
|
||||
}
|
||||
|
||||
// WithOrderBy adds the orderBy to the get API customers params
|
||||
func (o *GetAPICustomersParams) WithOrderBy(orderBy string) *GetAPICustomersParams {
|
||||
o.SetOrderBy(orderBy)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetOrderBy adds the orderBy to the get API customers params
|
||||
func (o *GetAPICustomersParams) SetOrderBy(orderBy string) {
|
||||
o.OrderBy = orderBy
|
||||
}
|
||||
|
||||
// WithTerm adds the term to the get API customers params
|
||||
func (o *GetAPICustomersParams) WithTerm(term *string) *GetAPICustomersParams {
|
||||
o.SetTerm(term)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTerm adds the term to the get API customers params
|
||||
func (o *GetAPICustomersParams) SetTerm(term *string) {
|
||||
o.Term = term
|
||||
}
|
||||
|
||||
// WithVisible adds the visible to the get API customers params
|
||||
func (o *GetAPICustomersParams) WithVisible(visible string) *GetAPICustomersParams {
|
||||
o.SetVisible(visible)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetVisible adds the visible to the get API customers params
|
||||
func (o *GetAPICustomersParams) SetVisible(visible string) {
|
||||
o.Visible = visible
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *GetAPICustomersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
|
||||
// query param order
|
||||
qrOrder := o.Order
|
||||
qOrder := qrOrder
|
||||
|
||||
if err := r.SetQueryParam("order", qOrder); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// query param orderBy
|
||||
qrOrderBy := o.OrderBy
|
||||
qOrderBy := qrOrderBy
|
||||
|
||||
if err := r.SetQueryParam("orderBy", qOrderBy); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if o.Term != nil {
|
||||
|
||||
// query param term
|
||||
var qrTerm string
|
||||
|
||||
if o.Term != nil {
|
||||
qrTerm = *o.Term
|
||||
}
|
||||
qTerm := qrTerm
|
||||
if qTerm != "" {
|
||||
|
||||
if err := r.SetQueryParam("term", qTerm); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// query param visible
|
||||
qrVisible := o.Visible
|
||||
qVisible := qrVisible
|
||||
|
||||
if err := r.SetQueryParam("visible", qVisible); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
96
client/customer/get_api_customers_responses.go
Normal file
96
client/customer/get_api_customers_responses.go
Normal file
@ -0,0 +1,96 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// GetAPICustomersReader is a Reader for the GetAPICustomers structure.
|
||||
type GetAPICustomersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *GetAPICustomersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewGetAPICustomersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetAPICustomersOK creates a GetAPICustomersOK with default headers values
|
||||
func NewGetAPICustomersOK() *GetAPICustomersOK {
|
||||
return &GetAPICustomersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetAPICustomersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns a collection of customer entities
|
||||
*/
|
||||
type GetAPICustomersOK struct {
|
||||
Payload []*models.CustomerCollection
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this get Api customers o k response has a 2xx status code
|
||||
func (o *GetAPICustomersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this get Api customers o k response has a 3xx status code
|
||||
func (o *GetAPICustomersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this get Api customers o k response has a 4xx status code
|
||||
func (o *GetAPICustomersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this get Api customers o k response has a 5xx status code
|
||||
func (o *GetAPICustomersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this get Api customers o k response a status code equal to that given
|
||||
func (o *GetAPICustomersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersOK) Error() string {
|
||||
return fmt.Sprintf("[GET /api/customers][%d] getApiCustomersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersOK) String() string {
|
||||
return fmt.Sprintf("[GET /api/customers][%d] getApiCustomersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersOK) GetPayload() []*models.CustomerCollection {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *GetAPICustomersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
169
client/customer/patch_api_customers_id_meta_parameters.go
Normal file
169
client/customer/patch_api_customers_id_meta_parameters.go
Normal file
@ -0,0 +1,169 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewPatchAPICustomersIDMetaParams creates a new PatchAPICustomersIDMetaParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPatchAPICustomersIDMetaParams() *PatchAPICustomersIDMetaParams {
|
||||
return &PatchAPICustomersIDMetaParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDMetaParamsWithTimeout creates a new PatchAPICustomersIDMetaParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPICustomersIDMetaParamsWithTimeout(timeout time.Duration) *PatchAPICustomersIDMetaParams {
|
||||
return &PatchAPICustomersIDMetaParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDMetaParamsWithContext creates a new PatchAPICustomersIDMetaParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPICustomersIDMetaParamsWithContext(ctx context.Context) *PatchAPICustomersIDMetaParams {
|
||||
return &PatchAPICustomersIDMetaParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDMetaParamsWithHTTPClient creates a new PatchAPICustomersIDMetaParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPICustomersIDMetaParamsWithHTTPClient(client *http.Client) *PatchAPICustomersIDMetaParams {
|
||||
return &PatchAPICustomersIDMetaParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPICustomersIDMetaParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API customers ID meta operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPICustomersIDMetaParams struct {
|
||||
|
||||
// Body.
|
||||
Body PatchAPICustomersIDMetaBody
|
||||
|
||||
/* ID.
|
||||
|
||||
Customer record ID to set the meta-field value for
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API customers ID meta params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPICustomersIDMetaParams) WithDefaults() *PatchAPICustomersIDMetaParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API customers ID meta params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPICustomersIDMetaParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) WithTimeout(timeout time.Duration) *PatchAPICustomersIDMetaParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) WithContext(ctx context.Context) *PatchAPICustomersIDMetaParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) WithHTTPClient(client *http.Client) *PatchAPICustomersIDMetaParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) WithBody(body PatchAPICustomersIDMetaBody) *PatchAPICustomersIDMetaParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) SetBody(body PatchAPICustomersIDMetaBody) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) WithID(id int64) *PatchAPICustomersIDMetaParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API customers ID meta params
|
||||
func (o *PatchAPICustomersIDMetaParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPICustomersIDMetaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
176
client/customer/patch_api_customers_id_meta_responses.go
Normal file
176
client/customer/patch_api_customers_id_meta_responses.go
Normal file
@ -0,0 +1,176 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// PatchAPICustomersIDMetaReader is a Reader for the PatchAPICustomersIDMeta structure.
|
||||
type PatchAPICustomersIDMetaReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPICustomersIDMetaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPICustomersIDMetaOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDMetaOK creates a PatchAPICustomersIDMetaOK with default headers values
|
||||
func NewPatchAPICustomersIDMetaOK() *PatchAPICustomersIDMetaOK {
|
||||
return &PatchAPICustomersIDMetaOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPICustomersIDMetaOK describes a response with status code 200, with default header values.
|
||||
|
||||
Sets the value of an existing/configured meta-field. You cannot create unknown meta-fields, if the given name is not a configured meta-field, this will return an exception.
|
||||
*/
|
||||
type PatchAPICustomersIDMetaOK struct {
|
||||
Payload *models.CustomerEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api customers Id meta o k response has a 2xx status code
|
||||
func (o *PatchAPICustomersIDMetaOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api customers Id meta o k response has a 3xx status code
|
||||
func (o *PatchAPICustomersIDMetaOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api customers Id meta o k response has a 4xx status code
|
||||
func (o *PatchAPICustomersIDMetaOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api customers Id meta o k response has a 5xx status code
|
||||
func (o *PatchAPICustomersIDMetaOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api customers Id meta o k response a status code equal to that given
|
||||
func (o *PatchAPICustomersIDMetaOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDMetaOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/customers/{id}/meta][%d] patchApiCustomersIdMetaOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDMetaOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/customers/{id}/meta][%d] patchApiCustomersIdMetaOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDMetaOK) GetPayload() *models.CustomerEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDMetaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.CustomerEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPICustomersIDMetaBody patch API customers ID meta body
|
||||
swagger:model PatchAPICustomersIDMetaBody
|
||||
*/
|
||||
type PatchAPICustomersIDMetaBody struct {
|
||||
|
||||
// The meta-field name
|
||||
// Required: true
|
||||
Name *string `json:"name"`
|
||||
|
||||
// The meta-field value
|
||||
// Required: true
|
||||
Value *string `json:"value"`
|
||||
}
|
||||
|
||||
// Validate validates this patch API customers ID meta body
|
||||
func (o *PatchAPICustomersIDMetaBody) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := o.validateName(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := o.validateValue(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDMetaBody) validateName(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("body"+"."+"name", "body", o.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDMetaBody) validateValue(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("body"+"."+"value", "body", o.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this patch API customers ID meta body based on context it is used
|
||||
func (o *PatchAPICustomersIDMetaBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (o *PatchAPICustomersIDMetaBody) MarshalBinary() ([]byte, error) {
|
||||
if o == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(o)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (o *PatchAPICustomersIDMetaBody) UnmarshalBinary(b []byte) error {
|
||||
var res PatchAPICustomersIDMetaBody
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*o = res
|
||||
return nil
|
||||
}
|
173
client/customer/patch_api_customers_id_parameters.go
Normal file
173
client/customer/patch_api_customers_id_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// NewPatchAPICustomersIDParams creates a new PatchAPICustomersIDParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPatchAPICustomersIDParams() *PatchAPICustomersIDParams {
|
||||
return &PatchAPICustomersIDParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDParamsWithTimeout creates a new PatchAPICustomersIDParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPatchAPICustomersIDParamsWithTimeout(timeout time.Duration) *PatchAPICustomersIDParams {
|
||||
return &PatchAPICustomersIDParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDParamsWithContext creates a new PatchAPICustomersIDParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPatchAPICustomersIDParamsWithContext(ctx context.Context) *PatchAPICustomersIDParams {
|
||||
return &PatchAPICustomersIDParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDParamsWithHTTPClient creates a new PatchAPICustomersIDParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPatchAPICustomersIDParamsWithHTTPClient(client *http.Client) *PatchAPICustomersIDParams {
|
||||
return &PatchAPICustomersIDParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPICustomersIDParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the patch API customers ID operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PatchAPICustomersIDParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.CustomerEditForm
|
||||
|
||||
/* ID.
|
||||
|
||||
Customer ID to update
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the patch API customers ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPICustomersIDParams) WithDefaults() *PatchAPICustomersIDParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the patch API customers ID params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PatchAPICustomersIDParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) WithTimeout(timeout time.Duration) *PatchAPICustomersIDParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) WithContext(ctx context.Context) *PatchAPICustomersIDParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) WithHTTPClient(client *http.Client) *PatchAPICustomersIDParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) WithBody(body *models.CustomerEditForm) *PatchAPICustomersIDParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) SetBody(body *models.CustomerEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) WithID(id int64) *PatchAPICustomersIDParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the patch API customers ID params
|
||||
func (o *PatchAPICustomersIDParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PatchAPICustomersIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/customer/patch_api_customers_id_responses.go
Normal file
98
client/customer/patch_api_customers_id_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// PatchAPICustomersIDReader is a Reader for the PatchAPICustomersID structure.
|
||||
type PatchAPICustomersIDReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PatchAPICustomersIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPatchAPICustomersIDOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPatchAPICustomersIDOK creates a PatchAPICustomersIDOK with default headers values
|
||||
func NewPatchAPICustomersIDOK() *PatchAPICustomersIDOK {
|
||||
return &PatchAPICustomersIDOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PatchAPICustomersIDOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the updated customer
|
||||
*/
|
||||
type PatchAPICustomersIDOK struct {
|
||||
Payload *models.CustomerEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this patch Api customers Id o k response has a 2xx status code
|
||||
func (o *PatchAPICustomersIDOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this patch Api customers Id o k response has a 3xx status code
|
||||
func (o *PatchAPICustomersIDOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this patch Api customers Id o k response has a 4xx status code
|
||||
func (o *PatchAPICustomersIDOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this patch Api customers Id o k response has a 5xx status code
|
||||
func (o *PatchAPICustomersIDOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this patch Api customers Id o k response a status code equal to that given
|
||||
func (o *PatchAPICustomersIDOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDOK) Error() string {
|
||||
return fmt.Sprintf("[PATCH /api/customers/{id}][%d] patchApiCustomersIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDOK) String() string {
|
||||
return fmt.Sprintf("[PATCH /api/customers/{id}][%d] patchApiCustomersIdOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDOK) GetPayload() *models.CustomerEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PatchAPICustomersIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.CustomerEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
173
client/customer/post_api_customers_id_rates_parameters.go
Normal file
173
client/customer/post_api_customers_id_rates_parameters.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// NewPostAPICustomersIDRatesParams creates a new PostAPICustomersIDRatesParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostAPICustomersIDRatesParams() *PostAPICustomersIDRatesParams {
|
||||
return &PostAPICustomersIDRatesParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersIDRatesParamsWithTimeout creates a new PostAPICustomersIDRatesParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPICustomersIDRatesParamsWithTimeout(timeout time.Duration) *PostAPICustomersIDRatesParams {
|
||||
return &PostAPICustomersIDRatesParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersIDRatesParamsWithContext creates a new PostAPICustomersIDRatesParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPICustomersIDRatesParamsWithContext(ctx context.Context) *PostAPICustomersIDRatesParams {
|
||||
return &PostAPICustomersIDRatesParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersIDRatesParamsWithHTTPClient creates a new PostAPICustomersIDRatesParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPICustomersIDRatesParamsWithHTTPClient(client *http.Client) *PostAPICustomersIDRatesParams {
|
||||
return &PostAPICustomersIDRatesParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPICustomersIDRatesParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API customers ID rates operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPICustomersIDRatesParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.CustomerRateForm
|
||||
|
||||
/* ID.
|
||||
|
||||
The customer to add the rate for
|
||||
*/
|
||||
ID int64
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API customers ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPICustomersIDRatesParams) WithDefaults() *PostAPICustomersIDRatesParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API customers ID rates params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPICustomersIDRatesParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) WithTimeout(timeout time.Duration) *PostAPICustomersIDRatesParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) WithContext(ctx context.Context) *PostAPICustomersIDRatesParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) WithHTTPClient(client *http.Client) *PostAPICustomersIDRatesParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) WithBody(body *models.CustomerRateForm) *PostAPICustomersIDRatesParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) SetBody(body *models.CustomerRateForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WithID adds the id to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) WithID(id int64) *PostAPICustomersIDRatesParams {
|
||||
o.SetID(id)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetID adds the id to the post API customers ID rates params
|
||||
func (o *PostAPICustomersIDRatesParams) SetID(id int64) {
|
||||
o.ID = id
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPICustomersIDRatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// path param id
|
||||
if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/customer/post_api_customers_id_rates_responses.go
Normal file
98
client/customer/post_api_customers_id_rates_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// PostAPICustomersIDRatesReader is a Reader for the PostAPICustomersIDRates structure.
|
||||
type PostAPICustomersIDRatesReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPICustomersIDRatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPICustomersIDRatesOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersIDRatesOK creates a PostAPICustomersIDRatesOK with default headers values
|
||||
func NewPostAPICustomersIDRatesOK() *PostAPICustomersIDRatesOK {
|
||||
return &PostAPICustomersIDRatesOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPICustomersIDRatesOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created rate
|
||||
*/
|
||||
type PostAPICustomersIDRatesOK struct {
|
||||
Payload *models.CustomerRate
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api customers Id rates o k response has a 2xx status code
|
||||
func (o *PostAPICustomersIDRatesOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api customers Id rates o k response has a 3xx status code
|
||||
func (o *PostAPICustomersIDRatesOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api customers Id rates o k response has a 4xx status code
|
||||
func (o *PostAPICustomersIDRatesOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api customers Id rates o k response has a 5xx status code
|
||||
func (o *PostAPICustomersIDRatesOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api customers Id rates o k response a status code equal to that given
|
||||
func (o *PostAPICustomersIDRatesOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersIDRatesOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/customers/{id}/rates][%d] postApiCustomersIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersIDRatesOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/customers/{id}/rates][%d] postApiCustomersIdRatesOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersIDRatesOK) GetPayload() *models.CustomerRate {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersIDRatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.CustomerRate)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
150
client/customer/post_api_customers_parameters.go
Normal file
150
client/customer/post_api_customers_parameters.go
Normal file
@ -0,0 +1,150 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// NewPostAPICustomersParams creates a new PostAPICustomersParams object,
|
||||
// with the default timeout for this client.
|
||||
//
|
||||
// Default values are not hydrated, since defaults are normally applied by the API server side.
|
||||
//
|
||||
// To enforce default values in parameter, use SetDefaults or WithDefaults.
|
||||
func NewPostAPICustomersParams() *PostAPICustomersParams {
|
||||
return &PostAPICustomersParams{
|
||||
timeout: cr.DefaultTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersParamsWithTimeout creates a new PostAPICustomersParams object
|
||||
// with the ability to set a timeout on a request.
|
||||
func NewPostAPICustomersParamsWithTimeout(timeout time.Duration) *PostAPICustomersParams {
|
||||
return &PostAPICustomersParams{
|
||||
timeout: timeout,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersParamsWithContext creates a new PostAPICustomersParams object
|
||||
// with the ability to set a context for a request.
|
||||
func NewPostAPICustomersParamsWithContext(ctx context.Context) *PostAPICustomersParams {
|
||||
return &PostAPICustomersParams{
|
||||
Context: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersParamsWithHTTPClient creates a new PostAPICustomersParams object
|
||||
// with the ability to set a custom HTTPClient for a request.
|
||||
func NewPostAPICustomersParamsWithHTTPClient(client *http.Client) *PostAPICustomersParams {
|
||||
return &PostAPICustomersParams{
|
||||
HTTPClient: client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPICustomersParams contains all the parameters to send to the API endpoint
|
||||
|
||||
for the post API customers operation.
|
||||
|
||||
Typically these are written to a http.Request.
|
||||
*/
|
||||
type PostAPICustomersParams struct {
|
||||
|
||||
// Body.
|
||||
Body *models.CustomerEditForm
|
||||
|
||||
timeout time.Duration
|
||||
Context context.Context
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// WithDefaults hydrates default values in the post API customers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPICustomersParams) WithDefaults() *PostAPICustomersParams {
|
||||
o.SetDefaults()
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDefaults hydrates default values in the post API customers params (not the query body).
|
||||
//
|
||||
// All values with no default are reset to their zero value.
|
||||
func (o *PostAPICustomersParams) SetDefaults() {
|
||||
// no default values defined for this parameter
|
||||
}
|
||||
|
||||
// WithTimeout adds the timeout to the post API customers params
|
||||
func (o *PostAPICustomersParams) WithTimeout(timeout time.Duration) *PostAPICustomersParams {
|
||||
o.SetTimeout(timeout)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetTimeout adds the timeout to the post API customers params
|
||||
func (o *PostAPICustomersParams) SetTimeout(timeout time.Duration) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
|
||||
// WithContext adds the context to the post API customers params
|
||||
func (o *PostAPICustomersParams) WithContext(ctx context.Context) *PostAPICustomersParams {
|
||||
o.SetContext(ctx)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetContext adds the context to the post API customers params
|
||||
func (o *PostAPICustomersParams) SetContext(ctx context.Context) {
|
||||
o.Context = ctx
|
||||
}
|
||||
|
||||
// WithHTTPClient adds the HTTPClient to the post API customers params
|
||||
func (o *PostAPICustomersParams) WithHTTPClient(client *http.Client) *PostAPICustomersParams {
|
||||
o.SetHTTPClient(client)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetHTTPClient adds the HTTPClient to the post API customers params
|
||||
func (o *PostAPICustomersParams) SetHTTPClient(client *http.Client) {
|
||||
o.HTTPClient = client
|
||||
}
|
||||
|
||||
// WithBody adds the body to the post API customers params
|
||||
func (o *PostAPICustomersParams) WithBody(body *models.CustomerEditForm) *PostAPICustomersParams {
|
||||
o.SetBody(body)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetBody adds the body to the post API customers params
|
||||
func (o *PostAPICustomersParams) SetBody(body *models.CustomerEditForm) {
|
||||
o.Body = body
|
||||
}
|
||||
|
||||
// WriteToRequest writes these params to a swagger request
|
||||
func (o *PostAPICustomersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
||||
|
||||
if err := r.SetTimeout(o.timeout); err != nil {
|
||||
return err
|
||||
}
|
||||
var res []error
|
||||
if o.Body != nil {
|
||||
if err := r.SetBodyParam(o.Body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
98
client/customer/post_api_customers_responses.go
Normal file
98
client/customer/post_api_customers_responses.go
Normal file
@ -0,0 +1,98 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package customer
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/go-openapi/runtime"
|
||||
"github.com/go-openapi/strfmt"
|
||||
|
||||
"decentral1se/go-kimai/models"
|
||||
)
|
||||
|
||||
// PostAPICustomersReader is a Reader for the PostAPICustomers structure.
|
||||
type PostAPICustomersReader struct {
|
||||
formats strfmt.Registry
|
||||
}
|
||||
|
||||
// ReadResponse reads a server response into the received o.
|
||||
func (o *PostAPICustomersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||||
switch response.Code() {
|
||||
case 200:
|
||||
result := NewPostAPICustomersOK()
|
||||
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
default:
|
||||
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||||
}
|
||||
}
|
||||
|
||||
// NewPostAPICustomersOK creates a PostAPICustomersOK with default headers values
|
||||
func NewPostAPICustomersOK() *PostAPICustomersOK {
|
||||
return &PostAPICustomersOK{}
|
||||
}
|
||||
|
||||
/*
|
||||
PostAPICustomersOK describes a response with status code 200, with default header values.
|
||||
|
||||
Returns the new created customer
|
||||
*/
|
||||
type PostAPICustomersOK struct {
|
||||
Payload *models.CustomerEntity
|
||||
}
|
||||
|
||||
// IsSuccess returns true when this post Api customers o k response has a 2xx status code
|
||||
func (o *PostAPICustomersOK) IsSuccess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsRedirect returns true when this post Api customers o k response has a 3xx status code
|
||||
func (o *PostAPICustomersOK) IsRedirect() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsClientError returns true when this post Api customers o k response has a 4xx status code
|
||||
func (o *PostAPICustomersOK) IsClientError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsServerError returns true when this post Api customers o k response has a 5xx status code
|
||||
func (o *PostAPICustomersOK) IsServerError() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsCode returns true when this post Api customers o k response a status code equal to that given
|
||||
func (o *PostAPICustomersOK) IsCode(code int) bool {
|
||||
return code == 200
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersOK) Error() string {
|
||||
return fmt.Sprintf("[POST /api/customers][%d] postApiCustomersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersOK) String() string {
|
||||
return fmt.Sprintf("[POST /api/customers][%d] postApiCustomersOK %+v", 200, o.Payload)
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersOK) GetPayload() *models.CustomerEntity {
|
||||
return o.Payload
|
||||
}
|
||||
|
||||
func (o *PostAPICustomersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||||
|
||||
o.Payload = new(models.CustomerEntity)
|
||||
|
||||
// response payload
|
||||
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user