154 lines
4.7 KiB
Go
154 lines
4.7 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package operations
|
|
|
|
// 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/fiskerinc/cloud-services/pkg/ota_api/models"
|
|
)
|
|
|
|
// NewPostSubscriptionconfigParams creates a new PostSubscriptionconfigParams 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 NewPostSubscriptionconfigParams() *PostSubscriptionconfigParams {
|
|
return &PostSubscriptionconfigParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewPostSubscriptionconfigParamsWithTimeout creates a new PostSubscriptionconfigParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewPostSubscriptionconfigParamsWithTimeout(timeout time.Duration) *PostSubscriptionconfigParams {
|
|
return &PostSubscriptionconfigParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewPostSubscriptionconfigParamsWithContext creates a new PostSubscriptionconfigParams object
|
|
// with the ability to set a context for a request.
|
|
func NewPostSubscriptionconfigParamsWithContext(ctx context.Context) *PostSubscriptionconfigParams {
|
|
return &PostSubscriptionconfigParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewPostSubscriptionconfigParamsWithHTTPClient creates a new PostSubscriptionconfigParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewPostSubscriptionconfigParamsWithHTTPClient(client *http.Client) *PostSubscriptionconfigParams {
|
|
return &PostSubscriptionconfigParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
PostSubscriptionconfigParams contains all the parameters to send to the API endpoint
|
|
|
|
for the post subscriptionconfig operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type PostSubscriptionconfigParams struct {
|
|
|
|
/* Config.
|
|
|
|
Subscription config data
|
|
*/
|
|
Config *models.HandlersSubConfigRequest
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the post subscriptionconfig params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PostSubscriptionconfigParams) WithDefaults() *PostSubscriptionconfigParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the post subscriptionconfig params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *PostSubscriptionconfigParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) WithTimeout(timeout time.Duration) *PostSubscriptionconfigParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) WithContext(ctx context.Context) *PostSubscriptionconfigParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) WithHTTPClient(client *http.Client) *PostSubscriptionconfigParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithConfig adds the config to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) WithConfig(config *models.HandlersSubConfigRequest) *PostSubscriptionconfigParams {
|
|
o.SetConfig(config)
|
|
return o
|
|
}
|
|
|
|
// SetConfig adds the config to the post subscriptionconfig params
|
|
func (o *PostSubscriptionconfigParams) SetConfig(config *models.HandlersSubConfigRequest) {
|
|
o.Config = config
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *PostSubscriptionconfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
if o.Config != nil {
|
|
if err := r.SetBodyParam(o.Config); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|