Class: EdinetAPIClient::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/edinet_api_client/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



19
20
21
# File 'lib/edinet_api_client/api/default_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/edinet_api_client/api/default_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#find_documents(date, opts = {}) ⇒ InlineResponse200

書類一覧 API 書類一覧 API では、「メタデータのみ」または「提出書類一覧及びメタデータ」を取得することが可能です。

Parameters:

  • date (String)

    出力対象とする提出書類一覧のファイル日付(YYYY-MM-DD形式)を指定します。

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

    the optional parameters

Options Hash (opts):

  • :type (Integer)

    取得情報を指定します。 * 1: メタデータのみを取得します。 * 2: 提出書類一覧及びメタデータを取得します。 (default to 1)

Returns:



28
29
30
31
# 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 = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>

書類一覧 API 書類一覧 API では、「メタデータのみ」または「提出書類一覧及びメタデータ」を取得することが可能です。

Parameters:

  • date (String)

    出力対象とする提出書類一覧のファイル日付(YYYY-MM-DD形式)を指定します。

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

    the optional parameters

Options Hash (opts):

  • :type (Integer)

    取得情報を指定します。 * 1: メタデータのみを取得します。 * 2: 提出書類一覧及びメタデータを取得します。

Returns:

  • (Array<(InlineResponse200, Integer, Hash)>)

    InlineResponse200 data, response status code and response headers



39
40
41
42
43
44
45
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
# 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 = {}) ⇒ File

書類取得 API 書類取得 API では、書類をダウンロードすることが可能です。

Parameters:

  • doc_id (String)

    取得したい書類の書類管理番号を指定します(書類管理番号は、書類一覧 API で取得した提出書類一覧に基づきます。ただし、開示対象外の書類は取得できません)。

  • type (Integer)

    必要書類を指定します。 * 1: 提出本文書及び監査報告書を取得します。 * 2: PDF を取得します。 * 3: 代替書面・添付文書を取得します。 * 4: 英文ファイルを取得します。

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

    the optional parameters

Returns:

  • (File)


89
90
91
92
# 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 = {}) ⇒ Array<(File, Integer, Hash)>

書類取得 API 書類取得 API では、書類をダウンロードすることが可能です。

Parameters:

  • doc_id (String)

    取得したい書類の書類管理番号を指定します(書類管理番号は、書類一覧 API で取得した提出書類一覧に基づきます。ただし、開示対象外の書類は取得できません)。

  • type (Integer)

    必要書類を指定します。 * 1: 提出本文書及び監査報告書を取得します。 * 2: PDF を取得します。 * 3: 代替書面・添付文書を取得します。 * 4: 英文ファイルを取得します。

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

    the optional parameters

Returns:

  • (Array<(File, Integer, Hash)>)

    File data, response status code and response headers



100
101
102
103
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
138
139
140
141
142
143
144
145
146
# 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