Class: Intrinio::OptionsApi
- Inherits:
-
Object
- Object
- Intrinio::OptionsApi
- Defined in:
- lib/intrinio-sdk/api/options_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_options(symbol, opts = {}) ⇒ ApiResponseOptions
Options Returns the master list of option contracts for a given symbol.
-
#get_options_chain(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChain
Options Chain Returns all options contracts and their prices for the given symbol and expiration date.
-
#get_options_chain_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChain, Fixnum, Hash)>
Options Chain Returns all options contracts and their prices for the given symbol and expiration date.
-
#get_options_expirations(symbol, opts = {}) ⇒ ApiResponseOptionsExpirations
Options Expirations Returns all option contract expiration dates for a given symbol.
-
#get_options_expirations_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsExpirations, Fixnum, Hash)>
Options Expirations Returns all option contract expiration dates for a given symbol.
-
#get_options_prices(identifier, opts = {}) ⇒ ApiResponseOptionPrices
Option Prices Returns all option prices for a given option contract identifier.
-
#get_options_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionPrices, Fixnum, Hash)>
Option Prices Returns all option prices for a given option contract identifier.
-
#get_options_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptions, Fixnum, Hash)>
Options Returns the master list of option contracts for a given symbol.
-
#initialize(api_client = ApiClient.default) ⇒ OptionsApi
constructor
A new instance of OptionsApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ OptionsApi
Returns a new instance of OptionsApi.
19 20 21 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_options(symbol, opts = {}) ⇒ ApiResponseOptions
Options Returns the master list of option contracts for a given symbol.
37 38 39 40 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 37 def (symbol, opts = {}) data, _status_code, _headers = (symbol, opts) return data end |
#get_options_chain(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChain
Options Chain Returns all options contracts and their prices for the given symbol and expiration date.
123 124 125 126 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 123 def (symbol, expiration, opts = {}) data, _status_code, _headers = (symbol, expiration, opts) return data end |
#get_options_chain_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChain, Fixnum, Hash)>
Options Chain Returns all options contracts and their prices for the given symbol and expiration date.
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 141 def (symbol, expiration, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OptionsApi.get_options_chain ..." end # verify the required parameter 'symbol' is set if @api_client.config.client_side_validation && symbol.nil? fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_chain" end # verify the required parameter 'expiration' is set if @api_client.config.client_side_validation && expiration.nil? fail ArgumentError, "Missing the required parameter 'expiration' when calling OptionsApi.get_options_chain" end if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type']) fail ArgumentError, 'invalid value for "type", must be one of call, put' end if @api_client.config.client_side_validation && opts[:'moneyness'] && !['all', 'in_the_money', 'out_of_the_money', 'near_the_money'].include?(opts[:'moneyness']) fail ArgumentError, 'invalid value for "moneyness", must be one of all, in_the_money, out_of_the_money, near_the_money' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_chain, must be smaller than or equal to 10000.' end # resource path local_var_path = "/options/chain/{symbol}/{expiration}".sub('{' + 'symbol' + '}', symbol.to_s).sub('{' + 'expiration' + '}', expiration.to_s) # query parameters query_params = {} query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil? query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil? query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil? query_params[:'moneyness'] = opts[:'moneyness'] if !opts[:'moneyness'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApiResponseOptionsChain') if @api_client.config.debugging @api_client.config.logger.debug "API called: OptionsApi#get_options_chain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_options_expirations(symbol, opts = {}) ⇒ ApiResponseOptionsExpirations
Options Expirations Returns all option contract expiration dates for a given symbol.
207 208 209 210 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 207 def (symbol, opts = {}) data, _status_code, _headers = (symbol, opts) return data end |
#get_options_expirations_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsExpirations, Fixnum, Hash)>
Options Expirations Returns all option contract expiration dates for a given symbol.
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 219 def (symbol, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OptionsApi.get_options_expirations ..." end # verify the required parameter 'symbol' is set if @api_client.config.client_side_validation && symbol.nil? fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_expirations" end # resource path local_var_path = "/options/expirations/{symbol}".sub('{' + 'symbol' + '}', symbol.to_s) # query parameters query_params = {} query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApiResponseOptionsExpirations') if @api_client.config.debugging @api_client.config.logger.debug "API called: OptionsApi#get_options_expirations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_options_prices(identifier, opts = {}) ⇒ ApiResponseOptionPrices
Option Prices Returns all option prices for a given option contract identifier.
268 269 270 271 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 268 def (identifier, opts = {}) data, _status_code, _headers = (identifier, opts) return data end |
#get_options_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionPrices, Fixnum, Hash)>
Option Prices Returns all option prices for a given option contract identifier.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 282 def (identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OptionsApi.get_options_prices ..." end # verify the required parameter 'identifier' is set if @api_client.config.client_side_validation && identifier.nil? fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_options_prices" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_prices, must be smaller than or equal to 10000.' end # resource path local_var_path = "/options/prices/{identifier}".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApiResponseOptionPrices') if @api_client.config.debugging @api_client.config.logger.debug "API called: OptionsApi#get_options_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_options_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptions, Fixnum, Hash)>
Options Returns the master list of option contracts for a given symbol.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 56 def (symbol, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: OptionsApi.get_options ..." end # verify the required parameter 'symbol' is set if @api_client.config.client_side_validation && symbol.nil? fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options" end if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type']) fail ArgumentError, 'invalid value for "type", must be one of call, put' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options, must be smaller than or equal to 10000.' end # resource path local_var_path = "/options/{symbol}".sub('{' + 'symbol' + '}', symbol.to_s) # query parameters query_params = {} query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil? query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil? query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil? query_params[:'expiration'] = opts[:'expiration'] if !opts[:'expiration'].nil? query_params[:'expiration_after'] = opts[:'expiration_after'] if !opts[:'expiration_after'].nil? query_params[:'expiration_before'] = opts[:'expiration_before'] if !opts[:'expiration_before'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ApiResponseOptions') if @api_client.config.debugging @api_client.config.logger.debug "API called: OptionsApi#get_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |