github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/get_mta_files_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  	"net/http"
    10  	"time"
    11  
    12  	"golang.org/x/net/context"
    13  
    14  	"github.com/go-openapi/errors"
    15  	"github.com/go-openapi/runtime"
    16  	cr "github.com/go-openapi/runtime/client"
    17  
    18  	strfmt "github.com/go-openapi/strfmt"
    19  )
    20  
    21  // NewGetMtaFilesParams creates a new GetMtaFilesParams object
    22  // with the default values initialized.
    23  func NewGetMtaFilesParams() *GetMtaFilesParams {
    24  
    25  	return &GetMtaFilesParams{
    26  
    27  		timeout: cr.DefaultTimeout,
    28  	}
    29  }
    30  
    31  // NewGetMtaFilesParamsWithTimeout creates a new GetMtaFilesParams object
    32  // with the default values initialized, and the ability to set a timeout on a request
    33  func NewGetMtaFilesParamsWithTimeout(timeout time.Duration) *GetMtaFilesParams {
    34  
    35  	return &GetMtaFilesParams{
    36  
    37  		timeout: timeout,
    38  	}
    39  }
    40  
    41  // NewGetMtaFilesParamsWithContext creates a new GetMtaFilesParams object
    42  // with the default values initialized, and the ability to set a context for a request
    43  func NewGetMtaFilesParamsWithContext(ctx context.Context) *GetMtaFilesParams {
    44  
    45  	return &GetMtaFilesParams{
    46  
    47  		Context: ctx,
    48  	}
    49  }
    50  
    51  // NewGetMtaFilesParamsWithHTTPClient creates a new GetMtaFilesParams object
    52  // with the default values initialized, and the ability to set a custom HTTPClient for a request
    53  func NewGetMtaFilesParamsWithHTTPClient(client *http.Client) *GetMtaFilesParams {
    54  
    55  	return &GetMtaFilesParams{
    56  		HTTPClient: client,
    57  	}
    58  }
    59  
    60  /*GetMtaFilesParams contains all the parameters to send to the API endpoint
    61  for the get mta files operation typically these are written to a http.Request
    62  */
    63  type GetMtaFilesParams struct {
    64  	/*Namespace
    65  	  Filter mtas by namespace
    66  
    67  	*/
    68  	Namespace *string
    69  	timeout    time.Duration
    70  	Context    context.Context
    71  	HTTPClient *http.Client
    72  }
    73  
    74  // WithTimeout adds the timeout to the get mta files params
    75  func (o *GetMtaFilesParams) WithTimeout(timeout time.Duration) *GetMtaFilesParams {
    76  	o.SetTimeout(timeout)
    77  	return o
    78  }
    79  
    80  // SetTimeout adds the timeout to the get mta files params
    81  func (o *GetMtaFilesParams) SetTimeout(timeout time.Duration) {
    82  	o.timeout = timeout
    83  }
    84  
    85  // WithContext adds the context to the get mta files params
    86  func (o *GetMtaFilesParams) WithContext(ctx context.Context) *GetMtaFilesParams {
    87  	o.SetContext(ctx)
    88  	return o
    89  }
    90  
    91  // SetContext adds the context to the get mta files params
    92  func (o *GetMtaFilesParams) SetContext(ctx context.Context) {
    93  	o.Context = ctx
    94  }
    95  
    96  // WithHTTPClient adds the HTTPClient to the get mta files params
    97  func (o *GetMtaFilesParams) WithHTTPClient(client *http.Client) *GetMtaFilesParams {
    98  	o.SetHTTPClient(client)
    99  	return o
   100  }
   101  
   102  // SetHTTPClient adds the HTTPClient to the get mta files params
   103  func (o *GetMtaFilesParams) SetHTTPClient(client *http.Client) {
   104  	o.HTTPClient = client
   105  }
   106  
   107  // WithNamespace adds the namespace to the get mta files params
   108  func (o *GetMtaFilesParams) WithNamespace(namespace *string) *GetMtaFilesParams {
   109  	o.SetNamespace(namespace)
   110  	return o
   111  }
   112  
   113  // SetNamespace adds the namespace to the get mta files params
   114  func (o *GetMtaFilesParams) SetNamespace(namespace *string) {
   115  	o.Namespace = namespace
   116  }
   117  
   118  // WriteToRequest writes these params to a swagger request
   119  func (o *GetMtaFilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   120  
   121  	if err := r.SetTimeout(o.timeout); err != nil {
   122  		return err
   123  	}
   124  	var res []error
   125  	
   126  	if o.Namespace != nil {
   127  
   128  		// query param namespace
   129  		var qrNamespace string
   130  		if o.Namespace != nil {
   131  			qrNamespace = *o.Namespace
   132  		}
   133  		qNamespace := qrNamespace
   134  		if qNamespace != "" {
   135  			if err := r.SetQueryParam("namespace", qNamespace); err != nil {
   136  				return err
   137  			}
   138  		}
   139  
   140  	}
   141  
   142  	if len(res) > 0 {
   143  		return errors.CompositeValidationError(res...)
   144  	}
   145  	return nil
   146  }