github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/preheat/get_preheat_log_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  // NewGetPreheatLogParams creates a new GetPreheatLogParams 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 NewGetPreheatLogParams() *GetPreheatLogParams {
    27  	return &GetPreheatLogParams{
    28  		timeout: cr.DefaultTimeout,
    29  	}
    30  }
    31  
    32  // NewGetPreheatLogParamsWithTimeout creates a new GetPreheatLogParams object
    33  // with the ability to set a timeout on a request.
    34  func NewGetPreheatLogParamsWithTimeout(timeout time.Duration) *GetPreheatLogParams {
    35  	return &GetPreheatLogParams{
    36  		timeout: timeout,
    37  	}
    38  }
    39  
    40  // NewGetPreheatLogParamsWithContext creates a new GetPreheatLogParams object
    41  // with the ability to set a context for a request.
    42  func NewGetPreheatLogParamsWithContext(ctx context.Context) *GetPreheatLogParams {
    43  	return &GetPreheatLogParams{
    44  		Context: ctx,
    45  	}
    46  }
    47  
    48  // NewGetPreheatLogParamsWithHTTPClient creates a new GetPreheatLogParams object
    49  // with the ability to set a custom HTTPClient for a request.
    50  func NewGetPreheatLogParamsWithHTTPClient(client *http.Client) *GetPreheatLogParams {
    51  	return &GetPreheatLogParams{
    52  		HTTPClient: client,
    53  	}
    54  }
    55  
    56  /*
    57  GetPreheatLogParams contains all the parameters to send to the API endpoint
    58  
    59  	for the get preheat log operation.
    60  
    61  	Typically these are written to a http.Request.
    62  */
    63  type GetPreheatLogParams 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  	/* TaskID.
    90  
    91  	   Task ID
    92  	*/
    93  	TaskID int64
    94  
    95  	timeout    time.Duration
    96  	Context    context.Context
    97  	HTTPClient *http.Client
    98  }
    99  
   100  // WithDefaults hydrates default values in the get preheat log params (not the query body).
   101  //
   102  // All values with no default are reset to their zero value.
   103  func (o *GetPreheatLogParams) WithDefaults() *GetPreheatLogParams {
   104  	o.SetDefaults()
   105  	return o
   106  }
   107  
   108  // SetDefaults hydrates default values in the get preheat log params (not the query body).
   109  //
   110  // All values with no default are reset to their zero value.
   111  func (o *GetPreheatLogParams) SetDefaults() {
   112  	// no default values defined for this parameter
   113  }
   114  
   115  // WithTimeout adds the timeout to the get preheat log params
   116  func (o *GetPreheatLogParams) WithTimeout(timeout time.Duration) *GetPreheatLogParams {
   117  	o.SetTimeout(timeout)
   118  	return o
   119  }
   120  
   121  // SetTimeout adds the timeout to the get preheat log params
   122  func (o *GetPreheatLogParams) SetTimeout(timeout time.Duration) {
   123  	o.timeout = timeout
   124  }
   125  
   126  // WithContext adds the context to the get preheat log params
   127  func (o *GetPreheatLogParams) WithContext(ctx context.Context) *GetPreheatLogParams {
   128  	o.SetContext(ctx)
   129  	return o
   130  }
   131  
   132  // SetContext adds the context to the get preheat log params
   133  func (o *GetPreheatLogParams) SetContext(ctx context.Context) {
   134  	o.Context = ctx
   135  }
   136  
   137  // WithHTTPClient adds the HTTPClient to the get preheat log params
   138  func (o *GetPreheatLogParams) WithHTTPClient(client *http.Client) *GetPreheatLogParams {
   139  	o.SetHTTPClient(client)
   140  	return o
   141  }
   142  
   143  // SetHTTPClient adds the HTTPClient to the get preheat log params
   144  func (o *GetPreheatLogParams) SetHTTPClient(client *http.Client) {
   145  	o.HTTPClient = client
   146  }
   147  
   148  // WithXRequestID adds the xRequestID to the get preheat log params
   149  func (o *GetPreheatLogParams) WithXRequestID(xRequestID *string) *GetPreheatLogParams {
   150  	o.SetXRequestID(xRequestID)
   151  	return o
   152  }
   153  
   154  // SetXRequestID adds the xRequestId to the get preheat log params
   155  func (o *GetPreheatLogParams) SetXRequestID(xRequestID *string) {
   156  	o.XRequestID = xRequestID
   157  }
   158  
   159  // WithExecutionID adds the executionID to the get preheat log params
   160  func (o *GetPreheatLogParams) WithExecutionID(executionID int64) *GetPreheatLogParams {
   161  	o.SetExecutionID(executionID)
   162  	return o
   163  }
   164  
   165  // SetExecutionID adds the executionId to the get preheat log params
   166  func (o *GetPreheatLogParams) SetExecutionID(executionID int64) {
   167  	o.ExecutionID = executionID
   168  }
   169  
   170  // WithPreheatPolicyName adds the preheatPolicyName to the get preheat log params
   171  func (o *GetPreheatLogParams) WithPreheatPolicyName(preheatPolicyName string) *GetPreheatLogParams {
   172  	o.SetPreheatPolicyName(preheatPolicyName)
   173  	return o
   174  }
   175  
   176  // SetPreheatPolicyName adds the preheatPolicyName to the get preheat log params
   177  func (o *GetPreheatLogParams) SetPreheatPolicyName(preheatPolicyName string) {
   178  	o.PreheatPolicyName = preheatPolicyName
   179  }
   180  
   181  // WithProjectName adds the projectName to the get preheat log params
   182  func (o *GetPreheatLogParams) WithProjectName(projectName string) *GetPreheatLogParams {
   183  	o.SetProjectName(projectName)
   184  	return o
   185  }
   186  
   187  // SetProjectName adds the projectName to the get preheat log params
   188  func (o *GetPreheatLogParams) SetProjectName(projectName string) {
   189  	o.ProjectName = projectName
   190  }
   191  
   192  // WithTaskID adds the taskID to the get preheat log params
   193  func (o *GetPreheatLogParams) WithTaskID(taskID int64) *GetPreheatLogParams {
   194  	o.SetTaskID(taskID)
   195  	return o
   196  }
   197  
   198  // SetTaskID adds the taskId to the get preheat log params
   199  func (o *GetPreheatLogParams) SetTaskID(taskID int64) {
   200  	o.TaskID = taskID
   201  }
   202  
   203  // WriteToRequest writes these params to a swagger request
   204  func (o *GetPreheatLogParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   205  
   206  	if err := r.SetTimeout(o.timeout); err != nil {
   207  		return err
   208  	}
   209  	var res []error
   210  
   211  	if o.XRequestID != nil {
   212  
   213  		// header param X-Request-Id
   214  		if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); err != nil {
   215  			return err
   216  		}
   217  	}
   218  
   219  	// path param execution_id
   220  	if err := r.SetPathParam("execution_id", swag.FormatInt64(o.ExecutionID)); err != nil {
   221  		return err
   222  	}
   223  
   224  	// path param preheat_policy_name
   225  	if err := r.SetPathParam("preheat_policy_name", o.PreheatPolicyName); err != nil {
   226  		return err
   227  	}
   228  
   229  	// path param project_name
   230  	if err := r.SetPathParam("project_name", o.ProjectName); err != nil {
   231  		return err
   232  	}
   233  
   234  	// path param task_id
   235  	if err := r.SetPathParam("task_id", swag.FormatInt64(o.TaskID)); err != nil {
   236  		return err
   237  	}
   238  
   239  	if len(res) > 0 {
   240  		return errors.CompositeValidationError(res...)
   241  	}
   242  	return nil
   243  }