Class: Intrinio::DataTagApi

Inherits:
Object
  • Object
show all
Defined in:
lib/intrinio-sdk/api/data_tag_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DataTagApi

Returns a new instance of DataTagApi.



19
20
21
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#filter_data_tags(opts = {}) ⇒ ApiResponseDataTags

Filter Data Tags Returns Data Tags that match the given filters

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :tag (String)

    Tag

  • :type (String)

    Type

  • :parent (String)

    ID of tag parent

  • :statement_code (String)

    Statement Code

  • :fs_template (String)

    Template (default to industrial)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



33
34
35
36
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 33

def filter_data_tags(opts = {})
  data, _status_code, _headers = filter_data_tags_with_http_info(opts)
  return data
end

#filter_data_tags_with_http_info(opts = {}) ⇒ Array<(ApiResponseDataTags, Fixnum, Hash)>

Filter Data Tags Returns Data Tags that match the given filters

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :tag (String)

    Tag

  • :type (String)

    Type

  • :parent (String)

    ID of tag parent

  • :statement_code (String)

    Statement Code

  • :fs_template (String)

    Template

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseDataTags, Fixnum, Hash)>)

    ApiResponseDataTags data, response status code and response headers



48
49
50
51
52
53
54
55
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
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 48

def filter_data_tags_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DataTagApi.filter_data_tags ..."
  end
  if @api_client.config.client_side_validation && opts[:'statement_code'] && !['income_statement', 'balance_sheet_statement', 'cash_flow_statement', 'calculations'].include?(opts[:'statement_code'])
    fail ArgumentError, 'invalid value for "statement_code", must be one of income_statement, balance_sheet_statement, cash_flow_statement, calculations'
  end
  if @api_client.config.client_side_validation && opts[:'fs_template'] && !['industrial', 'financial'].include?(opts[:'fs_template'])
    fail ArgumentError, 'invalid value for "fs_template", must be one of industrial, financial'
  end
  # resource path
  local_var_path = "/data_tags/filter"

  # query parameters
  query_params = {}
  query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil?
  query_params[:'statement_code'] = opts[:'statement_code'] if !opts[:'statement_code'].nil?
  query_params[:'fs_template'] = opts[:'fs_template'] if !opts[:'fs_template'].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 => 'ApiResponseDataTags')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DataTagApi#filter_data_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_data_tags(opts = {}) ⇒ ApiResponseDataTags

All Data Tags Returns All Data Tags

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



99
100
101
102
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 99

def get_all_data_tags(opts = {})
  data, _status_code, _headers = get_all_data_tags_with_http_info(opts)
  return data
end

#get_all_data_tags_with_http_info(opts = {}) ⇒ Array<(ApiResponseDataTags, Fixnum, Hash)>

All Data Tags Returns All Data Tags

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseDataTags, Fixnum, Hash)>)

    ApiResponseDataTags data, response status code and response headers



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 109

def get_all_data_tags_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DataTagApi.get_all_data_tags ..."
  end
  # resource path
  local_var_path = "/data_tags"

  # query parameters
  query_params = {}
  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 => 'ApiResponseDataTags')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DataTagApi#get_all_data_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_data_tag_by_id(identifier, opts = {}) ⇒ DataTag

Lookup Data Tag Returns the Data Tag with the given ‘identifier`

Parameters:

  • identifier

    The Intrinio ID or the code-name of the Data Tag

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



149
150
151
152
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 149

def get_data_tag_by_id(identifier, opts = {})
  data, _status_code, _headers = get_data_tag_by_id_with_http_info(identifier, opts)
  return data
end

#get_data_tag_by_id_with_http_info(identifier, opts = {}) ⇒ Array<(DataTag, Fixnum, Hash)>

Lookup Data Tag Returns the Data Tag with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    The Intrinio ID or the code-name of the Data Tag

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DataTag, Fixnum, Hash)>)

    DataTag data, response status code and response headers



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
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 159

def get_data_tag_by_id_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DataTagApi.get_data_tag_by_id ..."
  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 DataTagApi.get_data_tag_by_id"
  end
  # resource path
  local_var_path = "/data_tags/{identifier}".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}

  # 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 => 'DataTag')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DataTagApi#get_data_tag_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_data_tags(query, opts = {}) ⇒ ApiResponseDataTags

Search Data Tags Searches for Data Tags matching the text ‘query`

Parameters:

  • query
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



202
203
204
205
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 202

def search_data_tags(query, opts = {})
  data, _status_code, _headers = search_data_tags_with_http_info(query, opts)
  return data
end

#search_data_tags_with_http_info(query, opts = {}) ⇒ Array<(ApiResponseDataTags, Fixnum, Hash)>

Search Data Tags Searches for Data Tags matching the text &#x60;query&#x60;

Parameters:

  • query
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ApiResponseDataTags, Fixnum, Hash)>)

    ApiResponseDataTags data, response status code and response headers



212
213
214
215
216
217
218
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
# File 'lib/intrinio-sdk/api/data_tag_api.rb', line 212

def search_data_tags_with_http_info(query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DataTagApi.search_data_tags ..."
  end
  # verify the required parameter 'query' is set
  if @api_client.config.client_side_validation && query.nil?
    fail ArgumentError, "Missing the required parameter 'query' when calling DataTagApi.search_data_tags"
  end
  # resource path
  local_var_path = "/data_tags/search"

  # query parameters
  query_params = {}
  query_params[:'query'] = query

  # 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 => 'ApiResponseDataTags')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DataTagApi#search_data_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end