github.com/aeternity/aepp-sdk-go/v4@v4.0.1/swagguard/node/client/external/get_contract_store_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  // NewGetContractStoreParams creates a new GetContractStoreParams object
    21  // with the default values initialized.
    22  func NewGetContractStoreParams() *GetContractStoreParams {
    23  	var ()
    24  	return &GetContractStoreParams{
    25  
    26  		timeout: cr.DefaultTimeout,
    27  	}
    28  }
    29  
    30  // NewGetContractStoreParamsWithTimeout creates a new GetContractStoreParams object
    31  // with the default values initialized, and the ability to set a timeout on a request
    32  func NewGetContractStoreParamsWithTimeout(timeout time.Duration) *GetContractStoreParams {
    33  	var ()
    34  	return &GetContractStoreParams{
    35  
    36  		timeout: timeout,
    37  	}
    38  }
    39  
    40  // NewGetContractStoreParamsWithContext creates a new GetContractStoreParams object
    41  // with the default values initialized, and the ability to set a context for a request
    42  func NewGetContractStoreParamsWithContext(ctx context.Context) *GetContractStoreParams {
    43  	var ()
    44  	return &GetContractStoreParams{
    45  
    46  		Context: ctx,
    47  	}
    48  }
    49  
    50  // NewGetContractStoreParamsWithHTTPClient creates a new GetContractStoreParams object
    51  // with the default values initialized, and the ability to set a custom HTTPClient for a request
    52  func NewGetContractStoreParamsWithHTTPClient(client *http.Client) *GetContractStoreParams {
    53  	var ()
    54  	return &GetContractStoreParams{
    55  		HTTPClient: client,
    56  	}
    57  }
    58  
    59  /*GetContractStoreParams contains all the parameters to send to the API endpoint
    60  for the get contract store operation typically these are written to a http.Request
    61  */
    62  type GetContractStoreParams struct {
    63  
    64  	/*Pubkey
    65  	  The pubkey of the contract
    66  
    67  	*/
    68  	Pubkey string
    69  
    70  	timeout    time.Duration
    71  	Context    context.Context
    72  	HTTPClient *http.Client
    73  }
    74  
    75  // WithTimeout adds the timeout to the get contract store params
    76  func (o *GetContractStoreParams) WithTimeout(timeout time.Duration) *GetContractStoreParams {
    77  	o.SetTimeout(timeout)
    78  	return o
    79  }
    80  
    81  // SetTimeout adds the timeout to the get contract store params
    82  func (o *GetContractStoreParams) SetTimeout(timeout time.Duration) {
    83  	o.timeout = timeout
    84  }
    85  
    86  // WithContext adds the context to the get contract store params
    87  func (o *GetContractStoreParams) WithContext(ctx context.Context) *GetContractStoreParams {
    88  	o.SetContext(ctx)
    89  	return o
    90  }
    91  
    92  // SetContext adds the context to the get contract store params
    93  func (o *GetContractStoreParams) SetContext(ctx context.Context) {
    94  	o.Context = ctx
    95  }
    96  
    97  // WithHTTPClient adds the HTTPClient to the get contract store params
    98  func (o *GetContractStoreParams) WithHTTPClient(client *http.Client) *GetContractStoreParams {
    99  	o.SetHTTPClient(client)
   100  	return o
   101  }
   102  
   103  // SetHTTPClient adds the HTTPClient to the get contract store params
   104  func (o *GetContractStoreParams) SetHTTPClient(client *http.Client) {
   105  	o.HTTPClient = client
   106  }
   107  
   108  // WithPubkey adds the pubkey to the get contract store params
   109  func (o *GetContractStoreParams) WithPubkey(pubkey string) *GetContractStoreParams {
   110  	o.SetPubkey(pubkey)
   111  	return o
   112  }
   113  
   114  // SetPubkey adds the pubkey to the get contract store params
   115  func (o *GetContractStoreParams) SetPubkey(pubkey string) {
   116  	o.Pubkey = pubkey
   117  }
   118  
   119  // WriteToRequest writes these params to a swagger request
   120  func (o *GetContractStoreParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   121  
   122  	if err := r.SetTimeout(o.timeout); err != nil {
   123  		return err
   124  	}
   125  	var res []error
   126  
   127  	// path param pubkey
   128  	if err := r.SetPathParam("pubkey", o.Pubkey); err != nil {
   129  		return err
   130  	}
   131  
   132  	if len(res) > 0 {
   133  		return errors.CompositeValidationError(res...)
   134  	}
   135  	return nil
   136  }