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