e-invoice-api 0.33.0 → 0.35.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.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/LICENSE +201 -0
  4. data/README.md +18 -7
  5. data/SECURITY.md +6 -16
  6. data/lib/e_invoice_api/client.rb +16 -0
  7. data/lib/e_invoice_api/internal/transport/base_client.rb +43 -78
  8. data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +8 -8
  9. data/lib/e_invoice_api/internal/type/array_of.rb +12 -12
  10. data/lib/e_invoice_api/internal/type/base_model.rb +18 -18
  11. data/lib/e_invoice_api/internal/type/boolean.rb +6 -6
  12. data/lib/e_invoice_api/internal/type/converter.rb +24 -24
  13. data/lib/e_invoice_api/internal/type/enum.rb +6 -6
  14. data/lib/e_invoice_api/internal/type/file_input.rb +6 -6
  15. data/lib/e_invoice_api/internal/type/hash_of.rb +12 -12
  16. data/lib/e_invoice_api/internal/type/request_parameters.rb +1 -1
  17. data/lib/e_invoice_api/internal/type/union.rb +10 -10
  18. data/lib/e_invoice_api/internal/type/unknown.rb +6 -6
  19. data/lib/e_invoice_api/internal/util.rb +15 -57
  20. data/lib/e_invoice_api/models/conversion/document_create_from_pdf_task.rb +43 -0
  21. data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
  22. data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
  23. data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
  24. data/lib/e_invoice_api/models/document_create.rb +203 -17
  25. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +153 -17
  26. data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
  27. data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
  28. data/lib/e_invoice_api/models/document_response.rb +161 -21
  29. data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
  30. data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
  31. data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
  32. data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
  33. data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
  34. data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
  35. data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
  36. data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
  37. data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
  38. data/lib/e_invoice_api/models/payment_detail_create.rb +8 -4
  39. data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
  40. data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
  41. data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
  42. data/lib/e_invoice_api/models/unit_of_measure_code.rb +1349 -0
  43. data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
  44. data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
  45. data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
  46. data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
  47. data/lib/e_invoice_api/models.rb +24 -0
  48. data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
  49. data/lib/e_invoice_api/resources/conversion.rb +18 -0
  50. data/lib/e_invoice_api/resources/documents/attachments.rb +11 -11
  51. data/lib/e_invoice_api/resources/documents/ubl.rb +4 -4
  52. data/lib/e_invoice_api/resources/documents.rb +130 -69
  53. data/lib/e_invoice_api/resources/drafts.rb +55 -0
  54. data/lib/e_invoice_api/resources/inbox.rb +20 -20
  55. data/lib/e_invoice_api/resources/lookup.rb +5 -5
  56. data/lib/e_invoice_api/resources/mailbox.rb +123 -0
  57. data/lib/e_invoice_api/resources/me.rb +1 -1
  58. data/lib/e_invoice_api/resources/outbox.rb +19 -19
  59. data/lib/e_invoice_api/resources/stats.rb +47 -0
  60. data/lib/e_invoice_api/resources/validate.rb +76 -56
  61. data/lib/e_invoice_api/resources/webhooks.rb +59 -14
  62. data/lib/e_invoice_api/version.rb +1 -1
  63. data/lib/e_invoice_api.rb +25 -1
  64. data/rbi/e_invoice_api/client.rbi +12 -0
  65. data/rbi/e_invoice_api/internal/transport/base_client.rbi +2 -10
  66. data/rbi/e_invoice_api/internal/util.rbi +0 -12
  67. data/rbi/e_invoice_api/models/conversion/document_create_from_pdf_task.rbi +108 -0
  68. data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
  69. data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
  70. data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
  71. data/rbi/e_invoice_api/models/document_create.rbi +366 -15
  72. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +280 -15
  73. data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
  74. data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
  75. data/rbi/e_invoice_api/models/document_response.rbi +292 -19
  76. data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
  77. data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
  78. data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
  79. data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
  80. data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
  81. data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
  82. data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
  83. data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
  84. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
  85. data/rbi/e_invoice_api/models/payment_detail_create.rbi +12 -4
  86. data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
  87. data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
  88. data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
  89. data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1349 -0
  90. data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
  91. data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
  92. data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
  93. data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
  94. data/rbi/e_invoice_api/models.rbi +25 -0
  95. data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
  96. data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
  97. data/rbi/e_invoice_api/resources/documents.rbi +77 -5
  98. data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
  99. data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
  100. data/rbi/e_invoice_api/resources/stats.rbi +38 -0
  101. data/rbi/e_invoice_api/resources/validate.rbi +52 -6
  102. data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
  103. data/sig/e_invoice_api/client.rbs +8 -0
  104. data/sig/e_invoice_api/internal/transport/base_client.rbs +1 -4
  105. data/sig/e_invoice_api/internal/util.rbs +0 -4
  106. data/sig/e_invoice_api/models/conversion/document_create_from_pdf_task.rbs +45 -0
  107. data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
  108. data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
  109. data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
  110. data/sig/e_invoice_api/models/document_create.rbs +139 -4
  111. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +113 -4
  112. data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
  113. data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
  114. data/sig/e_invoice_api/models/document_response.rbs +113 -4
  115. data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
  116. data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
  117. data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
  118. data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
  119. data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
  120. data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
  121. data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
  122. data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
  123. data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
  124. data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
  125. data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2698 -0
  126. data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
  127. data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
  128. data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
  129. data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
  130. data/sig/e_invoice_api/models.rbs +24 -0
  131. data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
  132. data/sig/e_invoice_api/resources/conversion.rbs +9 -0
  133. data/sig/e_invoice_api/resources/documents.rbs +19 -0
  134. data/sig/e_invoice_api/resources/drafts.rbs +20 -0
  135. data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
  136. data/sig/e_invoice_api/resources/stats.rbs +14 -0
  137. data/sig/e_invoice_api/resources/validate.rbs +9 -0
  138. data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
  139. metadata +102 -7
