metronome-sdk 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -0
- data/README.md +1 -1
- data/lib/metronome_sdk/errors.rb +25 -11
- data/lib/metronome_sdk/file_part.rb +10 -7
- data/lib/metronome_sdk/internal/body_cursor_page.rb +1 -1
- data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
- data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +1 -1
- data/lib/metronome_sdk/internal/transport/base_client.rb +11 -7
- data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +7 -10
- data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
- data/lib/metronome_sdk/internal/type/enum.rb +25 -0
- data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
- data/lib/metronome_sdk/internal/util.rb +8 -7
- data/lib/metronome_sdk/models/contract_v2.rb +256 -6
- data/lib/metronome_sdk/models/contract_without_amendments.rb +2 -2
- data/lib/metronome_sdk/models/hierarchy_configuration.rb +99 -2
- data/lib/metronome_sdk/models/payment_gate_config.rb +1 -0
- data/lib/metronome_sdk/models/payment_gate_config_v2.rb +1 -0
- data/lib/metronome_sdk/models/subscription.rb +85 -1
- data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
- data/lib/metronome_sdk/models/v1/alert_create_params.rb +38 -36
- data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -0
- data/lib/metronome_sdk/models/v1/contract_create_params.rb +101 -3
- data/lib/metronome_sdk/models/v1/customer_detail.rb +9 -1
- data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +5 -15
- data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
- data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +3 -3
- data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
- data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +12 -12
- data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +40 -38
- data/lib/metronome_sdk/models/v1/customers/invoice.rb +136 -18
- data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
- data/lib/metronome_sdk/models/v1/payment.rb +151 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
- data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
- data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
- data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
- data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +9 -1
- data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +9 -1
- data/lib/metronome_sdk/models/v2/contract_edit_params.rb +186 -3
- data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +195 -8
- data/lib/metronome_sdk/resources/v1/alerts.rb +57 -53
- data/lib/metronome_sdk/resources/v1/contracts.rb +4 -3
- data/lib/metronome_sdk/resources/v1/customers/alerts.rb +70 -51
- data/lib/metronome_sdk/resources/v1/customers/invoices.rb +55 -0
- data/lib/metronome_sdk/resources/v1/customers.rb +7 -4
- data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
- data/lib/metronome_sdk/resources/v1/usage.rb +4 -2
- data/lib/metronome_sdk/resources/v1.rb +4 -0
- data/lib/metronome_sdk/resources/v2/contracts.rb +9 -3
- data/lib/metronome_sdk/version.rb +1 -1
- data/lib/metronome_sdk.rb +9 -0
- data/rbi/metronome_sdk/errors.rbi +29 -2
- data/rbi/metronome_sdk/file_part.rbi +1 -1
- data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
- data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
- data/rbi/metronome_sdk/internal/util.rbi +1 -1
- data/rbi/metronome_sdk/models/contract_v2.rbi +603 -10
- data/rbi/metronome_sdk/models/contract_without_amendments.rbi +2 -2
- data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +250 -6
- data/rbi/metronome_sdk/models/payment_gate_config.rbi +5 -0
- data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +5 -0
- data/rbi/metronome_sdk/models/subscription.rbi +175 -0
- data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
- data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +51 -47
- data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +5 -0
- data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +257 -4
- data/rbi/metronome_sdk/models/v1/customer_detail.rbi +8 -0
- data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
- data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
- data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
- data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
- data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +14 -14
- data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +48 -44
- data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +246 -58
- data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
- data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
- data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
- data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
- data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +18 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +18 -0
- data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +498 -6
- data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +462 -14
- data/rbi/metronome_sdk/resources/v1/alerts.rbi +68 -64
- data/rbi/metronome_sdk/resources/v1/contracts.rbi +4 -3
- data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +73 -54
- data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +36 -0
- data/rbi/metronome_sdk/resources/v1/customers.rbi +7 -4
- data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
- data/rbi/metronome_sdk/resources/v1/usage.rbi +4 -2
- data/rbi/metronome_sdk/resources/v1.rbi +3 -0
- data/rbi/metronome_sdk/resources/v2/contracts.rbi +14 -0
- data/sig/metronome_sdk/errors.rbs +7 -0
- data/sig/metronome_sdk/file_part.rbs +1 -1
- data/sig/metronome_sdk/models/contract_v2.rbs +239 -12
- data/sig/metronome_sdk/models/hierarchy_configuration.rbs +87 -6
- data/sig/metronome_sdk/models/payment_gate_config.rbs +2 -1
- data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +2 -1
- data/sig/metronome_sdk/models/subscription.rbs +80 -0
- data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +2 -1
- data/sig/metronome_sdk/models/v1/contract_create_params.rbs +91 -5
- data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
- data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
- data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
- data/sig/metronome_sdk/models/v1/customers/invoice.rbs +137 -24
- data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
- data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
- data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
- data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
- data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
- data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +9 -0
- data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +9 -0
- data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +182 -7
- data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +221 -18
- data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
- data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
- data/sig/metronome_sdk/resources/v1.rbs +2 -0
- data/sig/metronome_sdk/resources/v2/contracts.rbs +3 -0
- metadata +29 -2
|
@@ -12,8 +12,8 @@ module MetronomeSDK
|
|
|
12
12
|
required :alert, -> { MetronomeSDK::V1::Customers::CustomerAlert::Alert }
|
|
13
13
|
|
|
14
14
|
# @!attribute customer_status
|
|
15
|
-
# The status of the
|
|
16
|
-
# returned.
|
|
15
|
+
# The status of the threshold notification. If the notification is archived, null
|
|
16
|
+
# will be returned.
|
|
17
17
|
#
|
|
18
18
|
# @return [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::CustomerStatus, nil]
|
|
19
19
|
required :customer_status,
|
|
@@ -21,7 +21,7 @@ module MetronomeSDK
|
|
|
21
21
|
nil?: true
|
|
22
22
|
|
|
23
23
|
# @!attribute triggered_by
|
|
24
|
-
# If present, indicates the reason the
|
|
24
|
+
# If present, indicates the reason the threshold notification was triggered.
|
|
25
25
|
#
|
|
26
26
|
# @return [String, nil]
|
|
27
27
|
optional :triggered_by, String, nil?: true
|
|
@@ -32,52 +32,53 @@ module MetronomeSDK
|
|
|
32
32
|
#
|
|
33
33
|
# @param alert [MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert]
|
|
34
34
|
#
|
|
35
|
-
# @param customer_status [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::CustomerStatus, nil] The status of the
|
|
35
|
+
# @param customer_status [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::CustomerStatus, nil] The status of the threshold notification. If the notification is archived, null
|
|
36
36
|
#
|
|
37
|
-
# @param triggered_by [String, nil] If present, indicates the reason the
|
|
37
|
+
# @param triggered_by [String, nil] If present, indicates the reason the threshold notification was triggered.
|
|
38
38
|
|
|
39
39
|
# @see MetronomeSDK::Models::V1::Customers::CustomerAlert#alert
|
|
40
40
|
class Alert < MetronomeSDK::Internal::Type::BaseModel
|
|
41
41
|
# @!attribute id
|
|
42
|
-
# the Metronome ID of the
|
|
42
|
+
# the Metronome ID of the threshold notification
|
|
43
43
|
#
|
|
44
44
|
# @return [String]
|
|
45
45
|
required :id, String
|
|
46
46
|
|
|
47
47
|
# @!attribute name
|
|
48
|
-
# Name of the
|
|
48
|
+
# Name of the threshold notification
|
|
49
49
|
#
|
|
50
50
|
# @return [String]
|
|
51
51
|
required :name, String
|
|
52
52
|
|
|
53
53
|
# @!attribute status
|
|
54
|
-
# Status of the
|
|
54
|
+
# Status of the threshold notification
|
|
55
55
|
#
|
|
56
56
|
# @return [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::Status]
|
|
57
57
|
required :status, enum: -> { MetronomeSDK::V1::Customers::CustomerAlert::Alert::Status }
|
|
58
58
|
|
|
59
59
|
# @!attribute threshold
|
|
60
|
-
# Threshold value of the
|
|
60
|
+
# Threshold value of the notification policy
|
|
61
61
|
#
|
|
62
62
|
# @return [Float]
|
|
63
63
|
required :threshold, Float
|
|
64
64
|
|
|
65
65
|
# @!attribute type
|
|
66
|
-
# Type of the
|
|
66
|
+
# Type of the threshold notification
|
|
67
67
|
#
|
|
68
68
|
# @return [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::Type]
|
|
69
69
|
required :type, enum: -> { MetronomeSDK::V1::Customers::CustomerAlert::Alert::Type }
|
|
70
70
|
|
|
71
71
|
# @!attribute updated_at
|
|
72
|
-
# Timestamp for when the
|
|
72
|
+
# Timestamp for when the threshold notification was last updated
|
|
73
73
|
#
|
|
74
74
|
# @return [Time]
|
|
75
75
|
required :updated_at, Time
|
|
76
76
|
|
|
77
77
|
# @!attribute credit_grant_type_filters
|
|
78
|
-
# An array of strings, representing a way to filter the credit grant this
|
|
79
|
-
# applies to, by looking at the credit_grant_type field on
|
|
80
|
-
# field is only defined for CreditPercentage and
|
|
78
|
+
# An array of strings, representing a way to filter the credit grant this
|
|
79
|
+
# threshold notification applies to, by looking at the credit_grant_type field on
|
|
80
|
+
# the credit grant. This field is only defined for CreditPercentage and
|
|
81
|
+
# CreditBalance notifications
|
|
81
82
|
#
|
|
82
83
|
# @return [Array<String>, nil]
|
|
83
84
|
optional :credit_grant_type_filters, MetronomeSDK::Internal::Type::ArrayOf[String]
|
|
@@ -88,30 +89,31 @@ module MetronomeSDK
|
|
|
88
89
|
optional :credit_type, -> { MetronomeSDK::CreditTypeData }, nil?: true
|
|
89
90
|
|
|
90
91
|
# @!attribute custom_field_filters
|
|
91
|
-
# A list of custom field filters for
|
|
92
|
+
# A list of custom field filters for notification types that support advanced
|
|
93
|
+
# filtering
|
|
92
94
|
#
|
|
93
95
|
# @return [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::CustomFieldFilter>, nil]
|
|
94
96
|
optional :custom_field_filters,
|
|
95
97
|
-> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Customers::CustomerAlert::Alert::CustomFieldFilter] }
|
|
96
98
|
|
|
97
99
|
# @!attribute group_key_filter
|
|
98
|
-
# Scopes
|
|
99
|
-
# items. Only present for spend
|
|
100
|
+
# Scopes threshold notification evaluation to a specific presentation group key on
|
|
101
|
+
# individual line items. Only present for spend notifications.
|
|
100
102
|
#
|
|
101
103
|
# @return [MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupKeyFilter, nil]
|
|
102
104
|
optional :group_key_filter, -> { MetronomeSDK::V1::Customers::CustomerAlert::Alert::GroupKeyFilter }
|
|
103
105
|
|
|
104
106
|
# @!attribute group_values
|
|
105
|
-
# Only present for `spend_threshold_reached`
|
|
106
|
-
# group key on individual line items.
|
|
107
|
+
# Only present for `spend_threshold_reached` notifications. Scope notification to
|
|
108
|
+
# a specific group key on individual line items.
|
|
107
109
|
#
|
|
108
110
|
# @return [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupValue>, nil]
|
|
109
111
|
optional :group_values,
|
|
110
112
|
-> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Customers::CustomerAlert::Alert::GroupValue] }
|
|
111
113
|
|
|
112
114
|
# @!attribute invoice_types_filter
|
|
113
|
-
# Only supported for invoice_total_reached
|
|
114
|
-
# evaluate.
|
|
115
|
+
# Only supported for invoice_total_reached threshold notifications. A list of
|
|
116
|
+
# invoice types to evaluate.
|
|
115
117
|
#
|
|
116
118
|
# @return [Array<String>, nil]
|
|
117
119
|
optional :invoice_types_filter, MetronomeSDK::Internal::Type::ArrayOf[String]
|
|
@@ -128,33 +130,33 @@ module MetronomeSDK
|
|
|
128
130
|
# Some parameter documentations has been truncated, see
|
|
129
131
|
# {MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert} for more details.
|
|
130
132
|
#
|
|
131
|
-
# @param id [String] the Metronome ID of the
|
|
133
|
+
# @param id [String] the Metronome ID of the threshold notification
|
|
132
134
|
#
|
|
133
|
-
# @param name [String] Name of the
|
|
135
|
+
# @param name [String] Name of the threshold notification
|
|
134
136
|
#
|
|
135
|
-
# @param status [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::Status] Status of the
|
|
137
|
+
# @param status [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::Status] Status of the threshold notification
|
|
136
138
|
#
|
|
137
|
-
# @param threshold [Float] Threshold value of the
|
|
139
|
+
# @param threshold [Float] Threshold value of the notification policy
|
|
138
140
|
#
|
|
139
|
-
# @param type [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::Type] Type of the
|
|
141
|
+
# @param type [Symbol, MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::Type] Type of the threshold notification
|
|
140
142
|
#
|
|
141
|
-
# @param updated_at [Time] Timestamp for when the
|
|
143
|
+
# @param updated_at [Time] Timestamp for when the threshold notification was last updated
|
|
142
144
|
#
|
|
143
|
-
# @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this
|
|
145
|
+
# @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this threshol
|
|
144
146
|
#
|
|
145
147
|
# @param credit_type [MetronomeSDK::Models::CreditTypeData, nil]
|
|
146
148
|
#
|
|
147
|
-
# @param custom_field_filters [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::CustomFieldFilter>] A list of custom field filters for
|
|
149
|
+
# @param custom_field_filters [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::CustomFieldFilter>] A list of custom field filters for notification types that support advanced filt
|
|
148
150
|
#
|
|
149
|
-
# @param group_key_filter [MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupKeyFilter] Scopes
|
|
151
|
+
# @param group_key_filter [MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupKeyFilter] Scopes threshold notification evaluation to a specific presentation group key on
|
|
150
152
|
#
|
|
151
|
-
# @param group_values [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupValue>] Only present for `spend_threshold_reached`
|
|
153
|
+
# @param group_values [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupValue>] Only present for `spend_threshold_reached` notifications. Scope notification to
|
|
152
154
|
#
|
|
153
|
-
# @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached
|
|
155
|
+
# @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached threshold notifications. A list of invo
|
|
154
156
|
#
|
|
155
157
|
# @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
|
|
156
158
|
|
|
157
|
-
# Status of the
|
|
159
|
+
# Status of the threshold notification
|
|
158
160
|
#
|
|
159
161
|
# @see MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert#status
|
|
160
162
|
module Status
|
|
@@ -168,7 +170,7 @@ module MetronomeSDK
|
|
|
168
170
|
# @return [Array<Symbol>]
|
|
169
171
|
end
|
|
170
172
|
|
|
171
|
-
# Type of the
|
|
173
|
+
# Type of the threshold notification
|
|
172
174
|
#
|
|
173
175
|
# @see MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert#type
|
|
174
176
|
module Type
|
|
@@ -243,8 +245,8 @@ module MetronomeSDK
|
|
|
243
245
|
required :value, String
|
|
244
246
|
|
|
245
247
|
# @!method initialize(key:, value:)
|
|
246
|
-
# Scopes
|
|
247
|
-
# items. Only present for spend
|
|
248
|
+
# Scopes threshold notification evaluation to a specific presentation group key on
|
|
249
|
+
# individual line items. Only present for spend notifications.
|
|
248
250
|
#
|
|
249
251
|
# @param key [String]
|
|
250
252
|
# @param value [String]
|
|
@@ -267,8 +269,8 @@ module MetronomeSDK
|
|
|
267
269
|
end
|
|
268
270
|
end
|
|
269
271
|
|
|
270
|
-
# The status of the
|
|
271
|
-
# returned.
|
|
272
|
+
# The status of the threshold notification. If the notification is archived, null
|
|
273
|
+
# will be returned.
|
|
272
274
|
#
|
|
273
275
|
# @see MetronomeSDK::Models::V1::Customers::CustomerAlert#customer_status
|
|
274
276
|
module CustomerStatus
|
|
@@ -50,8 +50,8 @@ module MetronomeSDK
|
|
|
50
50
|
# @!attribute billable_status
|
|
51
51
|
# This field's availability is dependent on your client's configuration.
|
|
52
52
|
#
|
|
53
|
-
# @return [
|
|
54
|
-
optional :billable_status,
|
|
53
|
+
# @return [Object, nil]
|
|
54
|
+
optional :billable_status, MetronomeSDK::Internal::Type::Unknown
|
|
55
55
|
|
|
56
56
|
# @!attribute contract_custom_fields
|
|
57
57
|
# Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
@@ -180,7 +180,7 @@ module MetronomeSDK
|
|
|
180
180
|
#
|
|
181
181
|
# @param amendment_id [String]
|
|
182
182
|
#
|
|
183
|
-
# @param billable_status [
|
|
183
|
+
# @param billable_status [Object] This field's availability is dependent on your client's configuration.
|
|
184
184
|
#
|
|
185
185
|
# @param contract_custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
|
|
186
186
|
#
|
|
@@ -805,19 +805,6 @@ module MetronomeSDK
|
|
|
805
805
|
end
|
|
806
806
|
end
|
|
807
807
|
|
|
808
|
-
# This field's availability is dependent on your client's configuration.
|
|
809
|
-
#
|
|
810
|
-
# @see MetronomeSDK::Models::V1::Customers::Invoice#billable_status
|
|
811
|
-
module BillableStatus
|
|
812
|
-
extend MetronomeSDK::Internal::Type::Enum
|
|
813
|
-
|
|
814
|
-
BILLABLE = :billable
|
|
815
|
-
UNBILLABLE = :unbillable
|
|
816
|
-
|
|
817
|
-
# @!method self.values
|
|
818
|
-
# @return [Array<Symbol>]
|
|
819
|
-
end
|
|
820
|
-
|
|
821
808
|
# @see MetronomeSDK::Models::V1::Customers::Invoice#correction_record
|
|
822
809
|
class CorrectionRecord < MetronomeSDK::Internal::Type::BaseModel
|
|
823
810
|
# @!attribute corrected_invoice_id
|
|
@@ -866,16 +853,52 @@ module MetronomeSDK
|
|
|
866
853
|
# @return [String, nil]
|
|
867
854
|
optional :invoice_id, String
|
|
868
855
|
|
|
856
|
+
# @!attribute invoiced_sub_total
|
|
857
|
+
# The subtotal amount invoiced, if available from the billing provider.
|
|
858
|
+
#
|
|
859
|
+
# @return [Float, nil]
|
|
860
|
+
optional :invoiced_sub_total, Float
|
|
861
|
+
|
|
862
|
+
# @!attribute invoiced_total
|
|
863
|
+
# The total amount invoiced, if available from the billing provider.
|
|
864
|
+
#
|
|
865
|
+
# @return [Float, nil]
|
|
866
|
+
optional :invoiced_total, Float
|
|
867
|
+
|
|
869
868
|
# @!attribute issued_at_timestamp
|
|
870
869
|
#
|
|
871
870
|
# @return [Time, nil]
|
|
872
871
|
optional :issued_at_timestamp, Time
|
|
873
872
|
|
|
874
|
-
# @!
|
|
873
|
+
# @!attribute pdf_url
|
|
874
|
+
# A URL to the PDF of the invoice, if available from the billing provider.
|
|
875
|
+
#
|
|
876
|
+
# @return [String, nil]
|
|
877
|
+
optional :pdf_url, String
|
|
878
|
+
|
|
879
|
+
# @!attribute tax
|
|
880
|
+
# Tax details for the invoice, if available from the billing provider.
|
|
881
|
+
#
|
|
882
|
+
# @return [MetronomeSDK::Models::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::Tax, nil]
|
|
883
|
+
optional :tax,
|
|
884
|
+
-> { MetronomeSDK::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::Tax }
|
|
885
|
+
|
|
886
|
+
# @!method initialize(billing_provider_type:, external_status: nil, invoice_id: nil, invoiced_sub_total: nil, invoiced_total: nil, issued_at_timestamp: nil, pdf_url: nil, tax: nil)
|
|
875
887
|
# @param billing_provider_type [Symbol, MetronomeSDK::Models::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::BillingProviderType]
|
|
888
|
+
#
|
|
876
889
|
# @param external_status [Symbol, MetronomeSDK::Models::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::ExternalStatus]
|
|
890
|
+
#
|
|
877
891
|
# @param invoice_id [String]
|
|
892
|
+
#
|
|
893
|
+
# @param invoiced_sub_total [Float] The subtotal amount invoiced, if available from the billing provider.
|
|
894
|
+
#
|
|
895
|
+
# @param invoiced_total [Float] The total amount invoiced, if available from the billing provider.
|
|
896
|
+
#
|
|
878
897
|
# @param issued_at_timestamp [Time]
|
|
898
|
+
#
|
|
899
|
+
# @param pdf_url [String] A URL to the PDF of the invoice, if available from the billing provider.
|
|
900
|
+
#
|
|
901
|
+
# @param tax [MetronomeSDK::Models::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice::Tax] Tax details for the invoice, if available from the billing provider.
|
|
879
902
|
|
|
880
903
|
# @see MetronomeSDK::Models::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice#billing_provider_type
|
|
881
904
|
module BillingProviderType
|
|
@@ -913,6 +936,36 @@ module MetronomeSDK
|
|
|
913
936
|
# @!method self.values
|
|
914
937
|
# @return [Array<Symbol>]
|
|
915
938
|
end
|
|
939
|
+
|
|
940
|
+
# @see MetronomeSDK::Models::V1::Customers::Invoice::CorrectionRecord::CorrectedExternalInvoice#tax
|
|
941
|
+
class Tax < MetronomeSDK::Internal::Type::BaseModel
|
|
942
|
+
# @!attribute total_tax_amount
|
|
943
|
+
# The total tax amount applied to the invoice.
|
|
944
|
+
#
|
|
945
|
+
# @return [Float, nil]
|
|
946
|
+
optional :total_tax_amount, Float
|
|
947
|
+
|
|
948
|
+
# @!attribute total_taxable_amount
|
|
949
|
+
# The total taxable amount of the invoice.
|
|
950
|
+
#
|
|
951
|
+
# @return [Float, nil]
|
|
952
|
+
optional :total_taxable_amount, Float
|
|
953
|
+
|
|
954
|
+
# @!attribute transaction_id
|
|
955
|
+
# The transaction ID associated with the tax calculation.
|
|
956
|
+
#
|
|
957
|
+
# @return [String, nil]
|
|
958
|
+
optional :transaction_id, String
|
|
959
|
+
|
|
960
|
+
# @!method initialize(total_tax_amount: nil, total_taxable_amount: nil, transaction_id: nil)
|
|
961
|
+
# Tax details for the invoice, if available from the billing provider.
|
|
962
|
+
#
|
|
963
|
+
# @param total_tax_amount [Float] The total tax amount applied to the invoice.
|
|
964
|
+
#
|
|
965
|
+
# @param total_taxable_amount [Float] The total taxable amount of the invoice.
|
|
966
|
+
#
|
|
967
|
+
# @param transaction_id [String] The transaction ID associated with the tax calculation.
|
|
968
|
+
end
|
|
916
969
|
end
|
|
917
970
|
end
|
|
918
971
|
|
|
@@ -935,16 +988,51 @@ module MetronomeSDK
|
|
|
935
988
|
# @return [String, nil]
|
|
936
989
|
optional :invoice_id, String
|
|
937
990
|
|
|
991
|
+
# @!attribute invoiced_sub_total
|
|
992
|
+
# The subtotal amount invoiced, if available from the billing provider.
|
|
993
|
+
#
|
|
994
|
+
# @return [Float, nil]
|
|
995
|
+
optional :invoiced_sub_total, Float
|
|
996
|
+
|
|
997
|
+
# @!attribute invoiced_total
|
|
998
|
+
# The total amount invoiced, if available from the billing provider.
|
|
999
|
+
#
|
|
1000
|
+
# @return [Float, nil]
|
|
1001
|
+
optional :invoiced_total, Float
|
|
1002
|
+
|
|
938
1003
|
# @!attribute issued_at_timestamp
|
|
939
1004
|
#
|
|
940
1005
|
# @return [Time, nil]
|
|
941
1006
|
optional :issued_at_timestamp, Time
|
|
942
1007
|
|
|
943
|
-
# @!
|
|
1008
|
+
# @!attribute pdf_url
|
|
1009
|
+
# A URL to the PDF of the invoice, if available from the billing provider.
|
|
1010
|
+
#
|
|
1011
|
+
# @return [String, nil]
|
|
1012
|
+
optional :pdf_url, String
|
|
1013
|
+
|
|
1014
|
+
# @!attribute tax
|
|
1015
|
+
# Tax details for the invoice, if available from the billing provider.
|
|
1016
|
+
#
|
|
1017
|
+
# @return [MetronomeSDK::Models::V1::Customers::Invoice::ExternalInvoice::Tax, nil]
|
|
1018
|
+
optional :tax, -> { MetronomeSDK::V1::Customers::Invoice::ExternalInvoice::Tax }
|
|
1019
|
+
|
|
1020
|
+
# @!method initialize(billing_provider_type:, external_status: nil, invoice_id: nil, invoiced_sub_total: nil, invoiced_total: nil, issued_at_timestamp: nil, pdf_url: nil, tax: nil)
|
|
944
1021
|
# @param billing_provider_type [Symbol, MetronomeSDK::Models::V1::Customers::Invoice::ExternalInvoice::BillingProviderType]
|
|
1022
|
+
#
|
|
945
1023
|
# @param external_status [Symbol, MetronomeSDK::Models::V1::Customers::Invoice::ExternalInvoice::ExternalStatus]
|
|
1024
|
+
#
|
|
946
1025
|
# @param invoice_id [String]
|
|
1026
|
+
#
|
|
1027
|
+
# @param invoiced_sub_total [Float] The subtotal amount invoiced, if available from the billing provider.
|
|
1028
|
+
#
|
|
1029
|
+
# @param invoiced_total [Float] The total amount invoiced, if available from the billing provider.
|
|
1030
|
+
#
|
|
947
1031
|
# @param issued_at_timestamp [Time]
|
|
1032
|
+
#
|
|
1033
|
+
# @param pdf_url [String] A URL to the PDF of the invoice, if available from the billing provider.
|
|
1034
|
+
#
|
|
1035
|
+
# @param tax [MetronomeSDK::Models::V1::Customers::Invoice::ExternalInvoice::Tax] Tax details for the invoice, if available from the billing provider.
|
|
948
1036
|
|
|
949
1037
|
# @see MetronomeSDK::Models::V1::Customers::Invoice::ExternalInvoice#billing_provider_type
|
|
950
1038
|
module BillingProviderType
|
|
@@ -982,6 +1070,36 @@ module MetronomeSDK
|
|
|
982
1070
|
# @!method self.values
|
|
983
1071
|
# @return [Array<Symbol>]
|
|
984
1072
|
end
|
|
1073
|
+
|
|
1074
|
+
# @see MetronomeSDK::Models::V1::Customers::Invoice::ExternalInvoice#tax
|
|
1075
|
+
class Tax < MetronomeSDK::Internal::Type::BaseModel
|
|
1076
|
+
# @!attribute total_tax_amount
|
|
1077
|
+
# The total tax amount applied to the invoice.
|
|
1078
|
+
#
|
|
1079
|
+
# @return [Float, nil]
|
|
1080
|
+
optional :total_tax_amount, Float
|
|
1081
|
+
|
|
1082
|
+
# @!attribute total_taxable_amount
|
|
1083
|
+
# The total taxable amount of the invoice.
|
|
1084
|
+
#
|
|
1085
|
+
# @return [Float, nil]
|
|
1086
|
+
optional :total_taxable_amount, Float
|
|
1087
|
+
|
|
1088
|
+
# @!attribute transaction_id
|
|
1089
|
+
# The transaction ID associated with the tax calculation.
|
|
1090
|
+
#
|
|
1091
|
+
# @return [String, nil]
|
|
1092
|
+
optional :transaction_id, String
|
|
1093
|
+
|
|
1094
|
+
# @!method initialize(total_tax_amount: nil, total_taxable_amount: nil, transaction_id: nil)
|
|
1095
|
+
# Tax details for the invoice, if available from the billing provider.
|
|
1096
|
+
#
|
|
1097
|
+
# @param total_tax_amount [Float] The total tax amount applied to the invoice.
|
|
1098
|
+
#
|
|
1099
|
+
# @param total_taxable_amount [Float] The total taxable amount of the invoice.
|
|
1100
|
+
#
|
|
1101
|
+
# @param transaction_id [String] The transaction ID associated with the tax calculation.
|
|
1102
|
+
end
|
|
985
1103
|
end
|
|
986
1104
|
|
|
987
1105
|
class InvoiceAdjustment < MetronomeSDK::Internal::Type::BaseModel
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
module Customers
|
|
7
|
+
# @see MetronomeSDK::Resources::V1::Customers::Invoices#retrieve_pdf
|
|
8
|
+
class InvoiceRetrievePdfParams < MetronomeSDK::Internal::Type::BaseModel
|
|
9
|
+
extend MetronomeSDK::Internal::Type::RequestParameters::Converter
|
|
10
|
+
include MetronomeSDK::Internal::Type::RequestParameters
|
|
11
|
+
|
|
12
|
+
# @!attribute customer_id
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :customer_id, String
|
|
16
|
+
|
|
17
|
+
# @!attribute invoice_id
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
required :invoice_id, String
|
|
21
|
+
|
|
22
|
+
# @!method initialize(customer_id:, invoice_id:, request_options: {})
|
|
23
|
+
# @param customer_id [String]
|
|
24
|
+
# @param invoice_id [String]
|
|
25
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see MetronomeSDK::Resources::V1::Payments#list
|
|
7
|
+
class Payment < MetronomeSDK::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute id
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute amount
|
|
14
|
+
#
|
|
15
|
+
# @return [Float, nil]
|
|
16
|
+
optional :amount, Float
|
|
17
|
+
|
|
18
|
+
# @!attribute amount_paid
|
|
19
|
+
#
|
|
20
|
+
# @return [Float, nil]
|
|
21
|
+
optional :amount_paid, Float
|
|
22
|
+
|
|
23
|
+
# @!attribute contract_id
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :contract_id, String
|
|
27
|
+
|
|
28
|
+
# @!attribute created_at
|
|
29
|
+
#
|
|
30
|
+
# @return [Time, nil]
|
|
31
|
+
optional :created_at, Time
|
|
32
|
+
|
|
33
|
+
# @!attribute customer_id
|
|
34
|
+
#
|
|
35
|
+
# @return [String, nil]
|
|
36
|
+
optional :customer_id, String
|
|
37
|
+
|
|
38
|
+
# @!attribute error_message
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :error_message, String
|
|
42
|
+
|
|
43
|
+
# @!attribute fiat_credit_type
|
|
44
|
+
#
|
|
45
|
+
# @return [MetronomeSDK::Models::CreditTypeData, nil]
|
|
46
|
+
optional :fiat_credit_type, -> { MetronomeSDK::CreditTypeData }
|
|
47
|
+
|
|
48
|
+
# @!attribute invoice_id
|
|
49
|
+
#
|
|
50
|
+
# @return [String, nil]
|
|
51
|
+
optional :invoice_id, String
|
|
52
|
+
|
|
53
|
+
# @!attribute payment_gateway
|
|
54
|
+
#
|
|
55
|
+
# @return [MetronomeSDK::Models::V1::Payment::PaymentGateway, nil]
|
|
56
|
+
optional :payment_gateway, -> { MetronomeSDK::V1::Payment::PaymentGateway }
|
|
57
|
+
|
|
58
|
+
# @!attribute status
|
|
59
|
+
#
|
|
60
|
+
# @return [Symbol, MetronomeSDK::Models::V1::PaymentStatus, nil]
|
|
61
|
+
optional :status, enum: -> { MetronomeSDK::V1::PaymentStatus }
|
|
62
|
+
|
|
63
|
+
# @!attribute updated_at
|
|
64
|
+
#
|
|
65
|
+
# @return [Time, nil]
|
|
66
|
+
optional :updated_at, Time
|
|
67
|
+
|
|
68
|
+
# @!method initialize(id:, amount: nil, amount_paid: nil, contract_id: nil, created_at: nil, customer_id: nil, error_message: nil, fiat_credit_type: nil, invoice_id: nil, payment_gateway: nil, status: nil, updated_at: nil)
|
|
69
|
+
# @param id [String]
|
|
70
|
+
# @param amount [Float]
|
|
71
|
+
# @param amount_paid [Float]
|
|
72
|
+
# @param contract_id [String]
|
|
73
|
+
# @param created_at [Time]
|
|
74
|
+
# @param customer_id [String]
|
|
75
|
+
# @param error_message [String]
|
|
76
|
+
# @param fiat_credit_type [MetronomeSDK::Models::CreditTypeData]
|
|
77
|
+
# @param invoice_id [String]
|
|
78
|
+
# @param payment_gateway [MetronomeSDK::Models::V1::Payment::PaymentGateway]
|
|
79
|
+
# @param status [Symbol, MetronomeSDK::Models::V1::PaymentStatus]
|
|
80
|
+
# @param updated_at [Time]
|
|
81
|
+
|
|
82
|
+
# @see MetronomeSDK::Models::V1::Payment#payment_gateway
|
|
83
|
+
class PaymentGateway < MetronomeSDK::Internal::Type::BaseModel
|
|
84
|
+
# @!attribute stripe
|
|
85
|
+
#
|
|
86
|
+
# @return [MetronomeSDK::Models::V1::Payment::PaymentGateway::Stripe]
|
|
87
|
+
required :stripe, -> { MetronomeSDK::V1::Payment::PaymentGateway::Stripe }
|
|
88
|
+
|
|
89
|
+
# @!attribute type
|
|
90
|
+
#
|
|
91
|
+
# @return [Symbol, MetronomeSDK::Models::V1::Payment::PaymentGateway::Type]
|
|
92
|
+
required :type, enum: -> { MetronomeSDK::V1::Payment::PaymentGateway::Type }
|
|
93
|
+
|
|
94
|
+
# @!method initialize(stripe:, type:)
|
|
95
|
+
# @param stripe [MetronomeSDK::Models::V1::Payment::PaymentGateway::Stripe]
|
|
96
|
+
# @param type [Symbol, MetronomeSDK::Models::V1::Payment::PaymentGateway::Type]
|
|
97
|
+
|
|
98
|
+
# @see MetronomeSDK::Models::V1::Payment::PaymentGateway#stripe
|
|
99
|
+
class Stripe < MetronomeSDK::Internal::Type::BaseModel
|
|
100
|
+
# @!attribute payment_intent_id
|
|
101
|
+
#
|
|
102
|
+
# @return [String]
|
|
103
|
+
required :payment_intent_id, String
|
|
104
|
+
|
|
105
|
+
# @!attribute error
|
|
106
|
+
#
|
|
107
|
+
# @return [MetronomeSDK::Models::V1::Payment::PaymentGateway::Stripe::Error, nil]
|
|
108
|
+
optional :error, -> { MetronomeSDK::V1::Payment::PaymentGateway::Stripe::Error }
|
|
109
|
+
|
|
110
|
+
# @!method initialize(payment_intent_id:, error: nil)
|
|
111
|
+
# @param payment_intent_id [String]
|
|
112
|
+
# @param error [MetronomeSDK::Models::V1::Payment::PaymentGateway::Stripe::Error]
|
|
113
|
+
|
|
114
|
+
# @see MetronomeSDK::Models::V1::Payment::PaymentGateway::Stripe#error
|
|
115
|
+
class Error < MetronomeSDK::Internal::Type::BaseModel
|
|
116
|
+
# @!attribute code
|
|
117
|
+
#
|
|
118
|
+
# @return [String, nil]
|
|
119
|
+
optional :code, String
|
|
120
|
+
|
|
121
|
+
# @!attribute decline_code
|
|
122
|
+
#
|
|
123
|
+
# @return [String, nil]
|
|
124
|
+
optional :decline_code, String
|
|
125
|
+
|
|
126
|
+
# @!attribute type
|
|
127
|
+
#
|
|
128
|
+
# @return [String, nil]
|
|
129
|
+
optional :type, String
|
|
130
|
+
|
|
131
|
+
# @!method initialize(code: nil, decline_code: nil, type: nil)
|
|
132
|
+
# @param code [String]
|
|
133
|
+
# @param decline_code [String]
|
|
134
|
+
# @param type [String]
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# @see MetronomeSDK::Models::V1::Payment::PaymentGateway#type
|
|
139
|
+
module Type
|
|
140
|
+
extend MetronomeSDK::Internal::Type::Enum
|
|
141
|
+
|
|
142
|
+
STRIPE = :stripe
|
|
143
|
+
|
|
144
|
+
# @!method self.values
|
|
145
|
+
# @return [Array<Symbol>]
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see MetronomeSDK::Resources::V1::Payments#attempt
|
|
7
|
+
class PaymentAttemptParams < MetronomeSDK::Internal::Type::BaseModel
|
|
8
|
+
extend MetronomeSDK::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include MetronomeSDK::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute customer_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :customer_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute invoice_id
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :invoice_id, String
|
|
20
|
+
|
|
21
|
+
# @!method initialize(customer_id:, invoice_id:, request_options: {})
|
|
22
|
+
# @param customer_id [String]
|
|
23
|
+
# @param invoice_id [String]
|
|
24
|
+
# @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module MetronomeSDK
|
|
4
|
+
module Models
|
|
5
|
+
module V1
|
|
6
|
+
# @see MetronomeSDK::Resources::V1::Payments#attempt
|
|
7
|
+
class PaymentAttemptResponse < MetronomeSDK::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute data
|
|
9
|
+
#
|
|
10
|
+
# @return [MetronomeSDK::Models::V1::Payment]
|
|
11
|
+
required :data, -> { MetronomeSDK::V1::Payment }
|
|
12
|
+
|
|
13
|
+
# @!method initialize(data:)
|
|
14
|
+
# @param data [MetronomeSDK::Models::V1::Payment]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|