github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/get_mta_operation_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  // NewGetMtaOperationParams creates a new GetMtaOperationParams object
    22  // with the default values initialized.
    23  func NewGetMtaOperationParams() *GetMtaOperationParams {
    24  	var ()
    25  	return &GetMtaOperationParams{
    26  
    27  		timeout: cr.DefaultTimeout,
    28  	}
    29  }
    30  
    31  // NewGetMtaOperationParamsWithTimeout creates a new GetMtaOperationParams object
    32  // with the default values initialized, and the ability to set a timeout on a request
    33  func NewGetMtaOperationParamsWithTimeout(timeout time.Duration) *GetMtaOperationParams {
    34  	var ()
    35  	return &GetMtaOperationParams{
    36  
    37  		timeout: timeout,
    38  	}
    39  }
    40  
    41  // NewGetMtaOperationParamsWithContext creates a new GetMtaOperationParams object
    42  // with the default values initialized, and the ability to set a context for a request
    43  func NewGetMtaOperationParamsWithContext(ctx context.Context) *GetMtaOperationParams {
    44  	var ()
    45  	return &GetMtaOperationParams{
    46  
    47  		Context: ctx,
    48  	}
    49  }
    50  
    51  // NewGetMtaOperationParamsWithHTTPClient creates a new GetMtaOperationParams object
    52  // with the default values initialized, and the ability to set a custom HTTPClient for a request
    53  func NewGetMtaOperationParamsWithHTTPClient(client *http.Client) *GetMtaOperationParams {
    54  	var ()
    55  	return &GetMtaOperationParams{
    56  		HTTPClient: client,
    57  	}
    58  }
    59  
    60  /*GetMtaOperationParams contains all the parameters to send to the API endpoint
    61  for the get mta operation operation typically these are written to a http.Request
    62  */
    63  type GetMtaOperationParams struct {
    64  
    65  	/*Embed
    66  	  Adds the specified property in the response body
    67  
    68  
    69  	*/
    70  	Embed *string
    71  	/*OperationID*/
    72  	OperationID string
    73  
    74  	timeout    time.Duration
    75  	Context    context.Context
    76  	HTTPClient *http.Client
    77  }
    78  
    79  // WithTimeout adds the timeout to the get mta operation params
    80  func (o *GetMtaOperationParams) WithTimeout(timeout time.Duration) *GetMtaOperationParams {
    81  	o.SetTimeout(timeout)
    82  	return o
    83  }
    84  
    85  // SetTimeout adds the timeout to the get mta operation params
    86  func (o *GetMtaOperationParams) SetTimeout(timeout time.Duration) {
    87  	o.timeout = timeout
    88  }
    89  
    90  // WithContext adds the context to the get mta operation params
    91  func (o *GetMtaOperationParams) WithContext(ctx context.Context) *GetMtaOperationParams {
    92  	o.SetContext(ctx)
    93  	return o
    94  }
    95  
    96  // SetContext adds the context to the get mta operation params
    97  func (o *GetMtaOperationParams) SetContext(ctx context.Context) {
    98  	o.Context = ctx
    99  }
   100  
   101  // WithHTTPClient adds the HTTPClient to the get mta operation params
   102  func (o *GetMtaOperationParams) WithHTTPClient(client *http.Client) *GetMtaOperationParams {
   103  	o.SetHTTPClient(client)
   104  	return o
   105  }
   106  
   107  // SetHTTPClient adds the HTTPClient to the get mta operation params
   108  func (o *GetMtaOperationParams) SetHTTPClient(client *http.Client) {
   109  	o.HTTPClient = client
   110  }
   111  
   112  // WithEmbed adds the embed to the get mta operation params
   113  func (o *GetMtaOperationParams) WithEmbed(embed *string) *GetMtaOperationParams {
   114  	o.SetEmbed(embed)
   115  	return o
   116  }
   117  
   118  // SetEmbed adds the embed to the get mta operation params
   119  func (o *GetMtaOperationParams) SetEmbed(embed *string) {
   120  	o.Embed = embed
   121  }
   122  
   123  // WithOperationID adds the operationID to the get mta operation params
   124  func (o *GetMtaOperationParams) WithOperationID(operationID string) *GetMtaOperationParams {
   125  	o.SetOperationID(operationID)
   126  	return o
   127  }
   128  
   129  // SetOperationID adds the operationId to the get mta operation params
   130  func (o *GetMtaOperationParams) SetOperationID(operationID string) {
   131  	o.OperationID = operationID
   132  }
   133  
   134  // WriteToRequest writes these params to a swagger request
   135  func (o *GetMtaOperationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   136  
   137  	if err := r.SetTimeout(o.timeout); err != nil {
   138  		return err
   139  	}
   140  	var res []error
   141  
   142  	if o.Embed != nil {
   143  
   144  		// query param embed
   145  		var qrEmbed string
   146  		if o.Embed != nil {
   147  			qrEmbed = *o.Embed
   148  		}
   149  		qEmbed := qrEmbed
   150  		if qEmbed != "" {
   151  			if err := r.SetQueryParam("embed", qEmbed); err != nil {
   152  				return err
   153  			}
   154  		}
   155  
   156  	}
   157  
   158  	// path param operationId
   159  	if err := r.SetPathParam("operationId", o.OperationID); err != nil {
   160  		return err
   161  	}
   162  
   163  	if len(res) > 0 {
   164  		return errors.CompositeValidationError(res...)
   165  	}
   166  	return nil
   167  }