edinet_api_client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ =begin
2
+ #EDINET API
3
+
4
+ #EDINET API は、利用者が EDINET の画面からではなく、プログラムを介して EDINET のデータベースから効率的にデータを取得できる API(アプリケーション・プログラミング・インターフェース)です。EDINET API により、EDINET 利用者は効率的に開示情報を取得することが可能となります。
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ module EdinetAPIClient
14
+ class ApiError < StandardError
15
+ attr_reader :code, :response_headers, :response_body
16
+
17
+ # Usage examples:
18
+ # ApiError.new
19
+ # ApiError.new("message")
20
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
21
+ # ApiError.new(:code => 404, :message => "Not Found")
22
+ def initialize(arg = nil)
23
+ if arg.is_a? Hash
24
+ if arg.key?(:message) || arg.key?('message')
25
+ super(arg[:message] || arg['message'])
26
+ else
27
+ super arg
28
+ end
29
+
30
+ arg.each do |k, v|
31
+ instance_variable_set "@#{k}", v
32
+ end
33
+ else
34
+ super arg
35
+ end
36
+ end
37
+
38
+ # Override to_s to display a friendly error message
39
+ def to_s
40
+ message
41
+ end
42
+
43
+ def message
44
+ if @message.nil?
45
+ msg = "Error message: the server returns an error"
46
+ else
47
+ msg = @message
48
+ end
49
+
50
+ msg += "\nHTTP status code: #{code}" if code
51
+ msg += "\nResponse headers: #{response_headers}" if response_headers
52
+ msg += "\nResponse body: #{response_body}" if response_body
53
+
54
+ msg
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #EDINET API
3
+
4
+ #EDINET API は、利用者が EDINET の画面からではなく、プログラムを介して EDINET のデータベースから効率的にデータを取得できる API(アプリケーション・プログラミング・インターフェース)です。EDINET API により、EDINET 利用者は効率的に開示情報を取得することが可能となります。
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module EdinetAPIClient
16
+ class Configuration
17
+ # Defines url scheme
18
+ attr_accessor :scheme
19
+
20
+ # Defines url host
21
+ attr_accessor :host
22
+
23
+ # Defines url base path
24
+ attr_accessor :base_path
25
+
26
+ # Defines API keys used with API Key authentications.
27
+ #
28
+ # @return [Hash] key: parameter name, value: parameter value (API key)
29
+ #
30
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
31
+ # config.api_key['api_key'] = 'xxx'
32
+ attr_accessor :api_key
33
+
34
+ # Defines API key prefixes used with API Key authentications.
35
+ #
36
+ # @return [Hash] key: parameter name, value: API key prefix
37
+ #
38
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
39
+ # config.api_key_prefix['api_key'] = 'Token'
40
+ attr_accessor :api_key_prefix
41
+
42
+ # Defines the username used with HTTP basic authentication.
43
+ #
44
+ # @return [String]
45
+ attr_accessor :username
46
+
47
+ # Defines the password used with HTTP basic authentication.
48
+ #
49
+ # @return [String]
50
+ attr_accessor :password
51
+
52
+ # Defines the access token (Bearer) used with OAuth2.
53
+ attr_accessor :access_token
54
+
55
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
56
+ # details will be logged with `logger.debug` (see the `logger` attribute).
57
+ # Default to false.
58
+ #
59
+ # @return [true, false]
60
+ attr_accessor :debugging
61
+
62
+ # Defines the logger used for debugging.
63
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
64
+ #
65
+ # @return [#debug]
66
+ attr_accessor :logger
67
+
68
+ # Defines the temporary folder to store downloaded files
69
+ # (for API endpoints that have file response).
70
+ # Default to use `Tempfile`.
71
+ #
72
+ # @return [String]
73
+ attr_accessor :temp_folder_path
74
+
75
+ # The time limit for HTTP request in seconds.
76
+ # Default to 0 (never times out).
77
+ attr_accessor :timeout
78
+
79
+ # Set this to false to skip client side validation in the operation.
80
+ # Default to true.
81
+ # @return [true, false]
82
+ attr_accessor :client_side_validation
83
+
84
+ ### TLS/SSL setting
85
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
86
+ # Default to true.
87
+ #
88
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
89
+ #
90
+ # @return [true, false]
91
+ attr_accessor :verify_ssl
92
+
93
+ ### TLS/SSL setting
94
+ # Set this to false to skip verifying SSL host name
95
+ # Default to true.
96
+ #
97
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
98
+ #
99
+ # @return [true, false]
100
+ attr_accessor :verify_ssl_host
101
+
102
+ ### TLS/SSL setting
103
+ # Set this to customize the certificate file to verify the peer.
104
+ #
105
+ # @return [String] the path to the certificate file
106
+ #
107
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
108
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
109
+ attr_accessor :ssl_ca_cert
110
+
111
+ ### TLS/SSL setting
112
+ # Client certificate file (for client certificate)
113
+ attr_accessor :cert_file
114
+
115
+ ### TLS/SSL setting
116
+ # Client private key file (for client certificate)
117
+ attr_accessor :key_file
118
+
119
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
120
+ # Default to nil.
121
+ #
122
+ # @see The params_encoding option of Ethon. Related source code:
123
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
124
+ attr_accessor :params_encoding
125
+
126
+ attr_accessor :inject_format
127
+
128
+ attr_accessor :force_ending_format
129
+
130
+ def initialize
131
+ @scheme = 'https'
132
+ @host = 'disclosure.edinet-fsa.go.jp'
133
+ @base_path = '/api/v1'
134
+ @api_key = {}
135
+ @api_key_prefix = {}
136
+ @timeout = 0
137
+ @client_side_validation = true
138
+ @verify_ssl = true
139
+ @verify_ssl_host = true
140
+ @params_encoding = nil
141
+ @cert_file = nil
142
+ @key_file = nil
143
+ @debugging = false
144
+ @inject_format = false
145
+ @force_ending_format = false
146
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
147
+
148
+ yield(self) if block_given?
149
+ end
150
+
151
+ # The default Configuration object.
152
+ def self.default
153
+ @@default ||= Configuration.new
154
+ end
155
+
156
+ def configure
157
+ yield(self) if block_given?
158
+ end
159
+
160
+ def scheme=(scheme)
161
+ # remove :// from scheme
162
+ @scheme = scheme.sub(/:\/\//, '')
163
+ end
164
+
165
+ def host=(host)
166
+ # remove http(s):// and anything after a slash
167
+ @host = host.sub(/https?:\/\//, '').split('/').first
168
+ end
169
+
170
+ def base_path=(base_path)
171
+ # Add leading and trailing slashes to base_path
172
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
173
+ @base_path = '' if @base_path == '/'
174
+ end
175
+
176
+ def base_url
177
+ url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
178
+ URI.encode(url)
179
+ end
180
+
181
+ # Gets API key (with prefix if set).
182
+ # @param [String] param_name the parameter name of API key auth
183
+ def api_key_with_prefix(param_name)
184
+ if @api_key_prefix[param_name]
185
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
186
+ else
187
+ @api_key[param_name]
188
+ end
189
+ end
190
+
191
+ # Gets Basic Auth token string
192
+ def basic_auth_token
193
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
194
+ end
195
+
196
+ # Returns Auth Settings hash for api client.
197
+ def auth_settings
198
+ {
199
+ }
200
+ end
201
+
202
+ # Returns an array of Server setting
203
+ def server_settings
204
+ [
205
+ {
206
+ url: "https://disclosure.edinet-fsa.go.jp/api/v1",
207
+ description: "No descriptoin provided",
208
+ }
209
+ ]
210
+ end
211
+
212
+ # Returns URL based on server settings
213
+ #
214
+ # @param index array index of the server settings
215
+ # @param variables hash of variable and the corresponding value
216
+ def server_url(index, variables = {})
217
+ servers = server_settings
218
+
219
+ # check array index out of bound
220
+ if (index < 0 || index >= servers.size)
221
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
222
+ end
223
+
224
+ server = servers[index]
225
+ url = server[:url]
226
+
227
+ # go through variable and assign a value
228
+ server[:variables].each do |name, variable|
229
+ if variables.key?(name)
230
+ if (server[:variables][name][:enum_values].include? variables[name])
231
+ url.gsub! "{" + name.to_s + "}", variables[name]
232
+ else
233
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
234
+ end
235
+ else
236
+ # use default value
237
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
238
+ end
239
+ end
240
+
241
+ url
242
+ end
243
+ end
244
+ end
@@ -0,0 +1,457 @@
1
+ =begin
2
+ #EDINET API
3
+
4
+ #EDINET API は、利用者が EDINET の画面からではなく、プログラムを介して EDINET のデータベースから効率的にデータを取得できる API(アプリケーション・プログラミング・インターフェース)です。EDINET API により、EDINET 利用者は効率的に開示情報を取得することが可能となります。
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module EdinetAPIClient
16
+ class Document
17
+ # ファイル日付ごとの連番です。
18
+ attr_accessor :seq_number
19
+
20
+ # 書類管理番号が出力されます。
21
+ attr_accessor :doc_id
22
+
23
+ # 提出者の EDINET コードが出力されます。
24
+ attr_accessor :edinet_code
25
+
26
+ # 提出者の証券コードが出力されます。
27
+ attr_accessor :sec_code
28
+
29
+ # 提出者の法人番号が出力されます。
30
+ attr_accessor :jcn
31
+
32
+ # 提出者の名前が出力されます。
33
+ attr_accessor :filer_name
34
+
35
+ # ファンドコードが出力されます。
36
+ attr_accessor :fund_code
37
+
38
+ # 府令コードが出力されます。
39
+ attr_accessor :ordinance_code
40
+
41
+ # 様式コードが出力されます。
42
+ attr_accessor :form_code
43
+
44
+ # 書類種別コードが出力されます。
45
+ attr_accessor :doc_type_code
46
+
47
+ # 期間(自)が出力されます。
48
+ attr_accessor :period_start
49
+
50
+ # 期間(至)が出力されます。
51
+ attr_accessor :period_end
52
+
53
+ # 提出日時が出力されます。
54
+ attr_accessor :submit_date_time
55
+
56
+ # EDINET の閲覧サイトの書類検索結果画面において、「提出書類」欄に表示される文字列が出力されます。
57
+ attr_accessor :doc_description
58
+
59
+ # 大量保有について発行会社の EDINET コードが出力されます。
60
+ attr_accessor :issuer_edinet_code
61
+
62
+ # 公開買付けについて対象となる EDINET コードが出力されます。
63
+ attr_accessor :subject_edinet_code
64
+
65
+ # 小会社の EDINET コードが出力されます。複数存在する場合(最大10個)、\",\"(カンマ)で結合した文字列が出力されます。
66
+ attr_accessor :subsidiary_edinet_code
67
+
68
+ # 臨時報告書の提出事由が出力されます。複数存在する場合、\",\"(カンマ)で結合した文字列が出力されます。
69
+ attr_accessor :current_report_reason
70
+
71
+ # 親書類管理番号が出力されます。
72
+ attr_accessor :parent_doc_id
73
+
74
+ # 「2-1-6 財務局職員による書類情報修正」、「2-1-7 財務局職員による書類の不開示」、磁気ディスク退出及び紙面提出を行った日時が出力されます。
75
+ attr_accessor :ope_date_time
76
+
77
+ # 取下書は\"1\"、取り下げられた書類は\"2\"、それ以外は\"0\"が出力されます。
78
+ attr_accessor :withdrawal_status
79
+
80
+ # 財務局職員が書類を修正した情報は\"1\"、修正された書類は\"2\"、それ以外は\"0\"が出力されます。
81
+ attr_accessor :doc_info_edit_status
82
+
83
+ # 財務局職員によって書類の不開示を開始した情報は\"1\"、不開示とされている書類は\"2\"、財務局職員によって書類の不開示を解除した情報は\"3\"、それ以外は\"0\"が出力されます。
84
+ attr_accessor :disclosure_status
85
+
86
+ # 書類に XBRL がある場合は\"1\"、それ以外は\"0\"が出力されます。
87
+ attr_accessor :xbrl_flag
88
+
89
+ # 書類に PDF がある場合は\"1\"、それ以外は\"0\"が出力されます。
90
+ attr_accessor :pdf_flag
91
+
92
+ # 書類に代替書面・添付文書がある場合は\"1\"、それ以外は\"0\"が出力されます。
93
+ attr_accessor :attach_doc_flag
94
+
95
+ # 書類に英文ファイルがある場合は\"1\"、それ以外は\"0\"が出力されます。
96
+ attr_accessor :english_doc_flag
97
+
98
+ # Attribute mapping from ruby-style variable name to JSON key.
99
+ def self.attribute_map
100
+ {
101
+ :'seq_number' => :'seqNumber',
102
+ :'doc_id' => :'docID',
103
+ :'edinet_code' => :'edinetCode',
104
+ :'sec_code' => :'secCode',
105
+ :'jcn' => :'JCN',
106
+ :'filer_name' => :'filerName',
107
+ :'fund_code' => :'fundCode',
108
+ :'ordinance_code' => :'ordinanceCode',
109
+ :'form_code' => :'formCode',
110
+ :'doc_type_code' => :'docTypeCode',
111
+ :'period_start' => :'periodStart',
112
+ :'period_end' => :'periodEnd',
113
+ :'submit_date_time' => :'submitDateTime',
114
+ :'doc_description' => :'docDescription',
115
+ :'issuer_edinet_code' => :'issuerEdinetCode',
116
+ :'subject_edinet_code' => :'subjectEdinetCode',
117
+ :'subsidiary_edinet_code' => :'subsidiaryEdinetCode',
118
+ :'current_report_reason' => :'currentReportReason',
119
+ :'parent_doc_id' => :'parentDocID',
120
+ :'ope_date_time' => :'opeDateTime',
121
+ :'withdrawal_status' => :'withdrawalStatus',
122
+ :'doc_info_edit_status' => :'docInfoEditStatus',
123
+ :'disclosure_status' => :'disclosureStatus',
124
+ :'xbrl_flag' => :'xbrlFlag',
125
+ :'pdf_flag' => :'pdfFlag',
126
+ :'attach_doc_flag' => :'attachDocFlag',
127
+ :'english_doc_flag' => :'englishDocFlag'
128
+ }
129
+ end
130
+
131
+ # Attribute type mapping.
132
+ def self.openapi_types
133
+ {
134
+ :'seq_number' => :'Integer',
135
+ :'doc_id' => :'String',
136
+ :'edinet_code' => :'String',
137
+ :'sec_code' => :'String',
138
+ :'jcn' => :'String',
139
+ :'filer_name' => :'String',
140
+ :'fund_code' => :'String',
141
+ :'ordinance_code' => :'String',
142
+ :'form_code' => :'String',
143
+ :'doc_type_code' => :'String',
144
+ :'period_start' => :'String',
145
+ :'period_end' => :'String',
146
+ :'submit_date_time' => :'String',
147
+ :'doc_description' => :'String',
148
+ :'issuer_edinet_code' => :'String',
149
+ :'subject_edinet_code' => :'String',
150
+ :'subsidiary_edinet_code' => :'String',
151
+ :'current_report_reason' => :'String',
152
+ :'parent_doc_id' => :'String',
153
+ :'ope_date_time' => :'String',
154
+ :'withdrawal_status' => :'String',
155
+ :'doc_info_edit_status' => :'String',
156
+ :'disclosure_status' => :'String',
157
+ :'xbrl_flag' => :'String',
158
+ :'pdf_flag' => :'String',
159
+ :'attach_doc_flag' => :'String',
160
+ :'english_doc_flag' => :'String'
161
+ }
162
+ end
163
+
164
+ # Initializes the object
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ def initialize(attributes = {})
167
+ if (!attributes.is_a?(Hash))
168
+ fail ArgumentError, "The input argument (attributes) must be a hash in `EdinetAPIClient::Document` initialize method"
169
+ end
170
+
171
+ # check to see if the attribute exists and convert string to symbol for hash key
172
+ attributes = attributes.each_with_object({}) { |(k, v), h|
173
+ if (!self.class.attribute_map.key?(k.to_sym))
174
+ fail ArgumentError, "`#{k}` is not a valid attribute in `EdinetAPIClient::Document`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
175
+ end
176
+ h[k.to_sym] = v
177
+ }
178
+
179
+ if attributes.key?(:'seq_number')
180
+ self.seq_number = attributes[:'seq_number']
181
+ end
182
+
183
+ if attributes.key?(:'doc_id')
184
+ self.doc_id = attributes[:'doc_id']
185
+ end
186
+
187
+ if attributes.key?(:'edinet_code')
188
+ self.edinet_code = attributes[:'edinet_code']
189
+ end
190
+
191
+ if attributes.key?(:'sec_code')
192
+ self.sec_code = attributes[:'sec_code']
193
+ end
194
+
195
+ if attributes.key?(:'jcn')
196
+ self.jcn = attributes[:'jcn']
197
+ end
198
+
199
+ if attributes.key?(:'filer_name')
200
+ self.filer_name = attributes[:'filer_name']
201
+ end
202
+
203
+ if attributes.key?(:'fund_code')
204
+ self.fund_code = attributes[:'fund_code']
205
+ end
206
+
207
+ if attributes.key?(:'ordinance_code')
208
+ self.ordinance_code = attributes[:'ordinance_code']
209
+ end
210
+
211
+ if attributes.key?(:'form_code')
212
+ self.form_code = attributes[:'form_code']
213
+ end
214
+
215
+ if attributes.key?(:'doc_type_code')
216
+ self.doc_type_code = attributes[:'doc_type_code']
217
+ end
218
+
219
+ if attributes.key?(:'period_start')
220
+ self.period_start = attributes[:'period_start']
221
+ end
222
+
223
+ if attributes.key?(:'period_end')
224
+ self.period_end = attributes[:'period_end']
225
+ end
226
+
227
+ if attributes.key?(:'submit_date_time')
228
+ self.submit_date_time = attributes[:'submit_date_time']
229
+ end
230
+
231
+ if attributes.key?(:'doc_description')
232
+ self.doc_description = attributes[:'doc_description']
233
+ end
234
+
235
+ if attributes.key?(:'issuer_edinet_code')
236
+ self.issuer_edinet_code = attributes[:'issuer_edinet_code']
237
+ end
238
+
239
+ if attributes.key?(:'subject_edinet_code')
240
+ self.subject_edinet_code = attributes[:'subject_edinet_code']
241
+ end
242
+
243
+ if attributes.key?(:'subsidiary_edinet_code')
244
+ self.subsidiary_edinet_code = attributes[:'subsidiary_edinet_code']
245
+ end
246
+
247
+ if attributes.key?(:'current_report_reason')
248
+ self.current_report_reason = attributes[:'current_report_reason']
249
+ end
250
+
251
+ if attributes.key?(:'parent_doc_id')
252
+ self.parent_doc_id = attributes[:'parent_doc_id']
253
+ end
254
+
255
+ if attributes.key?(:'ope_date_time')
256
+ self.ope_date_time = attributes[:'ope_date_time']
257
+ end
258
+
259
+ if attributes.key?(:'withdrawal_status')
260
+ self.withdrawal_status = attributes[:'withdrawal_status']
261
+ end
262
+
263
+ if attributes.key?(:'doc_info_edit_status')
264
+ self.doc_info_edit_status = attributes[:'doc_info_edit_status']
265
+ end
266
+
267
+ if attributes.key?(:'disclosure_status')
268
+ self.disclosure_status = attributes[:'disclosure_status']
269
+ end
270
+
271
+ if attributes.key?(:'xbrl_flag')
272
+ self.xbrl_flag = attributes[:'xbrl_flag']
273
+ end
274
+
275
+ if attributes.key?(:'pdf_flag')
276
+ self.pdf_flag = attributes[:'pdf_flag']
277
+ end
278
+
279
+ if attributes.key?(:'attach_doc_flag')
280
+ self.attach_doc_flag = attributes[:'attach_doc_flag']
281
+ end
282
+
283
+ if attributes.key?(:'english_doc_flag')
284
+ self.english_doc_flag = attributes[:'english_doc_flag']
285
+ end
286
+ end
287
+
288
+ # Show invalid properties with the reasons. Usually used together with valid?
289
+ # @return Array for valid properties with the reasons
290
+ def list_invalid_properties
291
+ invalid_properties = Array.new
292
+ invalid_properties
293
+ end
294
+
295
+ # Check to see if the all the properties in the model are valid
296
+ # @return true if the model is valid
297
+ def valid?
298
+ true
299
+ end
300
+
301
+ # Checks equality by comparing each attribute.
302
+ # @param [Object] Object to be compared
303
+ def ==(o)
304
+ return true if self.equal?(o)
305
+ self.class == o.class &&
306
+ seq_number == o.seq_number &&
307
+ doc_id == o.doc_id &&
308
+ edinet_code == o.edinet_code &&
309
+ sec_code == o.sec_code &&
310
+ jcn == o.jcn &&
311
+ filer_name == o.filer_name &&
312
+ fund_code == o.fund_code &&
313
+ ordinance_code == o.ordinance_code &&
314
+ form_code == o.form_code &&
315
+ doc_type_code == o.doc_type_code &&
316
+ period_start == o.period_start &&
317
+ period_end == o.period_end &&
318
+ submit_date_time == o.submit_date_time &&
319
+ doc_description == o.doc_description &&
320
+ issuer_edinet_code == o.issuer_edinet_code &&
321
+ subject_edinet_code == o.subject_edinet_code &&
322
+ subsidiary_edinet_code == o.subsidiary_edinet_code &&
323
+ current_report_reason == o.current_report_reason &&
324
+ parent_doc_id == o.parent_doc_id &&
325
+ ope_date_time == o.ope_date_time &&
326
+ withdrawal_status == o.withdrawal_status &&
327
+ doc_info_edit_status == o.doc_info_edit_status &&
328
+ disclosure_status == o.disclosure_status &&
329
+ xbrl_flag == o.xbrl_flag &&
330
+ pdf_flag == o.pdf_flag &&
331
+ attach_doc_flag == o.attach_doc_flag &&
332
+ english_doc_flag == o.english_doc_flag
333
+ end
334
+
335
+ # @see the `==` method
336
+ # @param [Object] Object to be compared
337
+ def eql?(o)
338
+ self == o
339
+ end
340
+
341
+ # Calculates hash code according to all attributes.
342
+ # @return [Integer] Hash code
343
+ def hash
344
+ [seq_number, doc_id, edinet_code, sec_code, jcn, filer_name, fund_code, ordinance_code, form_code, doc_type_code, period_start, period_end, submit_date_time, doc_description, issuer_edinet_code, subject_edinet_code, subsidiary_edinet_code, current_report_reason, parent_doc_id, ope_date_time, withdrawal_status, doc_info_edit_status, disclosure_status, xbrl_flag, pdf_flag, attach_doc_flag, english_doc_flag].hash
345
+ end
346
+
347
+ # Builds the object from hash
348
+ # @param [Hash] attributes Model attributes in the form of hash
349
+ # @return [Object] Returns the model itself
350
+ def self.build_from_hash(attributes)
351
+ new.build_from_hash(attributes)
352
+ end
353
+
354
+ # Builds the object from hash
355
+ # @param [Hash] attributes Model attributes in the form of hash
356
+ # @return [Object] Returns the model itself
357
+ def build_from_hash(attributes)
358
+ return nil unless attributes.is_a?(Hash)
359
+ self.class.openapi_types.each_pair do |key, type|
360
+ if type =~ /\AArray<(.*)>/i
361
+ # check to ensure the input is an array given that the attribute
362
+ # is documented as an array but the input is not
363
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
364
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
365
+ end
366
+ elsif !attributes[self.class.attribute_map[key]].nil?
367
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
368
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
369
+ end
370
+
371
+ self
372
+ end
373
+
374
+ # Deserializes the data based on type
375
+ # @param string type Data type
376
+ # @param string value Value to be deserialized
377
+ # @return [Object] Deserialized data
378
+ def _deserialize(type, value)
379
+ case type.to_sym
380
+ when :DateTime
381
+ DateTime.parse(value)
382
+ when :Date
383
+ Date.parse(value)
384
+ when :String
385
+ value.to_s
386
+ when :Integer
387
+ value.to_i
388
+ when :Float
389
+ value.to_f
390
+ when :Boolean
391
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
392
+ true
393
+ else
394
+ false
395
+ end
396
+ when :Object
397
+ # generic object (usually a Hash), return directly
398
+ value
399
+ when /\AArray<(?<inner_type>.+)>\z/
400
+ inner_type = Regexp.last_match[:inner_type]
401
+ value.map { |v| _deserialize(inner_type, v) }
402
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
403
+ k_type = Regexp.last_match[:k_type]
404
+ v_type = Regexp.last_match[:v_type]
405
+ {}.tap do |hash|
406
+ value.each do |k, v|
407
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
408
+ end
409
+ end
410
+ else # model
411
+ EdinetAPIClient.const_get(type).build_from_hash(value)
412
+ end
413
+ end
414
+
415
+ # Returns the string representation of the object
416
+ # @return [String] String presentation of the object
417
+ def to_s
418
+ to_hash.to_s
419
+ end
420
+
421
+ # to_body is an alias to to_hash (backward compatibility)
422
+ # @return [Hash] Returns the object in the form of hash
423
+ def to_body
424
+ to_hash
425
+ end
426
+
427
+ # Returns the object in the form of hash
428
+ # @return [Hash] Returns the object in the form of hash
429
+ def to_hash
430
+ hash = {}
431
+ self.class.attribute_map.each_pair do |attr, param|
432
+ value = self.send(attr)
433
+ next if value.nil?
434
+ hash[param] = _to_hash(value)
435
+ end
436
+ hash
437
+ end
438
+
439
+ # Outputs non-array value in the form of hash
440
+ # For object, use to_hash. Otherwise, just return the value
441
+ # @param [Object] value Any valid value
442
+ # @return [Hash] Returns the value in the form of hash
443
+ def _to_hash(value)
444
+ if value.is_a?(Array)
445
+ value.compact.map { |v| _to_hash(v) }
446
+ elsif value.is_a?(Hash)
447
+ {}.tap do |hash|
448
+ value.each { |k, v| hash[k] = _to_hash(v) }
449
+ end
450
+ elsif value.respond_to? :to_hash
451
+ value.to_hash
452
+ else
453
+ value
454
+ end
455
+ end
456
+ end
457
+ end