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

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package status
     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  // NewGetInfoParams creates a new GetInfoParams 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 NewGetInfoParams() *GetInfoParams {
    26  	return &GetInfoParams{
    27  		timeout: cr.DefaultTimeout,
    28  	}
    29  }
    30  
    31  // NewGetInfoParamsWithTimeout creates a new GetInfoParams object
    32  // with the ability to set a timeout on a request.
    33  func NewGetInfoParamsWithTimeout(timeout time.Duration) *GetInfoParams {
    34  	return &GetInfoParams{
    35  		timeout: timeout,
    36  	}
    37  }
    38  
    39  // NewGetInfoParamsWithContext creates a new GetInfoParams object
    40  // with the ability to set a context for a request.
    41  func NewGetInfoParamsWithContext(ctx context.Context) *GetInfoParams {
    42  	return &GetInfoParams{
    43  		Context: ctx,
    44  	}
    45  }
    46  
    47  // NewGetInfoParamsWithHTTPClient creates a new GetInfoParams object
    48  // with the ability to set a custom HTTPClient for a request.
    49  func NewGetInfoParamsWithHTTPClient(client *http.Client) *GetInfoParams {
    50  	return &GetInfoParams{
    51  		HTTPClient: client,
    52  	}
    53  }
    54  
    55  /* GetInfoParams contains all the parameters to send to the API endpoint
    56     for the get info operation.
    57  
    58     Typically these are written to a http.Request.
    59  */
    60  type GetInfoParams struct {
    61  
    62  	/* Value.
    63  
    64  	   Whatever you like
    65  	*/
    66  	Value *string
    67  
    68  	timeout    time.Duration
    69  	Context    context.Context
    70  	HTTPClient *http.Client
    71  }
    72  
    73  // WithDefaults hydrates default values in the get info params (not the query body).
    74  //
    75  // All values with no default are reset to their zero value.
    76  func (o *GetInfoParams) WithDefaults() *GetInfoParams {
    77  	o.SetDefaults()
    78  	return o
    79  }
    80  
    81  // SetDefaults hydrates default values in the get info params (not the query body).
    82  //
    83  // All values with no default are reset to their zero value.
    84  func (o *GetInfoParams) SetDefaults() {
    85  	// no default values defined for this parameter
    86  }
    87  
    88  // WithTimeout adds the timeout to the get info params
    89  func (o *GetInfoParams) WithTimeout(timeout time.Duration) *GetInfoParams {
    90  	o.SetTimeout(timeout)
    91  	return o
    92  }
    93  
    94  // SetTimeout adds the timeout to the get info params
    95  func (o *GetInfoParams) SetTimeout(timeout time.Duration) {
    96  	o.timeout = timeout
    97  }
    98  
    99  // WithContext adds the context to the get info params
   100  func (o *GetInfoParams) WithContext(ctx context.Context) *GetInfoParams {
   101  	o.SetContext(ctx)
   102  	return o
   103  }
   104  
   105  // SetContext adds the context to the get info params
   106  func (o *GetInfoParams) SetContext(ctx context.Context) {
   107  	o.Context = ctx
   108  }
   109  
   110  // WithHTTPClient adds the HTTPClient to the get info params
   111  func (o *GetInfoParams) WithHTTPClient(client *http.Client) *GetInfoParams {
   112  	o.SetHTTPClient(client)
   113  	return o
   114  }
   115  
   116  // SetHTTPClient adds the HTTPClient to the get info params
   117  func (o *GetInfoParams) SetHTTPClient(client *http.Client) {
   118  	o.HTTPClient = client
   119  }
   120  
   121  // WithValue adds the value to the get info params
   122  func (o *GetInfoParams) WithValue(value *string) *GetInfoParams {
   123  	o.SetValue(value)
   124  	return o
   125  }
   126  
   127  // SetValue adds the value to the get info params
   128  func (o *GetInfoParams) SetValue(value *string) {
   129  	o.Value = value
   130  }
   131  
   132  // WriteToRequest writes these params to a swagger request
   133  func (o *GetInfoParams) 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  	if o.Value != nil {
   141  
   142  		// query param value
   143  		var qrValue string
   144  
   145  		if o.Value != nil {
   146  			qrValue = *o.Value
   147  		}
   148  		qValue := qrValue
   149  		if qValue != "" {
   150  
   151  			if err := r.SetQueryParam("value", qValue); err != nil {
   152  				return err
   153  			}
   154  		}
   155  	}
   156  
   157  	if len(res) > 0 {
   158  		return errors.CompositeValidationError(res...)
   159  	}
   160  	return nil
   161  }