e-invoice-api 0.1.0.pre.alpha.5

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 (233) hide show
  1. checksums.yaml +7 -0
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +57 -0
  4. data/README.md +285 -0
  5. data/SECURITY.md +27 -0
  6. data/lib/e_invoice_api/client.rb +94 -0
  7. data/lib/e_invoice_api/errors.rb +192 -0
  8. data/lib/e_invoice_api/file_part.rb +55 -0
  9. data/lib/e_invoice_api/internal/documents_number_page.rb +96 -0
  10. data/lib/e_invoice_api/internal/transport/base_client.rb +555 -0
  11. data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +209 -0
  12. data/lib/e_invoice_api/internal/type/array_of.rb +162 -0
  13. data/lib/e_invoice_api/internal/type/base_model.rb +482 -0
  14. data/lib/e_invoice_api/internal/type/base_page.rb +55 -0
  15. data/lib/e_invoice_api/internal/type/boolean.rb +71 -0
  16. data/lib/e_invoice_api/internal/type/converter.rb +292 -0
  17. data/lib/e_invoice_api/internal/type/enum.rb +148 -0
  18. data/lib/e_invoice_api/internal/type/file_input.rb +103 -0
  19. data/lib/e_invoice_api/internal/type/hash_of.rb +182 -0
  20. data/lib/e_invoice_api/internal/type/request_parameters.rb +42 -0
  21. data/lib/e_invoice_api/internal/type/union.rb +236 -0
  22. data/lib/e_invoice_api/internal/type/unknown.rb +75 -0
  23. data/lib/e_invoice_api/internal/util.rb +914 -0
  24. data/lib/e_invoice_api/internal.rb +20 -0
  25. data/lib/e_invoice_api/models/certificate.rb +34 -0
  26. data/lib/e_invoice_api/models/currency_code.rb +28 -0
  27. data/lib/e_invoice_api/models/document_attachment_create.rb +33 -0
  28. data/lib/e_invoice_api/models/document_create.rb +521 -0
  29. data/lib/e_invoice_api/models/document_create_params.rb +14 -0
  30. data/lib/e_invoice_api/models/document_delete_params.rb +14 -0
  31. data/lib/e_invoice_api/models/document_delete_response.rb +16 -0
  32. data/lib/e_invoice_api/models/document_direction.rb +15 -0
  33. data/lib/e_invoice_api/models/document_response.rb +418 -0
  34. data/lib/e_invoice_api/models/document_retrieve_params.rb +14 -0
  35. data/lib/e_invoice_api/models/document_send_params.rb +44 -0
  36. data/lib/e_invoice_api/models/document_state.rb +18 -0
  37. data/lib/e_invoice_api/models/document_type.rb +15 -0
  38. data/lib/e_invoice_api/models/documents/attachment_add_params.rb +22 -0
  39. data/lib/e_invoice_api/models/documents/attachment_delete_params.rb +22 -0
  40. data/lib/e_invoice_api/models/documents/attachment_delete_response.rb +18 -0
  41. data/lib/e_invoice_api/models/documents/attachment_list_params.rb +16 -0
  42. data/lib/e_invoice_api/models/documents/attachment_list_response.rb +11 -0
  43. data/lib/e_invoice_api/models/documents/attachment_retrieve_params.rb +22 -0
  44. data/lib/e_invoice_api/models/documents/document_attachment.rb +44 -0
  45. data/lib/e_invoice_api/models/documents/ubl_get_params.rb +16 -0
  46. data/lib/e_invoice_api/models/documents/ubl_get_response.rb +72 -0
  47. data/lib/e_invoice_api/models/inbox_list_credit_notes_params.rb +30 -0
  48. data/lib/e_invoice_api/models/inbox_list_invoices_params.rb +30 -0
  49. data/lib/e_invoice_api/models/inbox_list_params.rb +78 -0
  50. data/lib/e_invoice_api/models/lookup_retrieve_params.rb +26 -0
  51. data/lib/e_invoice_api/models/lookup_retrieve_response.rb +491 -0
  52. data/lib/e_invoice_api/models/outbox_list_draft_documents_params.rb +30 -0
  53. data/lib/e_invoice_api/models/outbox_list_received_documents_params.rb +78 -0
  54. data/lib/e_invoice_api/models/paginated_document_response.rb +39 -0
  55. data/lib/e_invoice_api/models/payment_detail_create.rb +33 -0
  56. data/lib/e_invoice_api/models/ubl_document_validation.rb +97 -0
  57. data/lib/e_invoice_api/models/unit_of_measure_code.rb +104 -0
  58. data/lib/e_invoice_api/models/validate_validate_json_params.rb +14 -0
  59. data/lib/e_invoice_api/models/validate_validate_peppol_id_params.rb +26 -0
  60. data/lib/e_invoice_api/models/validate_validate_peppol_id_response.rb +80 -0
  61. data/lib/e_invoice_api/models/validate_validate_ubl_params.rb +20 -0
  62. data/lib/e_invoice_api/models/webhook_create_params.rb +32 -0
  63. data/lib/e_invoice_api/models/webhook_delete_params.rb +14 -0
  64. data/lib/e_invoice_api/models/webhook_delete_response.rb +18 -0
  65. data/lib/e_invoice_api/models/webhook_list_params.rb +14 -0
  66. data/lib/e_invoice_api/models/webhook_list_response.rb +8 -0
  67. data/lib/e_invoice_api/models/webhook_response.rb +42 -0
  68. data/lib/e_invoice_api/models/webhook_retrieve_params.rb +14 -0
  69. data/lib/e_invoice_api/models/webhook_update_params.rb +32 -0
  70. data/lib/e_invoice_api/models.rb +105 -0
  71. data/lib/e_invoice_api/request_options.rb +77 -0
  72. data/lib/e_invoice_api/resources/documents/attachments.rb +109 -0
  73. data/lib/e_invoice_api/resources/documents/ubl.rb +35 -0
  74. data/lib/e_invoice_api/resources/documents.rb +188 -0
  75. data/lib/e_invoice_api/resources/inbox.rb +101 -0
  76. data/lib/e_invoice_api/resources/lookup.rb +43 -0
  77. data/lib/e_invoice_api/resources/outbox.rb +76 -0
  78. data/lib/e_invoice_api/resources/validate.rb +168 -0
  79. data/lib/e_invoice_api/resources/webhooks.rb +117 -0
  80. data/lib/e_invoice_api/version.rb +5 -0
  81. data/lib/e_invoice_api.rb +107 -0
  82. data/manifest.yaml +15 -0
  83. data/rbi/e_invoice_api/client.rbi +64 -0
  84. data/rbi/e_invoice_api/errors.rbi +162 -0
  85. data/rbi/e_invoice_api/file_part.rbi +37 -0
  86. data/rbi/e_invoice_api/internal/documents_number_page.rbi +28 -0
  87. data/rbi/e_invoice_api/internal/transport/base_client.rbi +298 -0
  88. data/rbi/e_invoice_api/internal/transport/pooled_net_requester.rbi +80 -0
  89. data/rbi/e_invoice_api/internal/type/array_of.rbi +104 -0
  90. data/rbi/e_invoice_api/internal/type/base_model.rbi +304 -0
  91. data/rbi/e_invoice_api/internal/type/base_page.rbi +43 -0
  92. data/rbi/e_invoice_api/internal/type/boolean.rbi +56 -0
  93. data/rbi/e_invoice_api/internal/type/converter.rbi +162 -0
  94. data/rbi/e_invoice_api/internal/type/enum.rbi +82 -0
  95. data/rbi/e_invoice_api/internal/type/file_input.rbi +59 -0
  96. data/rbi/e_invoice_api/internal/type/hash_of.rbi +104 -0
  97. data/rbi/e_invoice_api/internal/type/request_parameters.rbi +31 -0
  98. data/rbi/e_invoice_api/internal/type/union.rbi +116 -0
  99. data/rbi/e_invoice_api/internal/type/unknown.rbi +56 -0
  100. data/rbi/e_invoice_api/internal/util.rbi +487 -0
  101. data/rbi/e_invoice_api/internal.rbi +18 -0
  102. data/rbi/e_invoice_api/models/certificate.rbi +54 -0
  103. data/rbi/e_invoice_api/models/currency_code.rbi +34 -0
  104. data/rbi/e_invoice_api/models/document_attachment_create.rbi +57 -0
  105. data/rbi/e_invoice_api/models/document_create.rbi +638 -0
  106. data/rbi/e_invoice_api/models/document_create_params.rbi +30 -0
  107. data/rbi/e_invoice_api/models/document_delete_params.rbi +30 -0
  108. data/rbi/e_invoice_api/models/document_delete_response.rbi +26 -0
  109. data/rbi/e_invoice_api/models/document_direction.rbi +22 -0
  110. data/rbi/e_invoice_api/models/document_response.rbi +504 -0
  111. data/rbi/e_invoice_api/models/document_retrieve_params.rbi +30 -0
  112. data/rbi/e_invoice_api/models/document_send_params.rbi +65 -0
  113. data/rbi/e_invoice_api/models/document_state.rbi +24 -0
  114. data/rbi/e_invoice_api/models/document_type.rbi +21 -0
  115. data/rbi/e_invoice_api/models/documents/attachment_add_params.rbi +43 -0
  116. data/rbi/e_invoice_api/models/documents/attachment_delete_params.rbi +43 -0
  117. data/rbi/e_invoice_api/models/documents/attachment_delete_response.rbi +28 -0
  118. data/rbi/e_invoice_api/models/documents/attachment_list_params.rbi +34 -0
  119. data/rbi/e_invoice_api/models/documents/attachment_list_response.rbi +15 -0
  120. data/rbi/e_invoice_api/models/documents/attachment_retrieve_params.rbi +43 -0
  121. data/rbi/e_invoice_api/models/documents/document_attachment.rbi +72 -0
  122. data/rbi/e_invoice_api/models/documents/ubl_get_params.rbi +34 -0
  123. data/rbi/e_invoice_api/models/documents/ubl_get_response.rbi +97 -0
  124. data/rbi/e_invoice_api/models/inbox_list_credit_notes_params.rbi +60 -0
  125. data/rbi/e_invoice_api/models/inbox_list_invoices_params.rbi +60 -0
  126. data/rbi/e_invoice_api/models/inbox_list_params.rbi +105 -0
  127. data/rbi/e_invoice_api/models/lookup_retrieve_params.rbi +45 -0
  128. data/rbi/e_invoice_api/models/lookup_retrieve_response.rbi +852 -0
  129. data/rbi/e_invoice_api/models/outbox_list_draft_documents_params.rbi +60 -0
  130. data/rbi/e_invoice_api/models/outbox_list_received_documents_params.rbi +108 -0
  131. data/rbi/e_invoice_api/models/paginated_document_response.rbi +56 -0
  132. data/rbi/e_invoice_api/models/payment_detail_create.rbi +56 -0
  133. data/rbi/e_invoice_api/models/ubl_document_validation.rbi +159 -0
  134. data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +149 -0
  135. data/rbi/e_invoice_api/models/validate_validate_json_params.rbi +30 -0
  136. data/rbi/e_invoice_api/models/validate_validate_peppol_id_params.rbi +45 -0
  137. data/rbi/e_invoice_api/models/validate_validate_peppol_id_response.rbi +141 -0
  138. data/rbi/e_invoice_api/models/validate_validate_ubl_params.rbi +41 -0
  139. data/rbi/e_invoice_api/models/webhook_create_params.rbi +54 -0
  140. data/rbi/e_invoice_api/models/webhook_delete_params.rbi +30 -0
  141. data/rbi/e_invoice_api/models/webhook_delete_response.rbi +27 -0
  142. data/rbi/e_invoice_api/models/webhook_list_params.rbi +27 -0
  143. data/rbi/e_invoice_api/models/webhook_list_response.rbi +11 -0
  144. data/rbi/e_invoice_api/models/webhook_response.rbi +57 -0
  145. data/rbi/e_invoice_api/models/webhook_retrieve_params.rbi +30 -0
  146. data/rbi/e_invoice_api/models/webhook_update_params.rbi +51 -0
  147. data/rbi/e_invoice_api/models.rbi +70 -0
  148. data/rbi/e_invoice_api/request_options.rbi +59 -0
  149. data/rbi/e_invoice_api/resources/documents/attachments.rbi +58 -0
  150. data/rbi/e_invoice_api/resources/documents/ubl.rbi +24 -0
  151. data/rbi/e_invoice_api/resources/documents.rbi +164 -0
  152. data/rbi/e_invoice_api/resources/inbox.rbi +93 -0
  153. data/rbi/e_invoice_api/resources/lookup.rbi +31 -0
  154. data/rbi/e_invoice_api/resources/outbox.rbi +72 -0
  155. data/rbi/e_invoice_api/resources/validate.rbi +145 -0
  156. data/rbi/e_invoice_api/resources/webhooks.rbi +72 -0
  157. data/rbi/e_invoice_api/version.rbi +5 -0
  158. data/sig/e_invoice_api/client.rbs +36 -0
  159. data/sig/e_invoice_api/errors.rbs +101 -0
  160. data/sig/e_invoice_api/file_part.rbs +21 -0
  161. data/sig/e_invoice_api/internal/documents_number_page.rbs +17 -0
  162. data/sig/e_invoice_api/internal/transport/base_client.rbs +131 -0
  163. data/sig/e_invoice_api/internal/transport/pooled_net_requester.rbs +45 -0
  164. data/sig/e_invoice_api/internal/type/array_of.rbs +48 -0
  165. data/sig/e_invoice_api/internal/type/base_model.rbs +102 -0
  166. data/sig/e_invoice_api/internal/type/base_page.rbs +24 -0
  167. data/sig/e_invoice_api/internal/type/boolean.rbs +26 -0
  168. data/sig/e_invoice_api/internal/type/converter.rbs +56 -0
  169. data/sig/e_invoice_api/internal/type/enum.rbs +32 -0
  170. data/sig/e_invoice_api/internal/type/file_input.rbs +25 -0
  171. data/sig/e_invoice_api/internal/type/hash_of.rbs +48 -0
  172. data/sig/e_invoice_api/internal/type/request_parameters.rbs +19 -0
  173. data/sig/e_invoice_api/internal/type/union.rbs +52 -0
  174. data/sig/e_invoice_api/internal/type/unknown.rbs +26 -0
  175. data/sig/e_invoice_api/internal/util.rbs +185 -0
  176. data/sig/e_invoice_api/internal.rbs +9 -0
  177. data/sig/e_invoice_api/models/certificate.rbs +26 -0
  178. data/sig/e_invoice_api/models/currency_code.rbs +42 -0
  179. data/sig/e_invoice_api/models/document_attachment_create.rbs +39 -0
  180. data/sig/e_invoice_api/models/document_create.rbs +403 -0
  181. data/sig/e_invoice_api/models/document_create_params.rbs +15 -0
  182. data/sig/e_invoice_api/models/document_delete_params.rbs +15 -0
  183. data/sig/e_invoice_api/models/document_delete_response.rbs +13 -0
  184. data/sig/e_invoice_api/models/document_direction.rbs +14 -0
  185. data/sig/e_invoice_api/models/document_response.rbs +358 -0
  186. data/sig/e_invoice_api/models/document_retrieve_params.rbs +15 -0
  187. data/sig/e_invoice_api/models/document_send_params.rbs +46 -0
  188. data/sig/e_invoice_api/models/document_state.rbs +17 -0
  189. data/sig/e_invoice_api/models/document_type.rbs +14 -0
  190. data/sig/e_invoice_api/models/documents/attachment_add_params.rbs +26 -0
  191. data/sig/e_invoice_api/models/documents/attachment_delete_params.rbs +26 -0
  192. data/sig/e_invoice_api/models/documents/attachment_delete_response.rbs +15 -0
  193. data/sig/e_invoice_api/models/documents/attachment_list_params.rbs +17 -0
  194. data/sig/e_invoice_api/models/documents/attachment_list_response.rbs +10 -0
  195. data/sig/e_invoice_api/models/documents/attachment_retrieve_params.rbs +26 -0
  196. data/sig/e_invoice_api/models/documents/document_attachment.rbs +48 -0
  197. data/sig/e_invoice_api/models/documents/ubl_get_params.rbs +17 -0
  198. data/sig/e_invoice_api/models/documents/ubl_get_response.rbs +69 -0
  199. data/sig/e_invoice_api/models/inbox_list_credit_notes_params.rbs +32 -0
  200. data/sig/e_invoice_api/models/inbox_list_invoices_params.rbs +32 -0
  201. data/sig/e_invoice_api/models/inbox_list_params.rbs +65 -0
  202. data/sig/e_invoice_api/models/lookup_retrieve_params.rbs +23 -0
  203. data/sig/e_invoice_api/models/lookup_retrieve_response.rbs +365 -0
  204. data/sig/e_invoice_api/models/outbox_list_draft_documents_params.rbs +32 -0
  205. data/sig/e_invoice_api/models/outbox_list_received_documents_params.rbs +65 -0
  206. data/sig/e_invoice_api/models/paginated_document_response.rbs +40 -0
  207. data/sig/e_invoice_api/models/payment_detail_create.rbs +35 -0
  208. data/sig/e_invoice_api/models/ubl_document_validation.rbs +98 -0
  209. data/sig/e_invoice_api/models/unit_of_measure_code.rbs +192 -0
  210. data/sig/e_invoice_api/models/validate_validate_json_params.rbs +15 -0
  211. data/sig/e_invoice_api/models/validate_validate_peppol_id_params.rbs +23 -0
  212. data/sig/e_invoice_api/models/validate_validate_peppol_id_response.rbs +65 -0
  213. data/sig/e_invoice_api/models/validate_validate_ubl_params.rbs +24 -0
  214. data/sig/e_invoice_api/models/webhook_create_params.rbs +34 -0
  215. data/sig/e_invoice_api/models/webhook_delete_params.rbs +15 -0
  216. data/sig/e_invoice_api/models/webhook_delete_response.rbs +13 -0
  217. data/sig/e_invoice_api/models/webhook_list_params.rbs +15 -0
  218. data/sig/e_invoice_api/models/webhook_list_response.rbs +7 -0
  219. data/sig/e_invoice_api/models/webhook_response.rbs +42 -0
  220. data/sig/e_invoice_api/models/webhook_retrieve_params.rbs +15 -0
  221. data/sig/e_invoice_api/models/webhook_update_params.rbs +32 -0
  222. data/sig/e_invoice_api/models.rbs +65 -0
  223. data/sig/e_invoice_api/request_options.rbs +36 -0
  224. data/sig/e_invoice_api/resources/documents/attachments.rbs +32 -0
  225. data/sig/e_invoice_api/resources/documents/ubl.rbs +14 -0
  226. data/sig/e_invoice_api/resources/documents.rbs +76 -0
  227. data/sig/e_invoice_api/resources/inbox.rbs +31 -0
  228. data/sig/e_invoice_api/resources/lookup.rbs +12 -0
  229. data/sig/e_invoice_api/resources/outbox.rbs +25 -0
  230. data/sig/e_invoice_api/resources/validate.rbs +62 -0
  231. data/sig/e_invoice_api/resources/webhooks.rbs +36 -0
  232. data/sig/e_invoice_api/version.rbs +3 -0
  233. metadata +290 -0