@@ -18,9 +18,9 @@ module EInvoiceAPI
18
18
 
19
19
  # @overload [](type_info, spec = {})
20
20
  #
21
- # @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class]
21
+ # @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class]
22
22
  #
23
- # @param spec [Hash{Symbol=>Object}] .
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
- # @option state [Boolean] :translate_names
65
+ # @option state [Boolean] :translate_names
66
66
  #
67
- # @option state [Boolean] :strictness
67
+ # @option state [Boolean] :strictness
68
68
  #
69
- # @option state [Hash{Symbol=>Object}] :exactness
69
+ # @option state [Hash{Symbol=>Object}] :exactness
70
70
  #
71
- # @option state [Class<StandardError>] :error
71
+ # @option state [Class<StandardError>] :error
72
72
  #
73
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
142
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
143
143
  #
144
- # @option spec [Proc] :enum
144
+ # @option spec [Proc] :enum
145
145
  #
146
- # @option spec [Proc] :union
146
+ # @option spec [Proc] :union
147
147
  #
148
- # @option spec [Boolean] :"nil?"
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
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
47
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
48
48
  #
49
- # @option spec [Proc] :enum
49
+ # @option spec [Proc] :enum
50
50
  #
51
- # @option spec [Proc] :union
51
+ # @option spec [Proc] :union
52
52
  #
53
- # @option spec [Boolean] :"nil?"
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
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
147
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
148
148
  #
149
- # @option spec [Proc] :enum
149
+ # @option spec [Proc] :enum
150
150
  #
151
- # @option spec [Proc] :union
151
+ # @option spec [Proc] :union
152
152
  #
153
- # @option spec [Boolean] :"nil?"
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
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
166
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
167
167
  #
168
- # @option spec [Proc] :enum
168
+ # @option spec [Proc] :enum
169
169
  #
170
- # @option spec [Proc] :union
170
+ # @option spec [Proc] :union
171
171
  #
172
- # @option spec [Boolean] :"nil?"
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
- # @option state [Boolean] :translate_names
236
+ # @option state [Boolean] :translate_names
237
237
  #
238
- # @option state [Boolean] :strictness
238
+ # @option state [Boolean] :strictness
239
239
  #
240
- # @option state [Hash{Symbol=>Object}] :exactness
240
+ # @option state [Hash{Symbol=>Object}] :exactness
241
241
  #
242
- # @option state [Class<StandardError>] :error
242
+ # @option state [Class<StandardError>] :error
243
243
  #
244
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option state [Boolean] :translate_names
40
+ # @option state [Boolean] :translate_names
41
41
  #
42
- # @option state [Boolean] :strictness
42
+ # @option state [Boolean] :strictness
43
43
  #
44
- # @option state [Hash{Symbol=>Object}] :exactness
44
+ # @option state [Hash{Symbol=>Object}] :exactness
45
45
  #
46
- # @option state [Class<StandardError>] :error
46
+ # @option state [Class<StandardError>] :error
47
47
  #
48
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option state [Boolean] :translate_names
18
+ # @option state [Boolean] :translate_names
19
19
  #
20
- # @option state [Boolean] :strictness
20
+ # @option state [Boolean] :strictness
21
21
  #
