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

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package users
     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  // NewSearchEmailsParams creates a new SearchEmailsParams 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 NewSearchEmailsParams() *SearchEmailsParams {
    26  	return &SearchEmailsParams{
    27  		timeout: cr.DefaultTimeout,
    28  	}
    29  }
    30  
    31  // NewSearchEmailsParamsWithTimeout creates a new SearchEmailsParams object
    32  // with the ability to set a timeout on a request.
    33  func NewSearchEmailsParamsWithTimeout(timeout time.Duration) *SearchEmailsParams {
    34  	return &SearchEmailsParams{
    35  		timeout: timeout,
    36  	}
    37  }
    38  
    39  // NewSearchEmailsParamsWithContext creates a new SearchEmailsParams object
    40  // with the ability to set a context for a request.
    41  func NewSearchEmailsParamsWithContext(ctx context.Context) *SearchEmailsParams {
    42  	return &SearchEmailsParams{
    43  		Context: ctx,
    44  	}
    45  }
    46  
    47  // NewSearchEmailsParamsWithHTTPClient creates a new SearchEmailsParams object
    48  // with the ability to set a custom HTTPClient for a request.
    49  func NewSearchEmailsParamsWithHTTPClient(client *http.Client) *SearchEmailsParams {
    50  	return &SearchEmailsParams{
    51  		HTTPClient: client,
    52  	}
    53  }
    54  
    55  /* SearchEmailsParams contains all the parameters to send to the API endpoint
    56     for the search emails operation.
    57  
    58     Typically these are written to a http.Request.
    59  */
    60  type SearchEmailsParams struct {
    61  
    62  	// Body.
    63  	Body SearchEmailsBody
    64  
    65  	timeout    time.Duration
    66  	Context    context.Context
    67  	HTTPClient *http.Client
    68  }
    69  
    70  // WithDefaults hydrates default values in the search emails params (not the query body).
    71  //
    72  // All values with no default are reset to their zero value.
    73  func (o *SearchEmailsParams) WithDefaults() *SearchEmailsParams {
    74  	o.SetDefaults()
    75  	return o
    76  }
    77  
    78  // SetDefaults hydrates default values in the search emails params (not the query body).
    79  //
    80  // All values with no default are reset to their zero value.
    81  func (o *SearchEmailsParams) SetDefaults() {
    82  	// no default values defined for this parameter
    83  }
    84  
    85  // WithTimeout adds the timeout to the search emails params
    86  func (o *SearchEmailsParams) WithTimeout(timeout time.Duration) *SearchEmailsParams {
    87  	o.SetTimeout(timeout)
    88  	return o
    89  }
    90  
    91  // SetTimeout adds the timeout to the search emails params
    92  func (o *SearchEmailsParams) SetTimeout(timeout time.Duration) {
    93  	o.timeout = timeout
    94  }
    95  
    96  // WithContext adds the context to the search emails params
    97  func (o *SearchEmailsParams) WithContext(ctx context.Context) *SearchEmailsParams {
    98  	o.SetContext(ctx)
    99  	return o
   100  }
   101  
   102  // SetContext adds the context to the search emails params
   103  func (o *SearchEmailsParams) SetContext(ctx context.Context) {
   104  	o.Context = ctx
   105  }
   106  
   107  // WithHTTPClient adds the HTTPClient to the search emails params
   108  func (o *SearchEmailsParams) WithHTTPClient(client *http.Client) *SearchEmailsParams {
   109  	o.SetHTTPClient(client)
   110  	return o
   111  }
   112  
   113  // SetHTTPClient adds the HTTPClient to the search emails params
   114  func (o *SearchEmailsParams) SetHTTPClient(client *http.Client) {
   115  	o.HTTPClient = client
   116  }
   117  
   118  // WithBody adds the body to the search emails params
   119  func (o *SearchEmailsParams) WithBody(body SearchEmailsBody) *SearchEmailsParams {
   120  	o.SetBody(body)
   121  	return o
   122  }
   123  
   124  // SetBody adds the body to the search emails params
   125  func (o *SearchEmailsParams) SetBody(body SearchEmailsBody) {
   126  	o.Body = body
   127  }
   128  
   129  // WriteToRequest writes these params to a swagger request
   130  func (o *SearchEmailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   131  
   132  	if err := r.SetTimeout(o.timeout); err != nil {
   133  		return err
   134  	}
   135  	var res []error
   136  	if err := r.SetBodyParam(o.Body); err != nil {
   137  		return err
   138  	}
   139  
   140  	if len(res) > 0 {
   141  		return errors.CompositeValidationError(res...)
   142  	}
   143  	return nil
   144  }