github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/examples/task-tracker/client/tasks/get_task_details_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package tasks
     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  // NewGetTaskDetailsParams creates a new GetTaskDetailsParams 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 NewGetTaskDetailsParams() *GetTaskDetailsParams {
    27  	return &GetTaskDetailsParams{
    28  		timeout: cr.DefaultTimeout,
    29  	}
    30  }
    31  
    32  // NewGetTaskDetailsParamsWithTimeout creates a new GetTaskDetailsParams object
    33  // with the ability to set a timeout on a request.
    34  func NewGetTaskDetailsParamsWithTimeout(timeout time.Duration) *GetTaskDetailsParams {
    35  	return &GetTaskDetailsParams{
    36  		timeout: timeout,
    37  	}
    38  }
    39  
    40  // NewGetTaskDetailsParamsWithContext creates a new GetTaskDetailsParams object
    41  // with the ability to set a context for a request.
    42  func NewGetTaskDetailsParamsWithContext(ctx context.Context) *GetTaskDetailsParams {
    43  	return &GetTaskDetailsParams{
    44  		Context: ctx,
    45  	}
    46  }
    47  
    48  // NewGetTaskDetailsParamsWithHTTPClient creates a new GetTaskDetailsParams object
    49  // with the ability to set a custom HTTPClient for a request.
    50  func NewGetTaskDetailsParamsWithHTTPClient(client *http.Client) *GetTaskDetailsParams {
    51  	return &GetTaskDetailsParams{
    52  		HTTPClient: client,
    53  	}
    54  }
    55  
    56  /*
    57  GetTaskDetailsParams contains all the parameters to send to the API endpoint
    58  
    59  	for the get task details operation.
    60  
    61  	Typically these are written to a http.Request.
    62  */
    63  type GetTaskDetailsParams struct {
    64  
    65  	/* ID.
    66  
    67  	   The id of the item
    68  
    69  	   Format: int64
    70  	*/
    71  	ID int64
    72  
    73  	timeout    time.Duration
    74  	Context    context.Context
    75  	HTTPClient *http.Client
    76  }
    77  
    78  // WithDefaults hydrates default values in the get task details params (not the query body).
    79  //
    80  // All values with no default are reset to their zero value.
    81  func (o *GetTaskDetailsParams) WithDefaults() *GetTaskDetailsParams {
    82  	o.SetDefaults()
    83  	return o
    84  }
    85  
    86  // SetDefaults hydrates default values in the get task details params (not the query body).
    87  //
    88  // All values with no default are reset to their zero value.
    89  func (o *GetTaskDetailsParams) SetDefaults() {
    90  	// no default values defined for this parameter
    91  }
    92  
    93  // WithTimeout adds the timeout to the get task details params
    94  func (o *GetTaskDetailsParams) WithTimeout(timeout time.Duration) *GetTaskDetailsParams {
    95  	o.SetTimeout(timeout)
    96  	return o
    97  }
    98  
    99  // SetTimeout adds the timeout to the get task details params
   100  func (o *GetTaskDetailsParams) SetTimeout(timeout time.Duration) {
   101  	o.timeout = timeout
   102  }
   103  
   104  // WithContext adds the context to the get task details params
   105  func (o *GetTaskDetailsParams) WithContext(ctx context.Context) *GetTaskDetailsParams {
   106  	o.SetContext(ctx)
   107  	return o
   108  }
   109  
   110  // SetContext adds the context to the get task details params
   111  func (o *GetTaskDetailsParams) SetContext(ctx context.Context) {
   112  	o.Context = ctx
   113  }
   114  
   115  // WithHTTPClient adds the HTTPClient to the get task details params
   116  func (o *GetTaskDetailsParams) WithHTTPClient(client *http.Client) *GetTaskDetailsParams {
   117  	o.SetHTTPClient(client)
   118  	return o
   119  }
   120  
   121  // SetHTTPClient adds the HTTPClient to the get task details params
   122  func (o *GetTaskDetailsParams) SetHTTPClient(client *http.Client) {
   123  	o.HTTPClient = client
   124  }
   125  
   126  // WithID adds the id to the get task details params
   127  func (o *GetTaskDetailsParams) WithID(id int64) *GetTaskDetailsParams {
   128  	o.SetID(id)
   129  	return o
   130  }
   131  
   132  // SetID adds the id to the get task details params
   133  func (o *GetTaskDetailsParams) SetID(id int64) {
   134  	o.ID = id
   135  }
   136  
   137  // WriteToRequest writes these params to a swagger request
   138  func (o *GetTaskDetailsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   139  
   140  	if err := r.SetTimeout(o.timeout); err != nil {
   141  		return err
   142  	}
   143  	var res []error
   144  
   145  	// path param id
   146  	if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
   147  		return err
   148  	}
   149  
   150  	if len(res) > 0 {
   151  		return errors.CompositeValidationError(res...)
   152  	}
   153  	return nil
   154  }