22
- # @option state [Hash{Symbol=>Object}] :exactness
22
+ # @option state [Hash{Symbol=>Object}] :exactness
23
23
  #
24
- # @option state [Class<StandardError>] :error
24
+ # @option state [Class<StandardError>] :error
25
25
  #
26
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
77
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
78
78
  #
79
- # @option spec [Proc] :enum
79
+ # @option spec [Proc] :enum
80
80
  #
81
- # @option spec [Proc] :union
81
+ # @option spec [Proc] :union
82
82
  #
83
- # @option spec [Boolean] :"nil?"
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
- # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
105
+ # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
106
106
  #
107
- # @option type_info [Proc] :enum
107
+ # @option type_info [Proc] :enum
108
108
  #
109
- # @option type_info [Proc] :union
109
+ # @option type_info [Proc] :union
110
110
  #
111
- # @option type_info [Boolean] :"nil?"
111
+ # @option type_info [Boolean] :"nil?"
112
112
  #
113
113
  # @param spec [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class] .
114
114
  #
115
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
115
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
116
116
  #
117
- # @option spec [Proc] :enum
117
+ # @option spec [Proc] :enum
118
118
  #
119
- # @option spec [Proc] :union
119
+ # @option spec [Proc] :union
120
120
  #
121
- # @option spec [Boolean] :"nil?"
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
- # @option state [Boolean] :translate_names
176
+ # @option state [Boolean] :translate_names
177
177
  #
178
- # @option state [Boolean] :strictness
178
+ # @option state [Boolean] :strictness
179
179
  #
180
- # @option state [Hash{Symbol=>Object}] :exactness
180
+ # @option state [Hash{Symbol=>Object}] :exactness
181
181
  #
182
- # @option state [Class<StandardError>] :error
182
+ # @option state [Class<StandardError>] :error
183
183
  #
184
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option state [Boolean] :translate_names
84
+ # @option state [Boolean] :translate_names
85
85
  #
86
- # @option state [Boolean] :strictness
86
+ # @option state [Boolean] :strictness
87
87
  #
88
- # @option state [Hash{Symbol=>Object}] :exactness
88
+ # @option state [Hash{Symbol=>Object}] :exactness
89
89
  #
90
- # @option state [Class<StandardError>] :error
90
+ # @option state [Class<StandardError>] :error
91
91
  #
92
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option state [Boolean] :translate_names
48
+ # @option state [Boolean] :translate_names
49
49
  #
50
- # @option state [Boolean] :strictness
50
+ # @option state [Boolean] :strictness
51
51
  #
52
- # @option state [Hash{Symbol=>Object}] :exactness
52
+ # @option state [Hash{Symbol=>Object}] :exactness
53
53
  #
54
- # @option state [Class<StandardError>] :error
54
+ # @option state [Class<StandardError>] :error
55
55
  #
56
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class]
21
+ # @param type_info [Hash{Symbol=>Object}, Proc, EInvoiceAPI::Internal::Type::Converter, Class]
22
22
  #
23
- # @param spec [Hash{Symbol=>Object}] .
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
- # @option state [Boolean] :translate_names
80
+ # @option state [Boolean] :translate_names
81
81
  #
82
- # @option state [Boolean] :strictness
82
+ # @option state [Boolean] :strictness
83
83
  #
84
- # @option state [Hash{Symbol=>Object}] :exactness
84
+ # @option state [Hash{Symbol=>Object}] :exactness
85
85
  #
86
- # @option state [Class<StandardError>] :error
86
+ # @option state [Class<StandardError>] :error
87
87
  #
88
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
162
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
163
163
  #
164
- # @option spec [Proc] :enum
164
+ # @option spec [Proc] :enum
165
165
  #
166
- # @option spec [Proc] :union
166
+ # @option spec [Proc] :union
167
167
  #
168
- # @option spec [Boolean] :"nil?"
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
- # Options to specify HTTP behaviour for this request.
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
- # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
46
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
47
47
  #
48
- # @option spec [Proc] :enum
48
+ # @option spec [Proc] :enum
49
49
  #
50
- # @option spec [Proc] :union
50
+ # @option spec [Proc] :union
51
51
  #
52
- # @option spec [Boolean] :"nil?"
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
- # @option state [Boolean] :translate_names
129
+ # @option state [Boolean] :translate_names
130
130
  #
131
- # @option state [Boolean] :strictness
131
+ # @option state [Boolean] :strictness
132
132
  #
133
- # @option state [Hash{Symbol=>Object}] :exactness
133
+ # @option state [Hash{Symbol=>Object}] :exactness
134
134
  #
