Files
autogits/common/gitea-generated/client/admin/get_admin_runner_parameters.go

152 lines
4.2 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package admin
// 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"
)
// NewGetAdminRunnerParams creates a new GetAdminRunnerParams 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 NewGetAdminRunnerParams() *GetAdminRunnerParams {
return &GetAdminRunnerParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetAdminRunnerParamsWithTimeout creates a new GetAdminRunnerParams object
// with the ability to set a timeout on a request.
func NewGetAdminRunnerParamsWithTimeout(timeout time.Duration) *GetAdminRunnerParams {
return &GetAdminRunnerParams{
timeout: timeout,
}
}
// NewGetAdminRunnerParamsWithContext creates a new GetAdminRunnerParams object
// with the ability to set a context for a request.
func NewGetAdminRunnerParamsWithContext(ctx context.Context) *GetAdminRunnerParams {
return &GetAdminRunnerParams{
Context: ctx,
}
}
// NewGetAdminRunnerParamsWithHTTPClient creates a new GetAdminRunnerParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetAdminRunnerParamsWithHTTPClient(client *http.Client) *GetAdminRunnerParams {
return &GetAdminRunnerParams{
HTTPClient: client,
}
}
/*
GetAdminRunnerParams contains all the parameters to send to the API endpoint
for the get admin runner operation.
Typically these are written to a http.Request.
*/
type GetAdminRunnerParams struct {
/* RunnerID.
id of the runner
*/
RunnerID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get admin runner params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAdminRunnerParams) WithDefaults() *GetAdminRunnerParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get admin runner params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetAdminRunnerParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get admin runner params
func (o *GetAdminRunnerParams) WithTimeout(timeout time.Duration) *GetAdminRunnerParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get admin runner params
func (o *GetAdminRunnerParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get admin runner params
func (o *GetAdminRunnerParams) WithContext(ctx context.Context) *GetAdminRunnerParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get admin runner params
func (o *GetAdminRunnerParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get admin runner params
func (o *GetAdminRunnerParams) WithHTTPClient(client *http.Client) *GetAdminRunnerParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get admin runner params
func (o *GetAdminRunnerParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithRunnerID adds the runnerID to the get admin runner params
func (o *GetAdminRunnerParams) WithRunnerID(runnerID string) *GetAdminRunnerParams {
o.SetRunnerID(runnerID)
return o
}
// SetRunnerID adds the runnerId to the get admin runner params
func (o *GetAdminRunnerParams) SetRunnerID(runnerID string) {
o.RunnerID = runnerID
}
// WriteToRequest writes these params to a swagger request
func (o *GetAdminRunnerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param runner_id
if err := r.SetPathParam("runner_id", o.RunnerID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}