e-invoice-api 0.34.0 → 0.35.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/LICENSE +201 -0
- data/README.md +18 -7
- data/SECURITY.md +6 -16
- data/lib/e_invoice_api/internal/documents_number_page.rb +11 -3
- data/lib/e_invoice_api/internal/transport/base_client.rb +43 -78
- data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +8 -8
- data/lib/e_invoice_api/internal/type/array_of.rb +12 -12
- data/lib/e_invoice_api/internal/type/base_model.rb +18 -18
- data/lib/e_invoice_api/internal/type/boolean.rb +6 -6
- data/lib/e_invoice_api/internal/type/converter.rb +24 -24
- data/lib/e_invoice_api/internal/type/enum.rb +6 -6
- data/lib/e_invoice_api/internal/type/file_input.rb +6 -6
- data/lib/e_invoice_api/internal/type/hash_of.rb +12 -12
- data/lib/e_invoice_api/internal/type/request_parameters.rb +1 -1
- data/lib/e_invoice_api/internal/type/union.rb +10 -10
- data/lib/e_invoice_api/internal/type/unknown.rb +6 -6
- data/lib/e_invoice_api/internal/util.rb +15 -57
- data/lib/e_invoice_api/models/document_create.rb +45 -12
- data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +45 -12
- data/lib/e_invoice_api/models/document_response.rb +49 -14
- data/lib/e_invoice_api/models/payment_detail_create.rb +4 -2
- data/lib/e_invoice_api/models/unit_of_measure_code.rb +1349 -0
- data/lib/e_invoice_api/resources/conversion/pdf.rb +6 -6
- data/lib/e_invoice_api/resources/documents/attachments.rb +11 -11
- data/lib/e_invoice_api/resources/documents/ubl.rb +4 -4
- data/lib/e_invoice_api/resources/documents.rb +81 -81
- data/lib/e_invoice_api/resources/drafts.rb +10 -10
- data/lib/e_invoice_api/resources/inbox.rb +20 -20
- data/lib/e_invoice_api/resources/lookup.rb +5 -5
- data/lib/e_invoice_api/resources/mailbox.rb +17 -17
- data/lib/e_invoice_api/resources/me.rb +1 -1
- data/lib/e_invoice_api/resources/outbox.rb +19 -19
- data/lib/e_invoice_api/resources/stats.rb +4 -4
- data/lib/e_invoice_api/resources/validate.rb +63 -63
- data/lib/e_invoice_api/resources/webhooks.rb +20 -20
- data/lib/e_invoice_api/version.rb +1 -1
- data/lib/e_invoice_api.rb +0 -1
- data/rbi/e_invoice_api/internal/documents_number_page.rbi +6 -0
- data/rbi/e_invoice_api/internal/transport/base_client.rbi +2 -10
- data/rbi/e_invoice_api/internal/util.rbi +0 -12
- data/rbi/e_invoice_api/models/document_create.rbi +156 -12
- data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +156 -12
- data/rbi/e_invoice_api/models/document_response.rbi +162 -14
- data/rbi/e_invoice_api/models/payment_detail_create.rbi +6 -2
- data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1349 -0
- data/rbi/e_invoice_api/resources/documents.rbi +10 -5
- data/rbi/e_invoice_api/resources/validate.rbi +8 -5
- data/sig/e_invoice_api/internal/documents_number_page.rbs +4 -0
- data/sig/e_invoice_api/internal/transport/base_client.rbs +1 -4
- data/sig/e_invoice_api/internal/util.rbs +0 -4
- data/sig/e_invoice_api/models/document_create.rbs +52 -0
- data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +52 -0
- data/sig/e_invoice_api/models/document_response.rbs +52 -0
- data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2698 -0
- metadata +27 -7
|
@@ -18,9 +18,9 @@ module EInvoiceAPI
|
|
|
18
18
|
|
|
19
19
|
# @overload [](type_info, spec = {})
|
|
20
20
|
#
|
|
21
|
-
#
|
|
21
|
+
# @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class]
|
|
22
22
|
#
|
|
23
|
-
#
|
|
23
|
+
# @param spec [Hash{Symbol=>Object}] .
|
|
24
24
|
#
|
|
25
25
|
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
26
26
|
#
|
|
@@ -62,15 +62,15 @@ module EInvoiceAPI
|
|
|
62
62
|
#
|
|
63
63
|
# @param state [Hash{Symbol=>Object}] .
|
|
64
64
|
#
|
|
65
|
-
#
|
|
65
|
+
# @option state [Boolean] :translate_names
|
|
66
66
|
#
|
|
67
|
-
#
|
|
67
|
+
# @option state [Boolean] :strictness
|
|
68
68
|
#
|
|
69
|
-
#
|
|
69
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
70
70
|
#
|
|
71
|
-
#
|
|
71
|
+
# @option state [Class<StandardError>] :error
|
|
72
72
|
#
|
|
73
|
-
#
|
|
73
|
+
# @option state [Integer] :branched
|
|
74
74
|
#
|
|
75
75
|
# @return [Array<Object>, Object]
|
|
76
76
|
def coerce(value, state:)
|
|
@@ -102,7 +102,7 @@ module EInvoiceAPI
|
|
|
102
102
|
#
|
|
103
103
|
# @param state [Hash{Symbol=>Object}] .
|
|
104
104
|
#
|
|
105
|
-
#
|
|
105
|
+
# @option state [Boolean] :can_retry
|
|
106
106
|
#
|
|
107
107
|
# @return [Array<Object>, Object]
|
|
108
108
|
def dump(value, state:)
|
|
@@ -139,13 +139,13 @@ module EInvoiceAPI
|
|
|
139
139
|
#
|
|
140
140
|
# @param spec [Hash{Symbol=>Object}] .
|
|
141
141
|
#
|
|
142
|
-
#
|
|
142
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
143
143
|
#
|
|
144
|
-
#
|
|
144
|
+
# @option spec [Proc] :enum
|
|
145
145
|
#
|
|
146
|
-
#
|
|
146
|
+
# @option spec [Proc] :union
|
|
147
147
|
#
|
|
148
|
-
#
|
|
148
|
+
# @option spec [Boolean] :"nil?"
|
|
149
149
|
def initialize(type_info, spec = {})
|
|
150
150
|
@item_type_fn = EInvoiceAPI::Internal::Type::Converter.type_info(type_info || spec)
|
|
151
151
|
@meta = EInvoiceAPI::Internal::Type::Converter.meta_info(type_info, spec)
|
|
@@ -44,13 +44,13 @@ module EInvoiceAPI
|
|
|
44
44
|
#
|
|
45
45
|
# @param spec [Hash{Symbol=>Object}] .
|
|
46
46
|
#
|
|
47
|
-
#
|
|
47
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
48
48
|
#
|
|
49
|
-
#
|
|
49
|
+
# @option spec [Proc] :enum
|
|
50
50
|
#
|
|
51
|
-
#
|
|
51
|
+
# @option spec [Proc] :union
|
|
52
52
|
#
|
|
53
|
-
#
|
|
53
|
+
# @option spec [Boolean] :"nil?"
|
|
54
54
|
private def add_field(name_sym, required:, type_info:, spec:)
|
|
55
55
|
meta = EInvoiceAPI::Internal::Type::Converter.meta_info(type_info, spec)
|
|
56
56
|
type_fn, info =
|
|
@@ -144,13 +144,13 @@ module EInvoiceAPI
|
|
|
144
144
|
#
|
|
145
145
|
# @param spec [Hash{Symbol=>Object}] .
|
|
146
146
|
#
|
|
147
|
-
#
|
|
147
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
148
148
|
#
|
|
149
|
-
#
|
|
149
|
+
# @option spec [Proc] :enum
|
|
150
150
|
#
|
|
151
|
-
#
|
|
151
|
+
# @option spec [Proc] :union
|
|
152
152
|
#
|
|
153
|
-
#
|
|
153
|
+
# @option spec [Boolean] :"nil?"
|
|
154
154
|
def required(name_sym, type_info, spec = {})
|
|
155
155
|
add_field(name_sym, required: true, type_info: type_info, spec: spec)
|
|
156
156
|
end
|
|
@@ -163,13 +163,13 @@ module EInvoiceAPI
|
|
|
163
163
|
#
|
|
164
164
|
# @param spec [Hash{Symbol=>Object}] .
|
|
165
165
|
#
|
|
166
|
-
#
|
|
166
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
167
167
|
#
|
|
168
|
-
#
|
|
168
|
+
# @option spec [Proc] :enum
|
|
169
169
|
#
|
|
170
|
-
#
|
|
170
|
+
# @option spec [Proc] :union
|
|
171
171
|
#
|
|
172
|
-
#
|
|
172
|
+
# @option spec [Boolean] :"nil?"
|
|
173
173
|
def optional(name_sym, type_info, spec = {})
|
|
174
174
|
add_field(name_sym, required: false, type_info: type_info, spec: spec)
|
|
175
175
|
end
|
|
@@ -233,15 +233,15 @@ module EInvoiceAPI
|
|
|
233
233
|
#
|
|
234
234
|
# @param state [Hash{Symbol=>Object}] .
|
|
235
235
|
#
|
|
236
|
-
#
|
|
236
|
+
# @option state [Boolean] :translate_names
|
|
237
237
|
#
|
|
238
|
-
#
|
|
238
|
+
# @option state [Boolean] :strictness
|
|
239
239
|
#
|
|
240
|
-
#
|
|
240
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
241
241
|
#
|
|
242
|
-
#
|
|
242
|
+
# @option state [Class<StandardError>] :error
|
|
243
243
|
#
|
|
244
|
-
#
|
|
244
|
+
# @option state [Integer] :branched
|
|
245
245
|
#
|
|
246
246
|
# @return [self, Object]
|
|
247
247
|
def coerce(value, state:)
|
|
@@ -312,7 +312,7 @@ module EInvoiceAPI
|
|
|
312
312
|
#
|
|
313
313
|
# @param state [Hash{Symbol=>Object}] .
|
|
314
314
|
#
|
|
315
|
-
#
|
|
315
|
+
# @option state [Boolean] :can_retry
|
|
316
316
|
#
|
|
317
317
|
# @return [Hash{Object=>Object}, Object]
|
|
318
318
|
def dump(value, state:)
|
|
@@ -37,15 +37,15 @@ module EInvoiceAPI
|
|
|
37
37
|
#
|
|
38
38
|
# @param state [Hash{Symbol=>Object}] .
|
|
39
39
|
#
|
|
40
|
-
#
|
|
40
|
+
# @option state [Boolean] :translate_names
|
|
41
41
|
#
|
|
42
|
-
#
|
|
42
|
+
# @option state [Boolean] :strictness
|
|
43
43
|
#
|
|
44
|
-
#
|
|
44
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
45
45
|
#
|
|
46
|
-
#
|
|
46
|
+
# @option state [Class<StandardError>] :error
|
|
47
47
|
#
|
|
48
|
-
#
|
|
48
|
+
# @option state [Integer] :branched
|
|
49
49
|
#
|
|
50
50
|
# @return [Boolean, Object]
|
|
51
51
|
def coerce(value, state:)
|
|
@@ -60,7 +60,7 @@ module EInvoiceAPI
|
|
|
60
60
|
#
|
|
61
61
|
# @param state [Hash{Symbol=>Object}] .
|
|
62
62
|
#
|
|
63
|
-
#
|
|
63
|
+
# @option state [Boolean] :can_retry
|
|
64
64
|
#
|
|
65
65
|
# @return [Boolean, Object]
|
|
66
66
|
|
|
@@ -15,15 +15,15 @@ module EInvoiceAPI
|
|
|
15
15
|
#
|
|
16
16
|
# @param state [Hash{Symbol=>Object}] .
|
|
17
17
|
#
|
|
18
|
-
#
|
|
18
|
+
# @option state [Boolean] :translate_names
|
|
19
19
|
#
|
|
20
|
-
#
|
|
20
|
+
# @option state [Boolean] :strictness
|
|
21
21
|
#
|
|
22
|
-
#
|
|
22
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
23
23
|
#
|
|
24
|
-
#
|
|
24
|
+
# @option state [Class<StandardError>] :error
|
|
25
25
|
#
|
|
26
|
-
#
|
|
26
|
+
# @option state [Integer] :branched
|
|
27
27
|
#
|
|
28
28
|
# @return [Object]
|
|
29
29
|
def coerce(value, state:) = (raise NotImplementedError)
|
|
@@ -34,7 +34,7 @@ module EInvoiceAPI
|
|
|
34
34
|
#
|
|
35
35
|
# @param state [Hash{Symbol=>Object}] .
|
|
36
36
|
#
|
|
37
|
-
#
|
|
37
|
+
# @option state [Boolean] :can_retry
|
|
38
38
|
#
|
|
39
39
|
# @return [Object]
|
|
40
40
|
def dump(value, state:)
|
|
@@ -74,13 +74,13 @@ module EInvoiceAPI
|
|
|
74
74
|
#
|
|
75
75
|
# @param spec [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class] .
|
|
76
76
|
#
|
|
77
|
-
#
|
|
77
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
78
78
|
#
|
|
79
|
-
#
|
|
79
|
+
# @option spec [Proc] :enum
|
|
80
80
|
#
|
|
81
|
-
#
|
|
81
|
+
# @option spec [Proc] :union
|
|
82
82
|
#
|
|
83
|
-
#
|
|
83
|
+
# @option spec [Boolean] :"nil?"
|
|
84
84
|
#
|
|
85
85
|
# @return [Proc]
|
|
86
86
|
def type_info(spec)
|
|
@@ -102,23 +102,23 @@ module EInvoiceAPI
|
|
|
102
102
|
#
|
|
103
103
|
# @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class] .
|
|
104
104
|
#
|
|
105
|
-
#
|
|
105
|
+
# @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
106
106
|
#
|
|
107
|
-
#
|
|
107
|
+
# @option type_info [Proc] :enum
|
|
108
108
|
#
|
|
109
|
-
#
|
|
109
|
+
# @option type_info [Proc] :union
|
|
110
110
|
#
|
|
111
|
-
#
|
|
111
|
+
# @option type_info [Boolean] :"nil?"
|
|
112
112
|
#
|
|
113
113
|
# @param spec [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class] .
|
|
114
114
|
#
|
|
115
|
-
#
|
|
115
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
116
116
|
#
|
|
117
|
-
#
|
|
117
|
+
# @option spec [Proc] :enum
|
|
118
118
|
#
|
|
119
|
-
#
|
|
119
|
+
# @option spec [Proc] :union
|
|
120
120
|
#
|
|
121
|
-
#
|
|
121
|
+
# @option spec [Boolean] :"nil?"
|
|
122
122
|
#
|
|
123
123
|
# @return [Hash{Symbol=>Object}]
|
|
124
124
|
def meta_info(type_info, spec)
|
|
@@ -173,15 +173,15 @@ module EInvoiceAPI
|
|
|
173
173
|
#
|
|
174
174
|
# See implementation below for more details.
|
|
175
175
|
#
|
|
176
|
-
#
|
|
176
|
+
# @option state [Boolean] :translate_names
|
|
177
177
|
#
|
|
178
|
-
#
|
|
178
|
+
# @option state [Boolean] :strictness
|
|
179
179
|
#
|
|
180
|
-
#
|
|
180
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
181
181
|
#
|
|
182
|
-
#
|
|
182
|
+
# @option state [Class<StandardError>] :error
|
|
183
183
|
#
|
|
184
|
-
#
|
|
184
|
+
# @option state [Integer] :branched
|
|
185
185
|
#
|
|
186
186
|
# @return [Object]
|
|
187
187
|
def coerce(target, value, state: EInvoiceAPI::Internal::Type::Converter.new_coerce_state)
|
|
@@ -276,7 +276,7 @@ module EInvoiceAPI
|
|
|
276
276
|
#
|
|
277
277
|
# @param state [Hash{Symbol=>Object}] .
|
|
278
278
|
#
|
|
279
|
-
#
|
|
279
|
+
# @option state [Boolean] :can_retry
|
|
280
280
|
#
|
|
281
281
|
# @return [Object]
|
|
282
282
|
def dump(target, value, state: {can_retry: true})
|
|
@@ -81,15 +81,15 @@ module EInvoiceAPI
|
|
|
81
81
|
#
|
|
82
82
|
# @param state [Hash{Symbol=>Object}] .
|
|
83
83
|
#
|
|
84
|
-
#
|
|
84
|
+
# @option state [Boolean] :translate_names
|
|
85
85
|
#
|
|
86
|
-
#
|
|
86
|
+
# @option state [Boolean] :strictness
|
|
87
87
|
#
|
|
88
|
-
#
|
|
88
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
89
89
|
#
|
|
90
|
-
#
|
|
90
|
+
# @option state [Class<StandardError>] :error
|
|
91
91
|
#
|
|
92
|
-
#
|
|
92
|
+
# @option state [Integer] :branched
|
|
93
93
|
#
|
|
94
94
|
# @return [Symbol, Object]
|
|
95
95
|
def coerce(value, state:)
|
|
@@ -116,7 +116,7 @@ module EInvoiceAPI
|
|
|
116
116
|
#
|
|
117
117
|
# @param state [Hash{Symbol=>Object}] .
|
|
118
118
|
#
|
|
119
|
-
#
|
|
119
|
+
# @option state [Boolean] :can_retry
|
|
120
120
|
#
|
|
121
121
|
# @return [Symbol, Object]
|
|
122
122
|
|
|
@@ -45,15 +45,15 @@ module EInvoiceAPI
|
|
|
45
45
|
#
|
|
46
46
|
# @param state [Hash{Symbol=>Object}] .
|
|
47
47
|
#
|
|
48
|
-
#
|
|
48
|
+
# @option state [Boolean] :translate_names
|
|
49
49
|
#
|
|
50
|
-
#
|
|
50
|
+
# @option state [Boolean] :strictness
|
|
51
51
|
#
|
|
52
|
-
#
|
|
52
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
53
53
|
#
|
|
54
|
-
#
|
|
54
|
+
# @option state [Class<StandardError>] :error
|
|
55
55
|
#
|
|
56
|
-
#
|
|
56
|
+
# @option state [Integer] :branched
|
|
57
57
|
#
|
|
58
58
|
# @return [StringIO, Object]
|
|
59
59
|
def coerce(value, state:)
|
|
@@ -78,7 +78,7 @@ module EInvoiceAPI
|
|
|
78
78
|
#
|
|
79
79
|
# @param state [Hash{Symbol=>Object}] .
|
|
80
80
|
#
|
|
81
|
-
#
|
|
81
|
+
# @option state [Boolean] :can_retry
|
|
82
82
|
#
|
|
83
83
|
# @return [Pathname, StringIO, IO, String, Object]
|
|
84
84
|
def dump(value, state:)
|
|
@@ -18,9 +18,9 @@ module EInvoiceAPI
|
|
|
18
18
|
|
|
19
19
|
# @overload [](type_info, spec = {})
|
|
20
20
|
#
|
|
21
|
-
#
|
|
21
|
+
# @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class]
|
|
22
22
|
#
|
|
23
|
-
#
|
|
23
|
+
# @param spec [Hash{Symbol=>Object}] .
|
|
24
24
|
#
|
|
25
25
|
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
26
26
|
#
|
|
@@ -77,15 +77,15 @@ module EInvoiceAPI
|
|
|
77
77
|
#
|
|
78
78
|
# @param state [Hash{Symbol=>Object}] .
|
|
79
79
|
#
|
|
80
|
-
#
|
|
80
|
+
# @option state [Boolean] :translate_names
|
|
81
81
|
#
|
|
82
|
-
#
|
|
82
|
+
# @option state [Boolean] :strictness
|
|
83
83
|
#
|
|
84
|
-
#
|
|
84
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
85
85
|
#
|
|
86
|
-
#
|
|
86
|
+
# @option state [Class<StandardError>] :error
|
|
87
87
|
#
|
|
88
|
-
#
|
|
88
|
+
# @option state [Integer] :branched
|
|
89
89
|
#
|
|
90
90
|
# @return [Hash{Symbol=>Object}, Object]
|
|
91
91
|
def coerce(value, state:)
|
|
@@ -122,7 +122,7 @@ module EInvoiceAPI
|
|
|
122
122
|
#
|
|
123
123
|
# @param state [Hash{Symbol=>Object}] .
|
|
124
124
|
#
|
|
125
|
-
#
|
|
125
|
+
# @option state [Boolean] :can_retry
|
|
126
126
|
#
|
|
127
127
|
# @return [Hash{Symbol=>Object}, Object]
|
|
128
128
|
def dump(value, state:)
|
|
@@ -159,13 +159,13 @@ module EInvoiceAPI
|
|
|
159
159
|
#
|
|
160
160
|
# @param spec [Hash{Symbol=>Object}] .
|
|
161
161
|
#
|
|
162
|
-
#
|
|
162
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
163
163
|
#
|
|
164
|
-
#
|
|
164
|
+
# @option spec [Proc] :enum
|
|
165
165
|
#
|
|
166
|
-
#
|
|
166
|
+
# @option spec [Proc] :union
|
|
167
167
|
#
|
|
168
|
-
#
|
|
168
|
+
# @option spec [Boolean] :"nil?"
|
|
169
169
|
def initialize(type_info, spec = {})
|
|
170
170
|
@item_type_fn = EInvoiceAPI::Internal::Type::Converter.type_info(type_info || spec)
|
|
171
171
|
@meta = EInvoiceAPI::Internal::Type::Converter.meta_info(type_info, spec)
|
|
@@ -6,7 +6,7 @@ module EInvoiceAPI
|
|
|
6
6
|
# @api private
|
|
7
7
|
module RequestParameters
|
|
8
8
|
# @!attribute request_options
|
|
9
|
-
#
|
|
9
|
+
# Options to specify HTTP behaviour for this request.
|
|
10
10
|
#
|
|
11
11
|
# @return [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
12
12
|
|
|
@@ -43,13 +43,13 @@ module EInvoiceAPI
|
|
|
43
43
|
#
|
|
44
44
|
# @param spec [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class] .
|
|
45
45
|
#
|
|
46
|
-
#
|
|
46
|
+
# @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
|
|
47
47
|
#
|
|
48
|
-
#
|
|
48
|
+
# @option spec [Proc] :enum
|
|
49
49
|
#
|
|
50
|
-
#
|
|
50
|
+
# @option spec [Proc] :union
|
|
51
51
|
#
|
|
52
|
-
#
|
|
52
|
+
# @option spec [Boolean] :"nil?"
|
|
53
53
|
private def variant(key, spec = nil)
|
|
54
54
|
meta = EInvoiceAPI::Internal::Type::Converter.meta_info(nil, spec)
|
|
55
55
|
variant_info =
|
|
@@ -126,15 +126,15 @@ module EInvoiceAPI
|
|
|
126
126
|
#
|
|
127
127
|
# @param state [Hash{Symbol=>Object}] .
|
|
128
128
|
#
|
|
129
|
-
#
|
|
129
|
+
# @option state [Boolean] :translate_names
|
|
130
130
|
#
|
|
131
|
-
#
|
|
131
|
+
# @option state [Boolean] :strictness
|
|
132
132
|
#
|
|
133
|
-
#
|
|
133
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
134
134
|
#
|
|
135
|
-
#
|
|
135
|
+
# @option state [Class<StandardError>] :error
|
|
136
136
|
#
|
|
137
|
-
#
|
|
137
|
+
# @option state [Integer] :branched
|
|
138
138
|
#
|
|
139
139
|
# @return [Object]
|
|
140
140
|
def coerce(value, state:)
|
|
@@ -182,7 +182,7 @@ module EInvoiceAPI
|
|
|
182
182
|
#
|
|
183
183
|
# @param state [Hash{Symbol=>Object}] .
|
|
184
184
|
#
|
|
185
|
-
#
|
|
185
|
+
# @option state [Boolean] :can_retry
|
|
186
186
|
#
|
|
187
187
|
# @return [Object]
|
|
188
188
|
def dump(value, state:)
|
|
@@ -39,15 +39,15 @@ module EInvoiceAPI
|
|
|
39
39
|
#
|
|
40
40
|
# @param state [Hash{Symbol=>Object}] .
|
|
41
41
|
#
|
|
42
|
-
#
|
|
42
|
+
# @option state [Boolean] :translate_names
|
|
43
43
|
#
|
|
44
|
-
#
|
|
44
|
+
# @option state [Boolean] :strictness
|
|
45
45
|
#
|
|
46
|
-
#
|
|
46
|
+
# @option state [Hash{Symbol=>Object}] :exactness
|
|
47
47
|
#
|
|
48
|
-
#
|
|
48
|
+
# @option state [Class<StandardError>] :error
|
|
49
49
|
#
|
|
50
|
-
#
|
|
50
|
+
# @option state [Integer] :branched
|
|
51
51
|
#
|
|
52
52
|
# @return [Object]
|
|
53
53
|
def coerce(value, state:)
|
|
@@ -62,7 +62,7 @@ module EInvoiceAPI
|
|
|
62
62
|
#
|
|
63
63
|
# @param state [Hash{Symbol=>Object}] .
|
|
64
64
|
#
|
|
65
|
-
#
|
|
65
|
+
# @option state [Boolean] :can_retry
|
|
66
66
|
#
|
|
67
67
|
# @return [Object]
|
|
68
68
|
|
|
@@ -26,48 +26,6 @@ module EInvoiceAPI
|
|
|
26
26
|
.chain([ns])
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
class << self
|
|
30
|
-
# @api private
|
|
31
|
-
#
|
|
32
|
-
# @return [String]
|
|
33
|
-
def arch
|
|
34
|
-
case (arch = RbConfig::CONFIG["arch"])&.downcase
|
|
35
|
-
in nil
|
|
36
|
-
"unknown"
|
|
37
|
-
in /aarch64|arm64/
|
|
38
|
-
"arm64"
|
|
39
|
-
in /x86_64/
|
|
40
|
-
"x64"
|
|
41
|
-
in /arm/
|
|
42
|
-
"arm"
|
|
43
|
-
else
|
|
44
|
-
"other:#{arch}"
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# @api private
|
|
49
|
-
#
|
|
50
|
-
# @return [String]
|
|
51
|
-
def os
|
|
52
|
-
case (host = RbConfig::CONFIG["host_os"])&.downcase
|
|
53
|
-
in nil
|
|
54
|
-
"Unknown"
|
|
55
|
-
in /linux/
|
|
56
|
-
"Linux"
|
|
57
|
-
in /darwin/
|
|
58
|
-
"MacOS"
|
|
59
|
-
in /freebsd/
|
|
60
|
-
"FreeBSD"
|
|
61
|
-
in /openbsd/
|
|
62
|
-
"OpenBSD"
|
|
63
|
-
in /mswin|mingw|cygwin|ucrt/
|
|
64
|
-
"Windows"
|
|
65
|
-
else
|
|
66
|
-
"Other:#{host}"
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
29
|
class << self
|
|
72
30
|
# @api private
|
|
73
31
|
#
|
|
@@ -314,15 +272,15 @@ module EInvoiceAPI
|
|
|
314
272
|
#
|
|
315
273
|
# @param parsed [Hash{Symbol=>String, Integer, nil}] .
|
|
316
274
|
#
|
|
317
|
-
#
|
|
275
|
+
# @option parsed [String, nil] :scheme
|
|
318
276
|
#
|
|
319
|
-
#
|
|
277
|
+
# @option parsed [String, nil] :host
|
|
320
278
|
#
|
|
321
|
-
#
|
|
279
|
+
# @option parsed [Integer, nil] :port
|
|
322
280
|
#
|
|
323
|
-
#
|
|
281
|
+
# @option parsed [String, nil] :path
|
|
324
282
|
#
|
|
325
|
-
#
|
|
283
|
+
# @option parsed [Hash{String=>Array<String>}] :query
|
|
326
284
|
#
|
|
327
285
|
# @return [URI::Generic]
|
|
328
286
|
def unparse_uri(parsed)
|
|
@@ -333,27 +291,27 @@ module EInvoiceAPI
|
|
|
333
291
|
#
|
|
334
292
|
# @param lhs [Hash{Symbol=>String, Integer, nil}] .
|
|
335
293
|
#
|
|
336
|
-
#
|
|
294
|
+
# @option lhs [String, nil] :scheme
|
|
337
295
|
#
|
|
338
|
-
#
|
|
296
|
+
# @option lhs [String, nil] :host
|
|
339
297
|
#
|
|
340
|
-
#
|
|
298
|
+
# @option lhs [Integer, nil] :port
|
|
341
299
|
#
|
|
342
|
-
#
|
|
300
|
+
# @option lhs [String, nil] :path
|
|
343
301
|
#
|
|
344
|
-
#
|
|
302
|
+
# @option lhs [Hash{String=>Array<String>}] :query
|
|
345
303
|
#
|
|
346
304
|
# @param rhs [Hash{Symbol=>String, Integer, nil}] .
|
|
347
305
|
#
|
|
348
|
-
#
|
|
306
|
+
# @option rhs [String, nil] :scheme
|
|
349
307
|
#
|
|
350
|
-
#
|
|
308
|
+
# @option rhs [String, nil] :host
|
|
351
309
|
#
|
|
352
|
-
#
|
|
310
|
+
# @option rhs [Integer, nil] :port
|
|
353
311
|
#
|
|
354
|
-
#
|
|
312
|
+
# @option rhs [String, nil] :path
|
|
355
313
|
#
|
|
356
|
-
#
|
|
314
|
+
# @option rhs [Hash{String=>Array<String>}] :query
|
|
357
315
|
#
|
|
358
316
|
# @return [URI::Generic]
|
|
359
317
|
def join_parsed_uri(lhs, rhs)
|