135
- # @option state [Class<StandardError>] :error
135
+ # @option state [Class<StandardError>] :error
136
136
  #
137
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option state [Boolean] :translate_names
42
+ # @option state [Boolean] :translate_names
43
43
  #
44
- # @option state [Boolean] :strictness
44
+ # @option state [Boolean] :strictness
45
45
  #
46
- # @option state [Hash{Symbol=>Object}] :exactness
46
+ # @option state [Hash{Symbol=>Object}] :exactness
47
47
  #
48
- # @option state [Class<StandardError>] :error
48
+ # @option state [Class<StandardError>] :error
49
49
  #
50
- # @option state [Integer] :branched
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
- # @option state [Boolean] :can_retry
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
- # @option parsed [String, nil] :scheme
275
+ # @option parsed [String, nil] :scheme
318
276
  #
319
- # @option parsed [String, nil] :host
277
+ # @option parsed [String, nil] :host
320
278
  #
321
- # @option parsed [Integer, nil] :port
279
+ # @option parsed [Integer, nil] :port
322
280
  #
323
- # @option parsed [String, nil] :path
281
+ # @option parsed [String, nil] :path
324
282
  #
325
- # @option parsed [Hash{String=>Array<String>}] :query
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
- # @option lhs [String, nil] :scheme
294
+ # @option lhs [String, nil] :scheme
337
295
  #
338
- # @option lhs [String, nil] :host
296
+ # @option lhs [String, nil] :host
339
297
  #
340
- # @option lhs [Integer, nil] :port
298
+ # @option lhs [Integer, nil] :port
341
299
  #
342
- # @option lhs [String, nil] :path
300
+ # @option lhs [String, nil] :path
343
301
  #
344
- # @option lhs [Hash{String=>Array<String>}] :query
302
+ # @option lhs [Hash{String=>Array<String>}] :query
345
303
  #
346
304
  # @param rhs [Hash{Symbol=>String, Integer, nil}] .
347
305
  #
348
- # @option rhs [String, nil] :scheme
306
+ # @option rhs [String, nil] :scheme
349
307
  #
350
- # @option rhs [String, nil] :host
308
+ # @option rhs [String, nil] :host
351
309
  #
352
- # @option rhs [Integer, nil] :port
310
+ # @option rhs [Integer, nil] :port
353
311
  #
354
- # @option rhs [String, nil] :path
312
+ # @option rhs [String, nil] :path
355
313
  #
356
- # @option rhs [Hash{String=>Array<String>}] :query
314
+ # @option rhs [Hash{String=>Array<String>}] :query
357
315
  #
358
316
  # @return [URI::Generic]
359
317
  def join_parsed_uri(lhs, rhs)
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ module Conversion
6
+ # @see EInvoiceAPI::Resources::Conversion::Pdf#create
7
+ class DocumentCreateFromPdfTask < EInvoiceAPI::Internal::Type::BaseModel
8
+ # @!attribute task_id
9
+ # The ID of the task that will process the PDF
10
+ #
11
+ # @return [String]
12
+ required :task_id, String
13
+
14
+ # @!attribute status
15
+ # The status of the task
16
+ #
17
+ # @return [Symbol, EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::Status, nil]
18
+ optional :status, enum: -> { EInvoiceAPI::Conversion::DocumentCreateFromPdfTask::Status }
19
+
20
+ # @!method initialize(task_id:, status: nil)
21
+ # @param task_id [String] The ID of the task that will process the PDF
22
+ #
23
+ # @param status [Symbol, EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::Status] The status of the task
24
+
25
+ # The status of the task
26
+ #
27
+ # @see EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask#status
28
+ module Status
29
+ extend EInvoiceAPI::Internal::Type::Enum
30
+
31
+ PENDING = :pending
32
+ COMPLETED = :completed
33
+ FAILED = :failed
34
+
35
+ # @!method self.values
36
+ # @return [Array<Symbol>]
37
+ end
38
+ end
39
+ end
40
+
41
+ DocumentCreateFromPdfTask = Conversion::DocumentCreateFromPdfTask
42
+ end
43
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ module Conversion
6
+ # @see EInvoiceAPI::Resources::Conversion::Pdf#create
7
+ class PdfCreateParams < EInvoiceAPI::Internal::Type::BaseModel
8
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
9
+ include EInvoiceAPI::Internal::Type::RequestParameters
10
+
11
+ # @!attribute file
12
+ #
13
+ # @return [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
14
+ required :file, EInvoiceAPI::Internal::Type::FileInput
15
+
16
+ # @!method initialize(file:, request_options: {})
17
+ # @param file [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
18
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end