@@ -0,0 +1,101 @@
1
+ module EInvoiceAPI
2
+ module Errors
3
+ class Error < StandardError
4
+ attr_accessor cause: StandardError?
5
+ end
6
+
7
+ class ConversionError < EInvoiceAPI::Errors::Error
8
+ end
9
+
10
+ class APIError < EInvoiceAPI::Errors::Error
11
+ attr_accessor url: URI::Generic
12
+
13
+ attr_accessor status: Integer?
14
+
15
+ attr_accessor body: top?
16
+
17
+ def initialize: (
18
+ url: URI::Generic,
19
+ ?status: Integer?,
20
+ ?body: Object?,
21
+ ?request: nil,
22
+ ?response: nil,
23
+ ?message: String?
24
+ ) -> void
25
+ end
26
+
27
+ class APIConnectionError < EInvoiceAPI::Errors::APIError
28
+ def initialize: (
29
+ url: URI::Generic,
30
+ ?status: nil,
31
+ ?body: nil,
32
+ ?request: nil,
33
+ ?response: nil,
34
+ ?message: String?
35
+ ) -> void
36
+ end
37
+
38
+ class APITimeoutError < EInvoiceAPI::Errors::APIConnectionError
39
+ def initialize: (
40
+ url: URI::Generic,
41
+ ?status: nil,
42
+ ?body: nil,
43
+ ?request: nil,
44
+ ?response: nil,
45
+ ?message: String?
46
+ ) -> void
47
+ end
48
+
49
+ class APIStatusError < EInvoiceAPI::Errors::APIError
50
+ def self.for: (
51
+ url: URI::Generic,
52
+ status: Integer,
53
+ body: Object?,
54
+ request: nil,
55
+ response: nil,
56
+ ?message: String?
57
+ ) -> instance
58
+
59
+ def initialize: (
60
+ url: URI::Generic,
61
+ status: Integer,
62
+ body: Object?,
63
+ request: nil,
64
+ response: nil,
65
+ ?message: String?
66
+ ) -> void
67
+ end
68
+
69
+ class BadRequestError < EInvoiceAPI::Errors::APIStatusError
70
+ HTTP_STATUS: 400
71
+ end
72
+
73
+ class AuthenticationError < EInvoiceAPI::Errors::APIStatusError
74
+ HTTP_STATUS: 401
75
+ end
76
+
77
+ class PermissionDeniedError < EInvoiceAPI::Errors::APIStatusError
78
+ HTTP_STATUS: 403
79
+ end
80
+
81
+ class NotFoundError < EInvoiceAPI::Errors::APIStatusError
82
+ HTTP_STATUS: 404
83
+ end
84
+
85
+ class ConflictError < EInvoiceAPI::Errors::APIStatusError
86
+ HTTP_STATUS: 409
87
+ end
88
+
89
+ class UnprocessableEntityError < EInvoiceAPI::Errors::APIStatusError
90
+ HTTP_STATUS: 422
91
+ end
92
+
93
+ class RateLimitError < EInvoiceAPI::Errors::APIStatusError
94
+ HTTP_STATUS: 429
95
+ end
96
+
97
+ class InternalServerError < EInvoiceAPI::Errors::APIStatusError
98
+ HTTP_STATUS: Range[Integer]
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,21 @@
1
+ module EInvoiceAPI
2
+ class FilePart
3
+ attr_reader content: Pathname | StringIO | IO | String
4
+
5
+ attr_reader content_type: String?
6
+
7
+ attr_reader filename: String?
8
+
9
+ private def read: -> String
10
+
11
+ def to_json: (*top a) -> String
12
+
13
+ def to_yaml: (*top a) -> String
14
+
15
+ def initialize: (
16
+ Pathname | StringIO | IO | String content,
17
+ ?filename: String?,
18
+ ?content_type: String?
19
+ ) -> void
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ class DocumentsNumberPage[Elem]
4
+ include EInvoiceAPI::Internal::Type::BasePage[Elem]
5
+
6
+ attr_accessor items: ::Array[Elem]?
7
+
8
+ attr_accessor page: Integer
9
+
10
+ attr_accessor page_size: Integer
11
+
12
+ attr_accessor total: Integer
13
+
14
+ def inspect: -> String
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,131 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Transport
4
+ class BaseClient
5
+ extend EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
6
+
7
+ type request_components =
8
+ {
9
+ method: Symbol,
10
+ path: String | ::Array[String],
11
+ query: ::Hash[String, (::Array[String] | String)?]?,
12
+ headers: ::Hash[String, (String
13
+ | Integer
14
+ | ::Array[(String | Integer)?])?]?,
15
+ body: top?,
16
+ unwrap: (Symbol
17
+ | Integer
18
+ | ::Array[(Symbol | Integer)]
19
+ | (^(top arg0) -> top))?,
20
+ page: Class?,
21
+ stream: Class?,
22
+ model: EInvoiceAPI::Internal::Type::Converter::input?,
23
+ options: EInvoiceAPI::request_opts?
24
+ }
25
+ type request_input =
26
+ {
27
+ method: Symbol,
28
+ url: URI::Generic,
29
+ headers: ::Hash[String, String],
30
+ body: top,
31
+ max_retries: Integer,
32
+ timeout: Float
33
+ }
34
+
35
+ MAX_REDIRECTS: 20
36
+
37
+ PLATFORM_HEADERS: ::Hash[String, String]
38
+
39
+ def self.validate!: (
40
+ EInvoiceAPI::Internal::Transport::BaseClient::request_components req
41
+ ) -> void
42
+
43
+ def self.should_retry?: (
44
+ Integer status,
45
+ headers: ::Hash[String, String]
46
+ ) -> bool
47
+
48
+ def self.follow_redirect: (
49
+ EInvoiceAPI::Internal::Transport::BaseClient::request_input request,
50
+ status: Integer,
51
+ response_headers: ::Hash[String, String]
52
+ ) -> EInvoiceAPI::Internal::Transport::BaseClient::request_input
53
+
54
+ def self.reap_connection!: (
55
+ Integer | EInvoiceAPI::Errors::APIConnectionError status,
56
+ stream: Enumerable[String]?
57
+ ) -> void
58
+
59
+ attr_reader base_url: URI::Generic
60
+
61
+ attr_reader timeout: Float
62
+
63
+ attr_reader max_retries: Integer
64
+
65
+ attr_reader initial_retry_delay: Float
66
+
67
+ attr_reader max_retry_delay: Float
68
+
69
+ attr_reader headers: ::Hash[String, String]
70
+
71
+ attr_reader idempotency_header: String?
72
+
73
+ # @api private
74
+ attr_reader requester: EInvoiceAPI::Internal::Transport::PooledNetRequester
75
+
76
+ def initialize: (
77
+ base_url: String,
78
+ ?timeout: Float,
79
+ ?max_retries: Integer,
80
+ ?initial_retry_delay: Float,
81
+ ?max_retry_delay: Float,
82
+ ?headers: ::Hash[String, (String
83
+ | Integer
84
+ | ::Array[(String | Integer)?])?],
85
+ ?idempotency_header: String?
86
+ ) -> void
87
+
88
+ private def auth_headers: -> ::Hash[String, String]
89
+
90
+ private def generate_idempotency_key: -> String
91
+
92
+ private def build_request: (
93
+ EInvoiceAPI::Internal::Transport::BaseClient::request_components req,
94
+ EInvoiceAPI::request_options opts
95
+ ) -> EInvoiceAPI::Internal::Transport::BaseClient::request_input
96
+
97
+ private def retry_delay: (
98
+ ::Hash[String, String] headers,
99
+ retry_count: Integer
100
+ ) -> Float
101
+
102
+ private def send_request: (
103
+ EInvoiceAPI::Internal::Transport::BaseClient::request_input request,
104
+ redirect_count: Integer,
105
+ retry_count: Integer,
106
+ send_retry_header: bool
107
+ ) -> [Integer, top, Enumerable[String]]
108
+
109
+ def request: (
110
+ Symbol method,
111
+ String | ::Array[String] path,
112
+ ?query: ::Hash[String, (::Array[String] | String)?]?,
113
+ ?headers: ::Hash[String, (String
114
+ | Integer
115
+ | ::Array[(String | Integer)?])?]?,
116
+ ?body: top?,
117
+ ?unwrap: (Symbol
118
+ | Integer
119
+ | ::Array[(Symbol | Integer)]
120
+ | (^(top arg0) -> top))?,
121
+ ?page: Class?,
122
+ ?stream: Class?,
123
+ ?model: EInvoiceAPI::Internal::Type::Converter::input?,
124
+ ?options: EInvoiceAPI::request_opts?
125
+ ) -> top
126
+
127
+ def inspect: -> String
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,45 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Transport
4
+ class PooledNetRequester
5
+ extend EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
6
+
7
+ type request =
8
+ {
9
+ method: Symbol,
10
+ url: URI::Generic,
11
+ headers: ::Hash[String, String],
12
+ body: top,
13
+ deadline: Float
14
+ }
15
+
16
+ KEEP_ALIVE_TIMEOUT: 30
17
+
18
+ DEFAULT_MAX_CONNECTIONS: Integer
19
+
20
+ def self.connect: (URI::Generic url) -> top
21
+
22
+ def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
23
+
24
+ def self.build_request: (
25
+ EInvoiceAPI::Internal::Transport::PooledNetRequester::request request
26
+ ) {
27
+ (String arg0) -> void
28
+ } -> [top, (^-> void)]
29
+
30
+ private def with_pool: (
31
+ URI::Generic url,
32
+ deadline: Float
33
+ ) {
34
+ (top arg0) -> void
35
+ } -> void
36
+
37
+ def execute: (
38
+ EInvoiceAPI::Internal::Transport::PooledNetRequester::request request
39
+ ) -> [Integer, top, Enumerable[String]]
40
+
41
+ def initialize: (?size: Integer) -> void
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,48 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ class ArrayOf[Elem]
5
+ include EInvoiceAPI::Internal::Type::Converter
6
+ include EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
7
+
8
+ def self.[]: (
9
+ ::Hash[Symbol, top]
10
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
11
+ | EInvoiceAPI::Internal::Type::Converter::input type_info,
12
+ ?::Hash[Symbol, top] spec
13
+ ) -> instance
14
+
15
+ def ===: (top other) -> bool
16
+
17
+ def ==: (top other) -> bool
18
+
19
+ def hash: -> Integer
20
+
21
+ def coerce: (
22
+ ::Array[top] | top value,
23
+ state: EInvoiceAPI::Internal::Type::Converter::coerce_state
24
+ ) -> (::Array[top] | top)
25
+
26
+ def dump: (
27
+ ::Array[top] | top value,
28
+ state: EInvoiceAPI::Internal::Type::Converter::dump_state
29
+ ) -> (::Array[top] | top)
30
+
31
+ def to_sorbet_type: -> top
32
+
33
+ def item_type: -> Elem
34
+
35
+ def nilable?: -> bool
36
+
37
+ def initialize: (
38
+ ::Hash[Symbol, top]
39
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
40
+ | EInvoiceAPI::Internal::Type::Converter::input type_info,
41
+ ?::Hash[Symbol, top] spec
42
+ ) -> void
43
+
44
+ def inspect: (?depth: Integer) -> String
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,102 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ class BaseModel
5
+ extend EInvoiceAPI::Internal::Type::Converter
6
+ extend EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
7
+
8
+ type known_field =
9
+ { mode: (:coerce | :dump)?, required: bool, nilable: bool }
10
+
11
+ def self.inherited: (self child) -> void
12
+
13
+ def self.known_fields: -> ::Hash[Symbol, (EInvoiceAPI::Internal::Type::BaseModel::known_field
14
+ & { type_fn: (^-> EInvoiceAPI::Internal::Type::Converter::input) })]
15
+
16
+ def self.fields: -> ::Hash[Symbol, (EInvoiceAPI::Internal::Type::BaseModel::known_field
17
+ & { type: EInvoiceAPI::Internal::Type::Converter::input })]
18
+
19
+ private def self.add_field: (
20
+ Symbol name_sym,
21
+ required: bool,
22
+ type_info: {
23
+ const: (nil | bool | Integer | Float | Symbol)?,
24
+ enum: ^-> EInvoiceAPI::Internal::Type::Converter::input?,
25
+ union: ^-> EInvoiceAPI::Internal::Type::Converter::input?,
26
+ api_name: Symbol
27
+ }
28
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
29
+ | EInvoiceAPI::Internal::Type::Converter::input,
30
+ spec: ::Hash[Symbol, top]
31
+ ) -> void
32
+
33
+ def self.required: (
34
+ Symbol name_sym,
35
+ ::Hash[Symbol, top]
36
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
37
+ | EInvoiceAPI::Internal::Type::Converter::input type_info,
38
+ ?::Hash[Symbol, top] spec
39
+ ) -> void
40
+
41
+ def self.optional: (
42
+ Symbol name_sym,
43
+ ::Hash[Symbol, top]
44
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
45
+ | EInvoiceAPI::Internal::Type::Converter::input type_info,
46
+ ?::Hash[Symbol, top] spec
47
+ ) -> void
48
+
49
+ private def self.request_only: { -> void } -> void
50
+
51
+ private def self.response_only: { -> void } -> void
52
+
53
+ def self.==: (top other) -> bool
54
+
55
+ def self.hash: -> Integer
56
+
57
+ def ==: (top other) -> bool
58
+
59
+ def hash: -> Integer
60
+
61
+ def self.coerce: (
62
+ EInvoiceAPI::Internal::Type::BaseModel | ::Hash[top, top] | top value,
63
+ state: EInvoiceAPI::Internal::Type::Converter::coerce_state
64
+ ) -> (instance | top)
65
+
66
+ def self.dump: (
67
+ instance | top value,
68
+ state: EInvoiceAPI::Internal::Type::Converter::dump_state
69
+ ) -> (::Hash[top, top] | top)
70
+
71
+ def self.to_sorbet_type: -> top
72
+
73
+ def self.recursively_to_h: (
74
+ EInvoiceAPI::Internal::Type::BaseModel model,
75
+ convert: bool
76
+ ) -> ::Hash[Symbol, top]
77
+
78
+ def []: (Symbol key) -> top?
79
+
80
+ def to_h: -> ::Hash[Symbol, top]
81
+
82
+ alias to_hash to_h
83
+
84
+ def deep_to_h: -> ::Hash[Symbol, top]
85
+
86
+ def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top]
87
+
88
+ def to_json: (*top a) -> String
89
+
90
+ def to_yaml: (*top a) -> String
91
+
92
+ def initialize: (?::Hash[Symbol, top] | instance data) -> void
93
+
94
+ def self.inspect: (?depth: Integer) -> String
95
+
96
+ def to_s: -> String
97
+
98
+ def inspect: -> String
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,24 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ module BasePage[Elem]
5
+ def next_page?: -> bool
6
+
7
+ def next_page: -> instance
8
+
9
+ def auto_paging_each: { (Elem arg0) -> void } -> void
10
+
11
+ def to_enum: -> Enumerable[Elem]
12
+
13
+ alias enum_for to_enum
14
+
15
+ def initialize: (
16
+ client: EInvoiceAPI::Internal::Transport::BaseClient,
17
+ req: EInvoiceAPI::Internal::Transport::BaseClient::request_components,
18
+ headers: ::Hash[String, String],
19
+ page_data: top
20
+ ) -> void
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,26 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ class Boolean
5
+ extend EInvoiceAPI::Internal::Type::Converter
6
+ extend EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
7
+
8
+ def self.===: (top other) -> bool
9
+
10
+ def self.==: (top other) -> bool
11
+
12
+ def self.coerce: (
13
+ bool | top value,
14
+ state: EInvoiceAPI::Internal::Type::Converter::coerce_state
15
+ ) -> (bool | top)
16
+
17
+ def self.dump: (
18
+ bool | top value,
19
+ state: EInvoiceAPI::Internal::Type::Converter::dump_state
20
+ ) -> (bool | top)
21
+
22
+ def self.to_sorbet_type: -> top
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,56 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ module Converter
5
+ extend EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
6
+
7
+ type input = EInvoiceAPI::Internal::Type::Converter | Class
8
+
9
+ type coerce_state =
10
+ {
11
+ strictness: bool | :strong,
12
+ exactness: { yes: Integer, no: Integer, maybe: Integer },
13
+ branched: Integer
14
+ }
15
+
16
+ type dump_state = { can_retry: bool }
17
+
18
+ def coerce: (
19
+ top value,
20
+ state: EInvoiceAPI::Internal::Type::Converter::coerce_state
21
+ ) -> top
22
+
23
+ def dump: (
24
+ top value,
25
+ state: EInvoiceAPI::Internal::Type::Converter::dump_state
26
+ ) -> top
27
+
28
+ def inspect: (?depth: Integer) -> String
29
+
30
+ def self.type_info: (
31
+ {
32
+ const: (nil | bool | Integer | Float | Symbol)?,
33
+ enum: ^-> EInvoiceAPI::Internal::Type::Converter::input?,
34
+ union: ^-> EInvoiceAPI::Internal::Type::Converter::input?
35
+ }
36
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
37
+ | EInvoiceAPI::Internal::Type::Converter::input spec
38
+ ) -> (^-> top)
39
+
40
+ def self.coerce: (
41
+ EInvoiceAPI::Internal::Type::Converter::input target,
42
+ top value,
43
+ ?state: EInvoiceAPI::Internal::Type::Converter::coerce_state
44
+ ) -> top
45
+
46
+ def self.dump: (
47
+ EInvoiceAPI::Internal::Type::Converter::input target,
48
+ top value,
49
+ ?state: EInvoiceAPI::Internal::Type::Converter::dump_state
50
+ ) -> top
51
+
52
+ def self.inspect: (top target, depth: Integer) -> String
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,32 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ module Enum
5
+ include EInvoiceAPI::Internal::Type::Converter
6
+ include EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
7
+
8
+ def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)]
9
+
10
+ def ===: (top other) -> bool
11
+
12
+ def ==: (top other) -> bool
13
+
14
+ def hash: -> Integer
15
+
16
+ def coerce: (
17
+ String | Symbol | top value,
18
+ state: EInvoiceAPI::Internal::Type::Converter::coerce_state
19
+ ) -> (Symbol | top)
20
+
21
+ def dump: (
22
+ Symbol | top value,
23
+ state: EInvoiceAPI::Internal::Type::Converter::dump_state
24
+ ) -> (Symbol | top)
25
+
26
+ def to_sorbet_type: -> top
27
+
28
+ def inspect: (?depth: Integer) -> String
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,25 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ class FileInput
5
+ extend EInvoiceAPI::Internal::Type::Converter
6
+
7
+ def self.===: (top other) -> bool
8
+
9
+ def self.==: (top other) -> bool
10
+
11
+ def self.coerce: (
12
+ StringIO | String | top value,
13
+ state: EInvoiceAPI::Internal::Type::Converter::coerce_state
14
+ ) -> (StringIO | top)
15
+
16
+ def self.dump: (
17
+ Pathname | StringIO | IO | String | top value,
18
+ state: EInvoiceAPI::Internal::Type::Converter::dump_state
19
+ ) -> (Pathname | StringIO | IO | String | top)
20
+
21
+ def self.to_sorbet_type: -> top
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,48 @@
1
+ module EInvoiceAPI
2
+ module Internal
3
+ module Type
4
+ class HashOf[Elem]
5
+ include EInvoiceAPI::Internal::Type::Converter
6
+ include EInvoiceAPI::Internal::Util::SorbetRuntimeSupport
7
+
8
+ def self.[]: (
9
+ ::Hash[Symbol, top]
10
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
11
+ | EInvoiceAPI::Internal::Type::Converter::input type_info,
12
+ ?::Hash[Symbol, top] spec
13
+ ) -> instance
14
+
15
+ def ===: (top other) -> bool
16
+
17
+ def ==: (top other) -> bool
18
+
19
+ def hash: -> Integer
20
+
21
+ def coerce: (
22
+ ::Hash[top, top] | top value,
23
+ state: EInvoiceAPI::Internal::Type::Converter::coerce_state
24
+ ) -> (::Hash[Symbol, top] | top)
25
+
26
+ def dump: (
27
+ ::Hash[top, top] | top value,
28
+ state: EInvoiceAPI::Internal::Type::Converter::dump_state
29
+ ) -> (::Hash[Symbol, top] | top)
30
+
31
+ def to_sorbet_type: -> top
32
+
33
+ def item_type: -> Elem
34
+
35
+ def nilable?: -> bool
36
+
37
+ def initialize: (
38
+ ::Hash[Symbol, top]
39
+ | ^-> EInvoiceAPI::Internal::Type::Converter::input
40
+ | EInvoiceAPI::Internal::Type::Converter::input type_info,
41
+ ?::Hash[Symbol, top] spec
42
+ ) -> void
43
+
44
+ def inspect: (?depth: Integer) -> String
45
+ end
46
+ end
47
+ end
48
+ end