github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient_v2/operations/get_mtas_v2_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package operations
     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  
    17  	strfmt "github.com/go-openapi/strfmt"
    18  )
    19  
    20  // NewGetMtasV2Params creates a new GetMtasV2Params object
    21  // with the default values initialized.
    22  func NewGetMtasV2Params() *GetMtasV2Params {
    23  	var ()
    24  	return &GetMtasV2Params{
    25  
    26  		timeout: cr.DefaultTimeout,
    27  	}
    28  }
    29  
    30  // NewGetMtasV2ParamsWithTimeout creates a new GetMtasV2Params object
    31  // with the default values initialized, and the ability to set a timeout on a request
    32  func NewGetMtasV2ParamsWithTimeout(timeout time.Duration) *GetMtasV2Params {
    33  	var ()
    34  	return &GetMtasV2Params{
    35  
    36  		timeout: timeout,
    37  	}
    38  }
    39  
    40  // NewGetMtasV2ParamsWithContext creates a new GetMtasV2Params object
    41  // with the default values initialized, and the ability to set a context for a request
    42  func NewGetMtasV2ParamsWithContext(ctx context.Context) *GetMtasV2Params {
    43  	var ()
    44  	return &GetMtasV2Params{
    45  
    46  		Context: ctx,
    47  	}
    48  }
    49  
    50  // NewGetMtasV2ParamsWithHTTPClient creates a new GetMtasV2Params object
    51  // with the default values initialized, and the ability to set a custom HTTPClient for a request
    52  func NewGetMtasV2ParamsWithHTTPClient(client *http.Client) *GetMtasV2Params {
    53  	var ()
    54  	return &GetMtasV2Params{
    55  		HTTPClient: client,
    56  	}
    57  }
    58  
    59  /*GetMtasV2Params contains all the parameters to send to the API endpoint
    60  for the get mtas v2 operation typically these are written to a http.Request
    61  */
    62  type GetMtasV2Params struct {
    63  
    64  	/*Name
    65  	  Filter mtas by name
    66  
    67  	*/
    68  	Name *string
    69  	/*Namespace
    70  	  Filter mtas by namespace
    71  
    72  	*/
    73  	Namespace *string
    74  	/*SpaceGUID
    75  	  GUID of space with mtas
    76  
    77  	*/
    78  	SpaceGUID string
    79  
    80  	timeout    time.Duration
    81  	Context    context.Context
    82  	HTTPClient *http.Client
    83  }
    84  
    85  // WithTimeout adds the timeout to the get mtas v2 params
    86  func (o *GetMtasV2Params) WithTimeout(timeout time.Duration) *GetMtasV2Params {
    87  	o.SetTimeout(timeout)
    88  	return o
    89  }
    90  
    91  // SetTimeout adds the timeout to the get mtas v2 params
    92  func (o *GetMtasV2Params) SetTimeout(timeout time.Duration) {
    93  	o.timeout = timeout
    94  }
    95  
    96  // WithContext adds the context to the get mtas v2 params
    97  func (o *GetMtasV2Params) WithContext(ctx context.Context) *GetMtasV2Params {
    98  	o.SetContext(ctx)
    99  	return o
   100  }
   101  
   102  // SetContext adds the context to the get mtas v2 params
   103  func (o *GetMtasV2Params) SetContext(ctx context.Context) {
   104  	o.Context = ctx
   105  }
   106  
   107  // WithHTTPClient adds the HTTPClient to the get mtas v2 params
   108  func (o *GetMtasV2Params) WithHTTPClient(client *http.Client) *GetMtasV2Params {
   109  	o.SetHTTPClient(client)
   110  	return o
   111  }
   112  
   113  // SetHTTPClient adds the HTTPClient to the get mtas v2 params
   114  func (o *GetMtasV2Params) SetHTTPClient(client *http.Client) {
   115  	o.HTTPClient = client
   116  }
   117  
   118  // WithName adds the name to the get mtas v2 params
   119  func (o *GetMtasV2Params) WithName(name *string) *GetMtasV2Params {
   120  	o.SetName(name)
   121  	return o
   122  }
   123  
   124  // SetName adds the name to the get mtas v2 params
   125  func (o *GetMtasV2Params) SetName(name *string) {
   126  	o.Name = name
   127  }
   128  
   129  // WithNamespace adds the namespace to the get mtas v2 params
   130  func (o *GetMtasV2Params) WithNamespace(namespace *string) *GetMtasV2Params {
   131  	o.SetNamespace(namespace)
   132  	return o
   133  }
   134  
   135  // SetNamespace adds the namespace to the get mtas v2 params
   136  func (o *GetMtasV2Params) SetNamespace(namespace *string) {
   137  	o.Namespace = namespace
   138  }
   139  
   140  // WithSpaceGUID adds the spaceGUID to the get mtas v2 params
   141  func (o *GetMtasV2Params) WithSpaceGUID(spaceGUID string) *GetMtasV2Params {
   142  	o.SetSpaceGUID(spaceGUID)
   143  	return o
   144  }
   145  
   146  // SetSpaceGUID adds the spaceGuid to the get mtas v2 params
   147  func (o *GetMtasV2Params) SetSpaceGUID(spaceGUID string) {
   148  	o.SpaceGUID = spaceGUID
   149  }
   150  
   151  // WriteToRequest writes these params to a swagger request
   152  func (o *GetMtasV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   153  
   154  	if err := r.SetTimeout(o.timeout); err != nil {
   155  		return err
   156  	}
   157  	var res []error
   158  
   159  	if o.Name != nil {
   160  
   161  		// query param name
   162  		var qrName string
   163  		if o.Name != nil {
   164  			qrName = *o.Name
   165  		}
   166  		qName := qrName
   167  		if qName != "" {
   168  			if err := r.SetQueryParam("name", qName); err != nil {
   169  				return err
   170  			}
   171  		}
   172  
   173  	}
   174  
   175  	if o.Namespace != nil {
   176  
   177  		// query param namespace
   178  		var qrNamespace string
   179  		if o.Namespace != nil {
   180  			qrNamespace = *o.Namespace
   181  		}
   182  		qNamespace := qrNamespace
   183  		if err := r.SetQueryParam("namespace", qNamespace); err != nil {
   184  			return err
   185  		}
   186  
   187  	}
   188  
   189  	// path param spaceGuid
   190  	if err := r.SetPathParam("spaceGuid", o.SpaceGUID); err != nil {
   191  		return err
   192  	}
   193  
   194  	if len(res) > 0 {
   195  		return errors.CompositeValidationError(res...)
   196  	}
   197  	return nil
   198  }