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