github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/preheat/get_execution_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package preheat
     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  	"github.com/go-openapi/swag"
    18  )
    19  
    20  // NewGetExecutionParams creates a new GetExecutionParams object,
    21  // with the default timeout for this client.
    22  //
    23  // Default values are not hydrated, since defaults are normally applied by the API server side.
    24  //
    25  // To enforce default values in parameter, use SetDefaults or WithDefaults.
    26  func NewGetExecutionParams() *GetExecutionParams {
    27  	return &GetExecutionParams{
    28  		timeout: cr.DefaultTimeout,
    29  	}
    30  }
    31  
    32  // NewGetExecutionParamsWithTimeout creates a new GetExecutionParams object
    33  // with the ability to set a timeout on a request.
    34  func NewGetExecutionParamsWithTimeout(timeout time.Duration) *GetExecutionParams {
    35  	return &GetExecutionParams{
    36  		timeout: timeout,
    37  	}
    38  }
    39  
    40  // NewGetExecutionParamsWithContext creates a new GetExecutionParams object
    41  // with the ability to set a context for a request.
    42  func NewGetExecutionParamsWithContext(ctx context.Context) *GetExecutionParams {
    43  	return &GetExecutionParams{
    44  		Context: ctx,
    45  	}
    46  }
    47  
    48  // NewGetExecutionParamsWithHTTPClient creates a new GetExecutionParams object
    49  // with the ability to set a custom HTTPClient for a request.
    50  func NewGetExecutionParamsWithHTTPClient(client *http.Client) *GetExecutionParams {
    51  	return &GetExecutionParams{
    52  		HTTPClient: client,
    53  	}
    54  }
    55  
    56  /*
    57  GetExecutionParams contains all the parameters to send to the API endpoint
    58  
    59  	for the get execution operation.
    60  
    61  	Typically these are written to a http.Request.
    62  */
    63  type GetExecutionParams struct {
    64  
    65  	/* XRequestID.
    66  
    67  	   An unique ID for the request
    68  	*/
    69  	XRequestID *string
    70  
    71  	/* ExecutionID.
    72  
    73  	   Execution ID
    74  	*/
    75  	ExecutionID int64
    76  
    77  	/* PreheatPolicyName.
    78  
    79  	   Preheat Policy Name
    80  	*/
    81  	PreheatPolicyName string
    82  
    83  	/* ProjectName.
    84  
    85  	   The name of the project
    86  	*/
    87  	ProjectName string
    88  
    89  	timeout    time.Duration
    90  	Context    context.Context
    91  	HTTPClient *http.Client
    92  }
    93  
    94  // WithDefaults hydrates default values in the get execution params (not the query body).
    95  //
    96  // All values with no default are reset to their zero value.
    97  func (o *GetExecutionParams) WithDefaults() *GetExecutionParams {
    98  	o.SetDefaults()
    99  	return o
   100  }
   101  
   102  // SetDefaults hydrates default values in the get execution params (not the query body).
   103  //
   104  // All values with no default are reset to their zero value.
   105  func (o *GetExecutionParams) SetDefaults() {
   106  	// no default values defined for this parameter
   107  }
   108  
   109  // WithTimeout adds the timeout to the get execution params
   110  func (o *GetExecutionParams) WithTimeout(timeout time.Duration) *GetExecutionParams {
   111  	o.SetTimeout(timeout)
   112  	return o
   113  }
   114  
   115  // SetTimeout adds the timeout to the get execution params
   116  func (o *GetExecutionParams) SetTimeout(timeout time.Duration) {
   117  	o.timeout = timeout
   118  }
   119  
   120  // WithContext adds the context to the get execution params
   121  func (o *GetExecutionParams) WithContext(ctx context.Context) *GetExecutionParams {
   122  	o.SetContext(ctx)
   123  	return o
   124  }
   125  
   126  // SetContext adds the context to the get execution params
   127  func (o *GetExecutionParams) SetContext(ctx context.Context) {
   128  	o.Context = ctx
   129  }
   130  
   131  // WithHTTPClient adds the HTTPClient to the get execution params
   132  func (o *GetExecutionParams) WithHTTPClient(client *http.Client) *GetExecutionParams {
   133  	o.SetHTTPClient(client)
   134  	return o
   135  }
   136  
   137  // SetHTTPClient adds the HTTPClient to the get execution params
   138  func (o *GetExecutionParams) SetHTTPClient(client *http.Client) {
   139  	o.HTTPClient = client
   140  }
   141  
   142  // WithXRequestID adds the xRequestID to the get execution params
   143  func (o *GetExecutionParams) WithXRequestID(xRequestID *string) *GetExecutionParams {
   144  	o.SetXRequestID(xRequestID)
   145  	return o
   146  }
   147  
   148  // SetXRequestID adds the xRequestId to the get execution params
   149  func (o *GetExecutionParams) SetXRequestID(xRequestID *string) {
   150  	o.XRequestID = xRequestID
   151  }
   152  
   153  // WithExecutionID adds the executionID to the get execution params
   154  func (o *GetExecutionParams) WithExecutionID(executionID int64) *GetExecutionParams {
   155  	o.SetExecutionID(executionID)
   156  	return o
   157  }
   158  
   159  // SetExecutionID adds the executionId to the get execution params
   160  func (o *GetExecutionParams) SetExecutionID(executionID int64) {
   161  	o.ExecutionID = executionID
   162  }
   163  
   164  // WithPreheatPolicyName adds the preheatPolicyName to the get execution params
   165  func (o *GetExecutionParams) WithPreheatPolicyName(preheatPolicyName string) *GetExecutionParams {
   166  	o.SetPreheatPolicyName(preheatPolicyName)
   167  	return o
   168  }
   169  
   170  // SetPreheatPolicyName adds the preheatPolicyName to the get execution params
   171  func (o *GetExecutionParams) SetPreheatPolicyName(preheatPolicyName string) {
   172  	o.PreheatPolicyName = preheatPolicyName
   173  }
   174  
   175  // WithProjectName adds the projectName to the get execution params
   176  func (o *GetExecutionParams) WithProjectName(projectName string) *GetExecutionParams {
   177  	o.SetProjectName(projectName)
   178  	return o
   179  }
   180  
   181  // SetProjectName adds the projectName to the get execution params
   182  func (o *GetExecutionParams) SetProjectName(projectName string) {
   183  	o.ProjectName = projectName
   184  }
   185  
   186  // WriteToRequest writes these params to a swagger request
   187  func (o *GetExecutionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   188  
   189  	if err := r.SetTimeout(o.timeout); err != nil {
   190  		return err
   191  	}
   192  	var res []error
   193  
   194  	if o.XRequestID != nil {
   195  
   196  		// header param X-Request-Id
   197  		if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil {
   198  			return err
   199  		}
   200  	}
   201  
   202  	// path param execution_id
   203  	if err := r.SetPathParam("execution_id", swag.FormatInt64(o.ExecutionID)); err != nil {
   204  		return err
   205  	}
   206  
   207  	// path param preheat_policy_name
   208  	if err := r.SetPathParam("preheat_policy_name", o.PreheatPolicyName); err != nil {
   209  		return err
   210  	}
   211  
   212  	// path param project_name
   213  	if err := r.SetPathParam("project_name", o.ProjectName); err != nil {
   214  		return err
   215  	}
   216  
   217  	if len(res) > 0 {
   218  		return errors.CompositeValidationError(res...)
   219  	}
   220  	return nil
   221  }