github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/authentication/request_reset_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package authentication
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"context"
    10  	"net/http"
    11  	"time"
    12  
    13  	"github.com/go-openapi/errors"
    14  	"github.com/go-openapi/runtime"
    15  	cr "github.com/go-openapi/runtime/client"
    16  	"github.com/go-openapi/strfmt"
    17  )
    18  
    19  // NewRequestResetParams creates a new RequestResetParams object,
    20  // with the default timeout for this client.
    21  //
    22  // Default values are not hydrated, since defaults are normally applied by the API server side.
    23  //
    24  // To enforce default values in parameter, use SetDefaults or WithDefaults.
    25  func NewRequestResetParams() *RequestResetParams {
    26  	return &RequestResetParams{
    27  		timeout: cr.DefaultTimeout,
    28  	}
    29  }
    30  
    31  // NewRequestResetParamsWithTimeout creates a new RequestResetParams object
    32  // with the ability to set a timeout on a request.
    33  func NewRequestResetParamsWithTimeout(timeout time.Duration) *RequestResetParams {
    34  	return &RequestResetParams{
    35  		timeout: timeout,
    36  	}
    37  }
    38  
    39  // NewRequestResetParamsWithContext creates a new RequestResetParams object
    40  // with the ability to set a context for a request.
    41  func NewRequestResetParamsWithContext(ctx context.Context) *RequestResetParams {
    42  	return &RequestResetParams{
    43  		Context: ctx,
    44  	}
    45  }
    46  
    47  // NewRequestResetParamsWithHTTPClient creates a new RequestResetParams object
    48  // with the ability to set a custom HTTPClient for a request.
    49  func NewRequestResetParamsWithHTTPClient(client *http.Client) *RequestResetParams {
    50  	return &RequestResetParams{
    51  		HTTPClient: client,
    52  	}
    53  }
    54  
    55  /* RequestResetParams contains all the parameters to send to the API endpoint
    56     for the request reset operation.
    57  
    58     Typically these are written to a http.Request.
    59  */
    60  type RequestResetParams struct {
    61  
    62  	/* Email.
    63  
    64  	   User email address
    65  	*/
    66  	Email string
    67  
    68  	timeout    time.Duration
    69  	Context    context.Context
    70  	HTTPClient *http.Client
    71  }
    72  
    73  // WithDefaults hydrates default values in the request reset params (not the query body).
    74  //
    75  // All values with no default are reset to their zero value.
    76  func (o *RequestResetParams) WithDefaults() *RequestResetParams {
    77  	o.SetDefaults()
    78  	return o
    79  }
    80  
    81  // SetDefaults hydrates default values in the request reset params (not the query body).
    82  //
    83  // All values with no default are reset to their zero value.
    84  func (o *RequestResetParams) SetDefaults() {
    85  	// no default values defined for this parameter
    86  }
    87  
    88  // WithTimeout adds the timeout to the request reset params
    89  func (o *RequestResetParams) WithTimeout(timeout time.Duration) *RequestResetParams {
    90  	o.SetTimeout(timeout)
    91  	return o
    92  }
    93  
    94  // SetTimeout adds the timeout to the request reset params
    95  func (o *RequestResetParams) SetTimeout(timeout time.Duration) {
    96  	o.timeout = timeout
    97  }
    98  
    99  // WithContext adds the context to the request reset params
   100  func (o *RequestResetParams) WithContext(ctx context.Context) *RequestResetParams {
   101  	o.SetContext(ctx)
   102  	return o
   103  }
   104  
   105  // SetContext adds the context to the request reset params
   106  func (o *RequestResetParams) SetContext(ctx context.Context) {
   107  	o.Context = ctx
   108  }
   109  
   110  // WithHTTPClient adds the HTTPClient to the request reset params
   111  func (o *RequestResetParams) WithHTTPClient(client *http.Client) *RequestResetParams {
   112  	o.SetHTTPClient(client)
   113  	return o
   114  }
   115  
   116  // SetHTTPClient adds the HTTPClient to the request reset params
   117  func (o *RequestResetParams) SetHTTPClient(client *http.Client) {
   118  	o.HTTPClient = client
   119  }
   120  
   121  // WithEmail adds the email to the request reset params
   122  func (o *RequestResetParams) WithEmail(email string) *RequestResetParams {
   123  	o.SetEmail(email)
   124  	return o
   125  }
   126  
   127  // SetEmail adds the email to the request reset params
   128  func (o *RequestResetParams) SetEmail(email string) {
   129  	o.Email = email
   130  }
   131  
   132  // WriteToRequest writes these params to a swagger request
   133  func (o *RequestResetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   134  
   135  	if err := r.SetTimeout(o.timeout); err != nil {
   136  		return err
   137  	}
   138  	var res []error
   139  
   140  	// path param email
   141  	if err := r.SetPathParam("email", o.Email); err != nil {
   142  		return err
   143  	}
   144  
   145  	if len(res) > 0 {
   146  		return errors.CompositeValidationError(res...)
   147  	}
   148  	return nil
   149  }