peridot/vendor/github.com/ory/hydra-client-go/client/admin/get_login_request_parameters.go
2022-07-07 22:13:21 +02:00

152 lines
4.4 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"
)
// NewGetLoginRequestParams creates a new GetLoginRequestParams 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 NewGetLoginRequestParams() *GetLoginRequestParams {
return &GetLoginRequestParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetLoginRequestParamsWithTimeout creates a new GetLoginRequestParams object
// with the ability to set a timeout on a request.
func NewGetLoginRequestParamsWithTimeout(timeout time.Duration) *GetLoginRequestParams {
return &GetLoginRequestParams{
timeout: timeout,
}
}
// NewGetLoginRequestParamsWithContext creates a new GetLoginRequestParams object
// with the ability to set a context for a request.
func NewGetLoginRequestParamsWithContext(ctx context.Context) *GetLoginRequestParams {
return &GetLoginRequestParams{
Context: ctx,
}
}
// NewGetLoginRequestParamsWithHTTPClient creates a new GetLoginRequestParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetLoginRequestParamsWithHTTPClient(client *http.Client) *GetLoginRequestParams {
return &GetLoginRequestParams{
HTTPClient: client,
}
}
/* GetLoginRequestParams contains all the parameters to send to the API endpoint
for the get login request operation.
Typically these are written to a http.Request.
*/
type GetLoginRequestParams struct {
// LoginChallenge.
LoginChallenge string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get login request params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetLoginRequestParams) WithDefaults() *GetLoginRequestParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get login request params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetLoginRequestParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get login request params
func (o *GetLoginRequestParams) WithTimeout(timeout time.Duration) *GetLoginRequestParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get login request params
func (o *GetLoginRequestParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get login request params
func (o *GetLoginRequestParams) WithContext(ctx context.Context) *GetLoginRequestParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get login request params
func (o *GetLoginRequestParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get login request params
func (o *GetLoginRequestParams) WithHTTPClient(client *http.Client) *GetLoginRequestParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get login request params
func (o *GetLoginRequestParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithLoginChallenge adds the loginChallenge to the get login request params
func (o *GetLoginRequestParams) WithLoginChallenge(loginChallenge string) *GetLoginRequestParams {
o.SetLoginChallenge(loginChallenge)
return o
}
// SetLoginChallenge adds the loginChallenge to the get login request params
func (o *GetLoginRequestParams) SetLoginChallenge(loginChallenge string) {
o.LoginChallenge = loginChallenge
}
// WriteToRequest writes these params to a swagger request
func (o *GetLoginRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param login_challenge
qrLoginChallenge := o.LoginChallenge
qLoginChallenge := qrLoginChallenge
if qLoginChallenge != "" {
if err := r.SetQueryParam("login_challenge", qLoginChallenge); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}