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