Class: Intrinio::FilingApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FilingApi

Returns a new instance of FilingApi.



19
20
21
# File 'lib/intrinio-sdk/api/filing_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/filing_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#filter_filings(company, opts = {}) ⇒ ApiResponseFilings

Filter Filings Returns filings that match the specified filters

Parameters:

  • company

    Filings for the given `company` identifier (ticker, CIK, LEI, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :report_type (String)

    Filter by report type

  • :start_date (Date)

    Filed on or after the given date

  • :end_date (Date)

    Filed before or after the given date

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



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

def filter_filings(company, opts = {})
  data, _status_code, _headers = filter_filings_with_http_info(company, opts)
  return data
end

#filter_filings_with_http_info(company, opts = {}) ⇒ Array<(ApiResponseFilings, Fixnum, Hash)>

Filter Filings Returns filings that match the specified filters

Parameters:

  • company

    Filings for the given &#x60;company&#x60; identifier (ticker, CIK, LEI, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :report_type (String)

    Filter by report type

  • :start_date (Date)

    Filed on or after the given date

  • :end_date (Date)

    Filed before or after the given date

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

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

    ApiResponseFilings data, response status code and response headers



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

def filter_filings_with_http_info(company, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilingApi.filter_filings ..."
  end
  # verify the required parameter 'company' is set
  if @api_client.config.client_side_validation && company.nil?
    fail ArgumentError, "Missing the required parameter 'company' when calling FilingApi.filter_filings"
  end
  # resource path
  local_var_path = "/filings/filter"

  # query parameters
  query_params = {}
  query_params[:'company'] = company
  query_params[:'report_type'] = opts[:'report_type'] if !opts[:'report_type'].nil?
  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[:'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 => 'ApiResponseFilings')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilingApi#filter_filings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_filings(opts = {}) ⇒ ApiResponseFilings

Get All Filings Returns all filings

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:



94
95
96
97
# File 'lib/intrinio-sdk/api/filing_api.rb', line 94

def get_all_filings(opts = {})
  data, _status_code, _headers = get_all_filings_with_http_info(opts)
  return data
end

#get_all_filings_with_http_info(opts = {}) ⇒ Array<(ApiResponseFilings, Fixnum, Hash)>

Get All Filings Returns all filings

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<(ApiResponseFilings, Fixnum, Hash)>)

    ApiResponseFilings data, response status code and response headers



104
105
106
107
108
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
# File 'lib/intrinio-sdk/api/filing_api.rb', line 104

def get_all_filings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilingApi.get_all_filings ..."
  end
  # resource path
  local_var_path = "/filings"

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

#get_filing_by_id(id, opts = {}) ⇒ Filing

Get a Filing by ID Return the filing with the given ID

Parameters:

  • id

    The Intrinio ID of the Filing

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

    the optional parameters

Returns:



144
145
146
147
# File 'lib/intrinio-sdk/api/filing_api.rb', line 144

def get_filing_by_id(id, opts = {})
  data, _status_code, _headers = get_filing_by_id_with_http_info(id, opts)
  return data
end

#get_filing_by_id_with_http_info(id, opts = {}) ⇒ Array<(Filing, Fixnum, Hash)>

Get a Filing by ID Return the filing with the given ID

Parameters:

  • id

    The Intrinio ID of the Filing

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

    the optional parameters

Returns:

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

    Filing data, response status code and response headers



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

def get_filing_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilingApi.get_filing_by_id ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling FilingApi.get_filing_by_id"
  end
  # resource path
  local_var_path = "/filings/{id}".sub('{' + 'id' + '}', id.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 => 'Filing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilingApi#get_filing_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end