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

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