class EdinetAPIClient::DefaultApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/edinet_api_client/api/default_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

find_documents(date, opts = {}) click to toggle source

書類一覧 API 書類一覧 API では、「メタデータのみ」または「提出書類一覧及びメタデータ」を取得することが可能です。 @param date [String] 出力対象とする提出書類一覧のファイル日付(YYYY-MM-DD形式)を指定します。 @param [Hash] opts the optional parameters @option opts [Integer] :type 取得情報を指定します。 * 1: メタデータのみを取得します。 * 2: 提出書類一覧及びメタデータを取得します。 (default to 1) @return [InlineResponse200]

# File lib/edinet_api_client/api/default_api.rb, line 28
def find_documents(date, opts = {})
  data, _status_code, _headers = find_documents_with_http_info(date, opts)
  data
end
find_documents_with_http_info(date, opts = {}) click to toggle source

書類一覧 API 書類一覧 API では、「メタデータのみ」または「提出書類一覧及びメタデータ」を取得することが可能です。 @param date [String] 出力対象とする提出書類一覧のファイル日付(YYYY-MM-DD形式)を指定します。 @param [Hash] opts the optional parameters @option opts [Integer] :type 取得情報を指定します。 * 1: メタデータのみを取得します。 * 2: 提出書類一覧及びメタデータを取得します。 @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers

# File lib/edinet_api_client/api/default_api.rb, line 39
def find_documents_with_http_info(date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.find_documents ...'
  end
  # verify the required parameter 'date' is set
  if @api_client.config.client_side_validation && date.nil?
    fail ArgumentError, "Missing the required parameter 'date' when calling DefaultApi.find_documents"
  end
  allowable_values = [1, 2]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/documents.json'

  # query parameters
  query_params = {}
  query_params[:'date'] = date
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].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 = []
  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 => 'InlineResponse200')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#find_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_document(doc_id, type, opts = {}) click to toggle source

書類取得 API 書類取得 API では、書類をダウンロードすることが可能です。 @param doc_id [String] 取得したい書類の書類管理番号を指定します(書類管理番号は、書類一覧 API で取得した提出書類一覧に基づきます。ただし、開示対象外の書類は取得できません)。 @param type [Integer] 必要書類を指定します。 * 1: 提出本文書及び監査報告書を取得します。 * 2: PDF を取得します。 * 3: 代替書面・添付文書を取得します。 * 4: 英文ファイルを取得します。 @param [Hash] opts the optional parameters @return [File]

# File lib/edinet_api_client/api/default_api.rb, line 89
def get_document(doc_id, type, opts = {})
  data, _status_code, _headers = get_document_with_http_info(doc_id, type, opts)
  data
end
get_document_with_http_info(doc_id, type, opts = {}) click to toggle source

書類取得 API 書類取得 API では、書類をダウンロードすることが可能です。 @param doc_id [String] 取得したい書類の書類管理番号を指定します(書類管理番号は、書類一覧 API で取得した提出書類一覧に基づきます。ただし、開示対象外の書類は取得できません)。 @param type [Integer] 必要書類を指定します。 * 1: 提出本文書及び監査報告書を取得します。 * 2: PDF を取得します。 * 3: 代替書面・添付文書を取得します。 * 4: 英文ファイルを取得します。 @param [Hash] opts the optional parameters @return [Array<(File, Integer, Hash)>] File data, response status code and response headers

# File lib/edinet_api_client/api/default_api.rb, line 100
def get_document_with_http_info(doc_id, type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_document ...'
  end
  # verify the required parameter 'doc_id' is set
  if @api_client.config.client_side_validation && doc_id.nil?
    fail ArgumentError, "Missing the required parameter 'doc_id' when calling DefaultApi.get_document"
  end
  # verify the required parameter 'type' is set
  if @api_client.config.client_side_validation && type.nil?
    fail ArgumentError, "Missing the required parameter 'type' when calling DefaultApi.get_document"
  end
  # verify enum value
  allowable_values = [1, 2, 3, 4]
  if @api_client.config.client_side_validation && !allowable_values.include?(type)
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/documents/{docID}'.sub('{' + 'docID' + '}', doc_id.to_s)

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

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/octet-stream'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'File')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end