github.com/aeternity/aepp-sdk-go@v1.0.3-0.20190606142815-1c0ffdc21fd9/generated/client/external/get_current_key_block_height_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package external
     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  
    17  	strfmt "github.com/go-openapi/strfmt"
    18  )
    19  
    20  // NewGetCurrentKeyBlockHeightParams creates a new GetCurrentKeyBlockHeightParams object
    21  // with the default values initialized.
    22  func NewGetCurrentKeyBlockHeightParams() *GetCurrentKeyBlockHeightParams {
    23  
    24  	return &GetCurrentKeyBlockHeightParams{
    25  
    26  		timeout: cr.DefaultTimeout,
    27  	}
    28  }
    29  
    30  // NewGetCurrentKeyBlockHeightParamsWithTimeout creates a new GetCurrentKeyBlockHeightParams object
    31  // with the default values initialized, and the ability to set a timeout on a request
    32  func NewGetCurrentKeyBlockHeightParamsWithTimeout(timeout time.Duration) *GetCurrentKeyBlockHeightParams {
    33  
    34  	return &GetCurrentKeyBlockHeightParams{
    35  
    36  		timeout: timeout,
    37  	}
    38  }
    39  
    40  // NewGetCurrentKeyBlockHeightParamsWithContext creates a new GetCurrentKeyBlockHeightParams object
    41  // with the default values initialized, and the ability to set a context for a request
    42  func NewGetCurrentKeyBlockHeightParamsWithContext(ctx context.Context) *GetCurrentKeyBlockHeightParams {
    43  
    44  	return &GetCurrentKeyBlockHeightParams{
    45  
    46  		Context: ctx,
    47  	}
    48  }
    49  
    50  // NewGetCurrentKeyBlockHeightParamsWithHTTPClient creates a new GetCurrentKeyBlockHeightParams object
    51  // with the default values initialized, and the ability to set a custom HTTPClient for a request
    52  func NewGetCurrentKeyBlockHeightParamsWithHTTPClient(client *http.Client) *GetCurrentKeyBlockHeightParams {
    53  
    54  	return &GetCurrentKeyBlockHeightParams{
    55  		HTTPClient: client,
    56  	}
    57  }
    58  
    59  /*GetCurrentKeyBlockHeightParams contains all the parameters to send to the API endpoint
    60  for the get current key block height operation typically these are written to a http.Request
    61  */
    62  type GetCurrentKeyBlockHeightParams struct {
    63  	timeout    time.Duration
    64  	Context    context.Context
    65  	HTTPClient *http.Client
    66  }
    67  
    68  // WithTimeout adds the timeout to the get current key block height params
    69  func (o *GetCurrentKeyBlockHeightParams) WithTimeout(timeout time.Duration) *GetCurrentKeyBlockHeightParams {
    70  	o.SetTimeout(timeout)
    71  	return o
    72  }
    73  
    74  // SetTimeout adds the timeout to the get current key block height params
    75  func (o *GetCurrentKeyBlockHeightParams) SetTimeout(timeout time.Duration) {
    76  	o.timeout = timeout
    77  }
    78  
    79  // WithContext adds the context to the get current key block height params
    80  func (o *GetCurrentKeyBlockHeightParams) WithContext(ctx context.Context) *GetCurrentKeyBlockHeightParams {
    81  	o.SetContext(ctx)
    82  	return o
    83  }
    84  
    85  // SetContext adds the context to the get current key block height params
    86  func (o *GetCurrentKeyBlockHeightParams) SetContext(ctx context.Context) {
    87  	o.Context = ctx
    88  }
    89  
    90  // WithHTTPClient adds the HTTPClient to the get current key block height params
    91  func (o *GetCurrentKeyBlockHeightParams) WithHTTPClient(client *http.Client) *GetCurrentKeyBlockHeightParams {
    92  	o.SetHTTPClient(client)
    93  	return o
    94  }
    95  
    96  // SetHTTPClient adds the HTTPClient to the get current key block height params
    97  func (o *GetCurrentKeyBlockHeightParams) SetHTTPClient(client *http.Client) {
    98  	o.HTTPClient = client
    99  }
   100  
   101  // WriteToRequest writes these params to a swagger request
   102  func (o *GetCurrentKeyBlockHeightParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   103  
   104  	if err := r.SetTimeout(o.timeout); err != nil {
   105  		return err
   106  	}
   107  	var res []error
   108  
   109  	if len(res) > 0 {
   110  		return errors.CompositeValidationError(res...)
   111  	}
   112  	return nil
   113  }