mirror of
https://github.com/openziti/zrok.git
synced 2024-11-25 01:23:49 +01:00
151 lines
3.8 KiB
Go
151 lines
3.8 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package share
|
|
|
|
// 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/openziti/zrok/rest_model_zrok"
|
|
)
|
|
|
|
// NewShareParams creates a new ShareParams 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 NewShareParams() *ShareParams {
|
|
return &ShareParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewShareParamsWithTimeout creates a new ShareParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewShareParamsWithTimeout(timeout time.Duration) *ShareParams {
|
|
return &ShareParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewShareParamsWithContext creates a new ShareParams object
|
|
// with the ability to set a context for a request.
|
|
func NewShareParamsWithContext(ctx context.Context) *ShareParams {
|
|
return &ShareParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewShareParamsWithHTTPClient creates a new ShareParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewShareParamsWithHTTPClient(client *http.Client) *ShareParams {
|
|
return &ShareParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
ShareParams contains all the parameters to send to the API endpoint
|
|
|
|
for the share operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type ShareParams struct {
|
|
|
|
// Body.
|
|
Body *rest_model_zrok.ShareRequest
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the share params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *ShareParams) WithDefaults() *ShareParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the share params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *ShareParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the share params
|
|
func (o *ShareParams) WithTimeout(timeout time.Duration) *ShareParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the share params
|
|
func (o *ShareParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the share params
|
|
func (o *ShareParams) WithContext(ctx context.Context) *ShareParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the share params
|
|
func (o *ShareParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the share params
|
|
func (o *ShareParams) WithHTTPClient(client *http.Client) *ShareParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the share params
|
|
func (o *ShareParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithBody adds the body to the share params
|
|
func (o *ShareParams) WithBody(body *rest_model_zrok.ShareRequest) *ShareParams {
|
|
o.SetBody(body)
|
|
return o
|
|
}
|
|
|
|
// SetBody adds the body to the share params
|
|
func (o *ShareParams) SetBody(body *rest_model_zrok.ShareRequest) {
|
|
o.Body = body
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *ShareParams) 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
|
|
}
|