github.com/circl-dev/go-swagger@v0.31.0/examples/contributed-templates/stratoscale/client/store/order_delete_parameters.go (about)

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