autogits/bots-common/gitea-generated/client/miscellaneous/get_label_template_info_parameters.go

152 lines
4.4 KiB
Go
Raw Normal View History

2024-07-07 21:08:41 +02:00
// Code generated by go-swagger; DO NOT EDIT.
package miscellaneous
// 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"
)
// NewGetLabelTemplateInfoParams creates a new GetLabelTemplateInfoParams 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 NewGetLabelTemplateInfoParams() *GetLabelTemplateInfoParams {
return &GetLabelTemplateInfoParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetLabelTemplateInfoParamsWithTimeout creates a new GetLabelTemplateInfoParams object
// with the ability to set a timeout on a request.
func NewGetLabelTemplateInfoParamsWithTimeout(timeout time.Duration) *GetLabelTemplateInfoParams {
return &GetLabelTemplateInfoParams{
timeout: timeout,
}
}
// NewGetLabelTemplateInfoParamsWithContext creates a new GetLabelTemplateInfoParams object
// with the ability to set a context for a request.
func NewGetLabelTemplateInfoParamsWithContext(ctx context.Context) *GetLabelTemplateInfoParams {
return &GetLabelTemplateInfoParams{
Context: ctx,
}
}
// NewGetLabelTemplateInfoParamsWithHTTPClient creates a new GetLabelTemplateInfoParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetLabelTemplateInfoParamsWithHTTPClient(client *http.Client) *GetLabelTemplateInfoParams {
return &GetLabelTemplateInfoParams{
HTTPClient: client,
}
}
/*
GetLabelTemplateInfoParams contains all the parameters to send to the API endpoint
for the get label template info operation.
Typically these are written to a http.Request.
*/
type GetLabelTemplateInfoParams struct {
/* Name.
name of the template
*/
Name string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get label template info params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetLabelTemplateInfoParams) WithDefaults() *GetLabelTemplateInfoParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get label template info params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetLabelTemplateInfoParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get label template info params
func (o *GetLabelTemplateInfoParams) WithTimeout(timeout time.Duration) *GetLabelTemplateInfoParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get label template info params
func (o *GetLabelTemplateInfoParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get label template info params
func (o *GetLabelTemplateInfoParams) WithContext(ctx context.Context) *GetLabelTemplateInfoParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get label template info params
func (o *GetLabelTemplateInfoParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get label template info params
func (o *GetLabelTemplateInfoParams) WithHTTPClient(client *http.Client) *GetLabelTemplateInfoParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get label template info params
func (o *GetLabelTemplateInfoParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithName adds the name to the get label template info params
func (o *GetLabelTemplateInfoParams) WithName(name string) *GetLabelTemplateInfoParams {
o.SetName(name)
return o
}
// SetName adds the name to the get label template info params
func (o *GetLabelTemplateInfoParams) SetName(name string) {
o.Name = name
}
// WriteToRequest writes these params to a swagger request
func (o *GetLabelTemplateInfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param name
if err := r.SetPathParam("name", o.Name); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}