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.
- 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/client.rb +16 -0
- 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/conversion/document_create_from_pdf_task.rb +43 -0
- data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
- data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
- data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
- data/lib/e_invoice_api/models/document_create.rb +203 -17
- data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +153 -17
- data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
- data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
- data/lib/e_invoice_api/models/document_response.rb +161 -21
- data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
- data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
- data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
- data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
- data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
- data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
- data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
- data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
- data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
- data/lib/e_invoice_api/models/payment_detail_create.rb +8 -4
- data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
- data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
- data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
- data/lib/e_invoice_api/models/unit_of_measure_code.rb +1349 -0
- data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
- data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
- data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
- data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
- data/lib/e_invoice_api/models.rb +24 -0
- data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
- data/lib/e_invoice_api/resources/conversion.rb +18 -0
- 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 +130 -69
- data/lib/e_invoice_api/resources/drafts.rb +55 -0
- 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 +123 -0
- 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 +47 -0
- data/lib/e_invoice_api/resources/validate.rb +76 -56
- data/lib/e_invoice_api/resources/webhooks.rb +59 -14
- data/lib/e_invoice_api/version.rb +1 -1
- data/lib/e_invoice_api.rb +25 -1
- data/rbi/e_invoice_api/client.rbi +12 -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/conversion/document_create_from_pdf_task.rbi +108 -0
- data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
- data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
- data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
- data/rbi/e_invoice_api/models/document_create.rbi +366 -15
- data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +280 -15
- data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
- data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
- data/rbi/e_invoice_api/models/document_response.rbi +292 -19
- data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
- data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
- data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
- data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
- data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
- data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
- data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
- data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
- data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
- data/rbi/e_invoice_api/models/payment_detail_create.rbi +12 -4
- data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
- data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
- data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
- data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1349 -0
- data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
- data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
- data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
- data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
- data/rbi/e_invoice_api/models.rbi +25 -0
- data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
- data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
- data/rbi/e_invoice_api/resources/documents.rbi +77 -5
- data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
- data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
- data/rbi/e_invoice_api/resources/stats.rbi +38 -0
- data/rbi/e_invoice_api/resources/validate.rbi +52 -6
- data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
- data/sig/e_invoice_api/client.rbs +8 -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/conversion/document_create_from_pdf_task.rbs +45 -0
- data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
- data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
- data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
- data/sig/e_invoice_api/models/document_create.rbs +139 -4
- data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +113 -4
- data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
- data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
- data/sig/e_invoice_api/models/document_response.rbs +113 -4
- data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
- data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
- data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
- data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
- data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
- data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
- data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
- data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
- data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
- data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
- data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2698 -0
- data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
- data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
- data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
- data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
- data/sig/e_invoice_api/models.rbs +24 -0
- data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
- data/sig/e_invoice_api/resources/conversion.rbs +9 -0
- data/sig/e_invoice_api/resources/documents.rbs +19 -0
- data/sig/e_invoice_api/resources/drafts.rbs +20 -0
- data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
- data/sig/e_invoice_api/resources/stats.rbs +14 -0
- data/sig/e_invoice_api/resources/validate.rbs +9 -0
- data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
- metadata +102 -7
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Models
|
|
5
|
+
class StatsRetrieveResponse < EInvoiceAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
EInvoiceAPI::Models::StatsRetrieveResponse,
|
|
10
|
+
EInvoiceAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# List of action statistics, one entry per aggregation period per action
|
|
15
|
+
sig do
|
|
16
|
+
returns(T::Array[EInvoiceAPI::Models::StatsRetrieveResponse::Action])
|
|
17
|
+
end
|
|
18
|
+
attr_accessor :actions
|
|
19
|
+
|
|
20
|
+
# Aggregation type used
|
|
21
|
+
sig do
|
|
22
|
+
returns(
|
|
23
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation::TaggedSymbol
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
attr_accessor :aggregation
|
|
27
|
+
|
|
28
|
+
# Average daily usage (total actions / total days)
|
|
29
|
+
sig { returns(Float) }
|
|
30
|
+
attr_accessor :average_daily_usage
|
|
31
|
+
|
|
32
|
+
# End date of the period
|
|
33
|
+
sig { returns(Date) }
|
|
34
|
+
attr_accessor :period_end
|
|
35
|
+
|
|
36
|
+
# Start date of the period
|
|
37
|
+
sig { returns(Date) }
|
|
38
|
+
attr_accessor :period_start
|
|
39
|
+
|
|
40
|
+
# Tenant ID
|
|
41
|
+
sig { returns(String) }
|
|
42
|
+
attr_accessor :tenant_id
|
|
43
|
+
|
|
44
|
+
# Number of days in the period
|
|
45
|
+
sig { returns(Integer) }
|
|
46
|
+
attr_accessor :total_days
|
|
47
|
+
|
|
48
|
+
# Estimated days until credits run out (credit_balance / average_daily_usage). 0.0
|
|
49
|
+
# if average_daily_usage is 0 or credit_balance is None
|
|
50
|
+
sig { returns(T.nilable(Float)) }
|
|
51
|
+
attr_reader :budget_estimation_days
|
|
52
|
+
|
|
53
|
+
sig { params(budget_estimation_days: Float).void }
|
|
54
|
+
attr_writer :budget_estimation_days
|
|
55
|
+
|
|
56
|
+
# Statistics response for a tenant.
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
actions:
|
|
60
|
+
T::Array[
|
|
61
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::OrHash
|
|
62
|
+
],
|
|
63
|
+
aggregation:
|
|
64
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation::OrSymbol,
|
|
65
|
+
average_daily_usage: Float,
|
|
66
|
+
period_end: Date,
|
|
67
|
+
period_start: Date,
|
|
68
|
+
tenant_id: String,
|
|
69
|
+
total_days: Integer,
|
|
70
|
+
budget_estimation_days: Float
|
|
71
|
+
).returns(T.attached_class)
|
|
72
|
+
end
|
|
73
|
+
def self.new(
|
|
74
|
+
# List of action statistics, one entry per aggregation period per action
|
|
75
|
+
actions:,
|
|
76
|
+
# Aggregation type used
|
|
77
|
+
aggregation:,
|
|
78
|
+
# Average daily usage (total actions / total days)
|
|
79
|
+
average_daily_usage:,
|
|
80
|
+
# End date of the period
|
|
81
|
+
period_end:,
|
|
82
|
+
# Start date of the period
|
|
83
|
+
period_start:,
|
|
84
|
+
# Tenant ID
|
|
85
|
+
tenant_id:,
|
|
86
|
+
# Number of days in the period
|
|
87
|
+
total_days:,
|
|
88
|
+
# Estimated days until credits run out (credit_balance / average_daily_usage). 0.0
|
|
89
|
+
# if average_daily_usage is 0 or credit_balance is None
|
|
90
|
+
budget_estimation_days: nil
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
sig do
|
|
95
|
+
override.returns(
|
|
96
|
+
{
|
|
97
|
+
actions:
|
|
98
|
+
T::Array[EInvoiceAPI::Models::StatsRetrieveResponse::Action],
|
|
99
|
+
aggregation:
|
|
100
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation::TaggedSymbol,
|
|
101
|
+
average_daily_usage: Float,
|
|
102
|
+
period_end: Date,
|
|
103
|
+
period_start: Date,
|
|
104
|
+
tenant_id: String,
|
|
105
|
+
total_days: Integer,
|
|
106
|
+
budget_estimation_days: Float
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
def to_hash
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
class Action < EInvoiceAPI::Internal::Type::BaseModel
|
|
114
|
+
OrHash =
|
|
115
|
+
T.type_alias do
|
|
116
|
+
T.any(
|
|
117
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action,
|
|
118
|
+
EInvoiceAPI::Internal::AnyHash
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Type of action
|
|
123
|
+
sig do
|
|
124
|
+
returns(
|
|
125
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action::TaggedSymbol
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
attr_accessor :action
|
|
129
|
+
|
|
130
|
+
# Number of occurrences of this action in this period
|
|
131
|
+
sig { returns(Integer) }
|
|
132
|
+
attr_accessor :count
|
|
133
|
+
|
|
134
|
+
# The date/period this stat represents. For DAY aggregation this is the specific
|
|
135
|
+
# day, for WEEK it's the start of the week, for MONTH it's the first day of the
|
|
136
|
+
# month
|
|
137
|
+
sig { returns(Date) }
|
|
138
|
+
attr_accessor :stat_date
|
|
139
|
+
|
|
140
|
+
# Statistics for a specific action in a specific time period.
|
|
141
|
+
sig do
|
|
142
|
+
params(
|
|
143
|
+
action:
|
|
144
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action::OrSymbol,
|
|
145
|
+
count: Integer,
|
|
146
|
+
stat_date: Date
|
|
147
|
+
).returns(T.attached_class)
|
|
148
|
+
end
|
|
149
|
+
def self.new(
|
|
150
|
+
# Type of action
|
|
151
|
+
action:,
|
|
152
|
+
# Number of occurrences of this action in this period
|
|
153
|
+
count:,
|
|
154
|
+
# The date/period this stat represents. For DAY aggregation this is the specific
|
|
155
|
+
# day, for WEEK it's the start of the week, for MONTH it's the first day of the
|
|
156
|
+
# month
|
|
157
|
+
stat_date:
|
|
158
|
+
)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
sig do
|
|
162
|
+
override.returns(
|
|
163
|
+
{
|
|
164
|
+
action:
|
|
165
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action::TaggedSymbol,
|
|
166
|
+
count: Integer,
|
|
167
|
+
stat_date: Date
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
end
|
|
171
|
+
def to_hash
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Type of action
|
|
175
|
+
module Action
|
|
176
|
+
extend EInvoiceAPI::Internal::Type::Enum
|
|
177
|
+
|
|
178
|
+
TaggedSymbol =
|
|
179
|
+
T.type_alias do
|
|
180
|
+
T.all(
|
|
181
|
+
Symbol,
|
|
182
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action
|
|
183
|
+
)
|
|
184
|
+
end
|
|
185
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
186
|
+
|
|
187
|
+
DOCUMENT_SENT =
|
|
188
|
+
T.let(
|
|
189
|
+
:DOCUMENT_SENT,
|
|
190
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action::TaggedSymbol
|
|
191
|
+
)
|
|
192
|
+
DOCUMENT_RECEIVED =
|
|
193
|
+
T.let(
|
|
194
|
+
:DOCUMENT_RECEIVED,
|
|
195
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action::TaggedSymbol
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
sig do
|
|
199
|
+
override.returns(
|
|
200
|
+
T::Array[
|
|
201
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Action::Action::TaggedSymbol
|
|
202
|
+
]
|
|
203
|
+
)
|
|
204
|
+
end
|
|
205
|
+
def self.values
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Aggregation type used
|
|
211
|
+
module Aggregation
|
|
212
|
+
extend EInvoiceAPI::Internal::Type::Enum
|
|
213
|
+
|
|
214
|
+
TaggedSymbol =
|
|
215
|
+
T.type_alias do
|
|
216
|
+
T.all(
|
|
217
|
+
Symbol,
|
|
218
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation
|
|
219
|
+
)
|
|
220
|
+
end
|
|
221
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
222
|
+
|
|
223
|
+
DAY =
|
|
224
|
+
T.let(
|
|
225
|
+
:DAY,
|
|
226
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation::TaggedSymbol
|
|
227
|
+
)
|
|
228
|
+
WEEK =
|
|
229
|
+
T.let(
|
|
230
|
+
:WEEK,
|
|
231
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation::TaggedSymbol
|
|
232
|
+
)
|
|
233
|
+
MONTH =
|
|
234
|
+
T.let(
|
|
235
|
+
:MONTH,
|
|
236
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation::TaggedSymbol
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
sig do
|
|
240
|
+
override.returns(
|
|
241
|
+
T::Array[
|
|
242
|
+
EInvoiceAPI::Models::StatsRetrieveResponse::Aggregation::TaggedSymbol
|
|
243
|
+
]
|
|
244
|
+
)
|
|
245
|
+
end
|
|
246
|
+
def self.values
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
end
|
|
@@ -23,6 +23,8 @@ module EInvoiceAPI
|
|
|
23
23
|
sig { returns(T::Array[EInvoiceAPI::UblDocumentValidation::Issue]) }
|
|
24
24
|
attr_accessor :issues
|
|
25
25
|
|
|
26
|
+
# The UBL document as an XML string, returned whenever it could be generated, also
|
|
27
|
+
# when the document is not valid. Only is_valid tells whether it is valid.
|
|
26
28
|
sig { returns(T.nilable(String)) }
|
|
27
29
|
attr_accessor :ubl_document
|
|
28
30
|
|
|
@@ -35,7 +37,15 @@ module EInvoiceAPI
|
|
|
35
37
|
ubl_document: T.nilable(String)
|
|
36
38
|
).returns(T.attached_class)
|
|
37
39
|
end
|
|
38
|
-
def self.new(
|
|
40
|
+
def self.new(
|
|
41
|
+
id:,
|
|
42
|
+
file_name:,
|
|
43
|
+
is_valid:,
|
|
44
|
+
issues:,
|
|
45
|
+
# The UBL document as an XML string, returned whenever it could be generated, also
|
|
46
|
+
# when the document is not valid. Only is_valid tells whether it is valid.
|
|
47
|
+
ubl_document: nil
|
|
48
|
+
)
|
|
39
49
|
end
|
|
40
50
|
|
|
41
51
|
sig do
|