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.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/errors.rb +25 -11
  5. data/lib/metronome_sdk/file_part.rb +10 -7
  6. data/lib/metronome_sdk/internal/body_cursor_page.rb +1 -1
  7. data/lib/metronome_sdk/internal/cursor_page.rb +1 -1
  8. data/lib/metronome_sdk/internal/cursor_page_without_limit.rb +1 -1
  9. data/lib/metronome_sdk/internal/transport/base_client.rb +11 -7
  10. data/lib/metronome_sdk/internal/transport/pooled_net_requester.rb +7 -10
  11. data/lib/metronome_sdk/internal/type/base_page.rb +1 -1
  12. data/lib/metronome_sdk/internal/type/enum.rb +25 -0
  13. data/lib/metronome_sdk/internal/type/file_input.rb +7 -4
  14. data/lib/metronome_sdk/internal/util.rb +8 -7
  15. data/lib/metronome_sdk/models/contract_v2.rb +256 -6
  16. data/lib/metronome_sdk/models/contract_without_amendments.rb +2 -2
  17. data/lib/metronome_sdk/models/hierarchy_configuration.rb +99 -2
  18. data/lib/metronome_sdk/models/payment_gate_config.rb +1 -0
  19. data/lib/metronome_sdk/models/payment_gate_config_v2.rb +1 -0
  20. data/lib/metronome_sdk/models/subscription.rb +85 -1
  21. data/lib/metronome_sdk/models/v1/alert_archive_params.rb +8 -4
  22. data/lib/metronome_sdk/models/v1/alert_create_params.rb +38 -36
  23. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -0
  24. data/lib/metronome_sdk/models/v1/contract_create_params.rb +101 -3
  25. data/lib/metronome_sdk/models/v1/customer_detail.rb +9 -1
  26. data/lib/metronome_sdk/models/v1/customer_preview_events_params.rb +5 -15
  27. data/lib/metronome_sdk/models/v1/customer_preview_events_response.rb +3 -3
  28. data/lib/metronome_sdk/models/v1/customers/alert_list_params.rb +3 -3
  29. data/lib/metronome_sdk/models/v1/customers/alert_reset_params.rb +2 -2
  30. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +12 -12
  31. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +40 -38
  32. data/lib/metronome_sdk/models/v1/customers/invoice.rb +136 -18
  33. data/lib/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rb +30 -0
  34. data/lib/metronome_sdk/models/v1/payment.rb +151 -0
  35. data/lib/metronome_sdk/models/v1/payment_attempt_params.rb +28 -0
  36. data/lib/metronome_sdk/models/v1/payment_attempt_response.rb +18 -0
  37. data/lib/metronome_sdk/models/v1/payment_cancel_params.rb +28 -0
  38. data/lib/metronome_sdk/models/v1/payment_cancel_response.rb +18 -0
  39. data/lib/metronome_sdk/models/v1/payment_list_params.rb +53 -0
  40. data/lib/metronome_sdk/models/v1/payment_status.rb +19 -0
  41. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +9 -1
  42. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +9 -1
  43. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +186 -3
  44. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +195 -8
  45. data/lib/metronome_sdk/resources/v1/alerts.rb +57 -53
  46. data/lib/metronome_sdk/resources/v1/contracts.rb +4 -3
  47. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +70 -51
  48. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +55 -0
  49. data/lib/metronome_sdk/resources/v1/customers.rb +7 -4
  50. data/lib/metronome_sdk/resources/v1/payments.rb +102 -0
  51. data/lib/metronome_sdk/resources/v1/usage.rb +4 -2
  52. data/lib/metronome_sdk/resources/v1.rb +4 -0
  53. data/lib/metronome_sdk/resources/v2/contracts.rb +9 -3
  54. data/lib/metronome_sdk/version.rb +1 -1
  55. data/lib/metronome_sdk.rb +9 -0
  56. data/rbi/metronome_sdk/errors.rbi +29 -2
  57. data/rbi/metronome_sdk/file_part.rbi +1 -1
  58. data/rbi/metronome_sdk/internal/transport/base_client.rbi +4 -5
  59. data/rbi/metronome_sdk/internal/type/base_page.rbi +1 -1
  60. data/rbi/metronome_sdk/internal/util.rbi +1 -1
  61. data/rbi/metronome_sdk/models/contract_v2.rbi +603 -10
  62. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +2 -2
  63. data/rbi/metronome_sdk/models/hierarchy_configuration.rbi +250 -6
  64. data/rbi/metronome_sdk/models/payment_gate_config.rbi +5 -0
  65. data/rbi/metronome_sdk/models/payment_gate_config_v2.rbi +5 -0
  66. data/rbi/metronome_sdk/models/subscription.rbi +175 -0
  67. data/rbi/metronome_sdk/models/v1/alert_archive_params.rbi +6 -4
  68. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +51 -47
  69. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +5 -0
  70. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +257 -4
  71. data/rbi/metronome_sdk/models/v1/customer_detail.rbi +8 -0
  72. data/rbi/metronome_sdk/models/v1/customer_preview_events_params.rbi +6 -21
  73. data/rbi/metronome_sdk/models/v1/customer_preview_events_response.rbi +10 -9
  74. data/rbi/metronome_sdk/models/v1/customers/alert_list_params.rbi +4 -4
  75. data/rbi/metronome_sdk/models/v1/customers/alert_reset_params.rbi +2 -2
  76. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +14 -14
  77. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +48 -44
  78. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +246 -58
  79. data/rbi/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbi +50 -0
  80. data/rbi/metronome_sdk/models/v1/payment.rbi +316 -0
  81. data/rbi/metronome_sdk/models/v1/payment_attempt_params.rbi +48 -0
  82. data/rbi/metronome_sdk/models/v1/payment_attempt_response.rbi +35 -0
  83. data/rbi/metronome_sdk/models/v1/payment_cancel_params.rbi +48 -0
  84. data/rbi/metronome_sdk/models/v1/payment_cancel_response.rbi +35 -0
  85. data/rbi/metronome_sdk/models/v1/payment_list_params.rbi +91 -0
  86. data/rbi/metronome_sdk/models/v1/payment_status.rbi +33 -0
  87. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +18 -0
  88. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +18 -0
  89. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +498 -6
  90. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +462 -14
  91. data/rbi/metronome_sdk/resources/v1/alerts.rbi +68 -64
  92. data/rbi/metronome_sdk/resources/v1/contracts.rbi +4 -3
  93. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +73 -54
  94. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +36 -0
  95. data/rbi/metronome_sdk/resources/v1/customers.rbi +7 -4
  96. data/rbi/metronome_sdk/resources/v1/payments.rbi +72 -0
  97. data/rbi/metronome_sdk/resources/v1/usage.rbi +4 -2
  98. data/rbi/metronome_sdk/resources/v1.rbi +3 -0
  99. data/rbi/metronome_sdk/resources/v2/contracts.rbi +14 -0
  100. data/sig/metronome_sdk/errors.rbs +7 -0
  101. data/sig/metronome_sdk/file_part.rbs +1 -1
  102. data/sig/metronome_sdk/models/contract_v2.rbs +239 -12
  103. data/sig/metronome_sdk/models/hierarchy_configuration.rbs +87 -6
  104. data/sig/metronome_sdk/models/payment_gate_config.rbs +2 -1
  105. data/sig/metronome_sdk/models/payment_gate_config_v2.rbs +2 -1
  106. data/sig/metronome_sdk/models/subscription.rbs +80 -0
  107. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +2 -1
  108. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +91 -5
  109. data/sig/metronome_sdk/models/v1/customer_detail.rbs +5 -0
  110. data/sig/metronome_sdk/models/v1/customer_preview_events_params.rbs +0 -7
  111. data/sig/metronome_sdk/models/v1/customer_preview_events_response.rbs +6 -4
  112. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +137 -24
  113. data/sig/metronome_sdk/models/v1/customers/invoice_retrieve_pdf_params.rbs +32 -0
  114. data/sig/metronome_sdk/models/v1/payment.rbs +191 -0
  115. data/sig/metronome_sdk/models/v1/payment_attempt_params.rbs +30 -0
  116. data/sig/metronome_sdk/models/v1/payment_attempt_response.rbs +15 -0
  117. data/sig/metronome_sdk/models/v1/payment_cancel_params.rbs +30 -0
  118. data/sig/metronome_sdk/models/v1/payment_cancel_response.rbs +15 -0
  119. data/sig/metronome_sdk/models/v1/payment_list_params.rbs +56 -0
  120. data/sig/metronome_sdk/models/v1/payment_status.rbs +19 -0
  121. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +9 -0
  122. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +9 -0
  123. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +182 -7
  124. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +221 -18
  125. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +6 -0
  126. data/sig/metronome_sdk/resources/v1/payments.rbs +30 -0
  127. data/sig/metronome_sdk/resources/v1.rbs +2 -0
  128. data/sig/metronome_sdk/resources/v2/contracts.rbs +3 -0
  129. metadata +29 -2
@@ -9,41 +9,43 @@ module MetronomeSDK
9
9
  include MetronomeSDK::Internal::Type::RequestParameters
10
10
 
11
11
  # @!attribute alert_type
12
- # Type of the alert
12
+ # Type of the threshold notification
13
13
  #
14
14
  # @return [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType]
15
15
  required :alert_type, enum: -> { MetronomeSDK::V1::AlertCreateParams::AlertType }
16
16
 
17
17
  # @!attribute name
18
- # Name of the alert
18
+ # Name of the threshold notification
19
19
  #
20
20
  # @return [String]
21
21
  required :name, String
22
22
 
23
23
  # @!attribute threshold
24
- # Threshold value of the alert policy. Depending upon the alert type, this number
25
- # may represent a financial amount, the days remaining, or a percentage reached.
24
+ # Threshold value of the notification policy. Depending upon the notification
25
+ # type, this number may represent a financial amount, the days remaining, or a
26
+ # percentage reached.
26
27
  #
27
28
  # @return [Float]
28
29
  required :threshold, Float
29
30
 
30
31
  # @!attribute billable_metric_id
31
- # For alerts of type `usage_threshold_reached`, specifies which billable metric to
32
- # track the usage for.
32
+ # For threshold notifications of type `usage_threshold_reached`, specifies which
33
+ # billable metric to track the usage for.
33
34
  #
34
35
  # @return [String, nil]
35
36
  optional :billable_metric_id, String
36
37
 
37
38
  # @!attribute credit_grant_type_filters
38
- # An array of strings, representing a way to filter the credit grant this alert
39
- # applies to, by looking at the credit_grant_type field on the credit grant. This
40
- # field is only defined for CreditPercentage and CreditBalance alerts
39
+ # An array of strings, representing a way to filter the credit grant this
40
+ # threshold notification applies to, by looking at the credit_grant_type field on
41
+ # the credit grant. This field is only defined for CreditPercentage and
42
+ # CreditBalance notifications
41
43
  #
42
44
  # @return [Array<String>, nil]
43
45
  optional :credit_grant_type_filters, MetronomeSDK::Internal::Type::ArrayOf[String]
44
46
 
45
47
  # @!attribute credit_type_id
46
- # ID of the credit's currency, defaults to USD. If the specific alert type
48
+ # ID of the credit's currency, defaults to USD. If the specific notification type
47
49
  # requires a pricing unit/currency, find the ID in the
48
50
  # [Metronome app](https://app.metronome.com/offering/pricing-units).
49
51
  #
@@ -51,46 +53,46 @@ module MetronomeSDK
51
53
  optional :credit_type_id, String
52
54
 
53
55
  # @!attribute custom_field_filters
54
- # A list of custom field filters for alert types that support advanced filtering.
55
- # Only present for contract invoices.
56
+ # A list of custom field filters for threshold notification types that support
57
+ # advanced filtering. Only present for contract invoices.
56
58
  #
57
59
  # @return [Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>, nil]
58
60
  optional :custom_field_filters,
59
61
  -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::AlertCreateParams::CustomFieldFilter] }
60
62
 
61
63
  # @!attribute customer_id
62
- # If provided, will create this alert for this specific customer. To create an
63
- # alert for all customers, do not specify a `customer_id`.
64
+ # If provided, will create this threshold notification for this specific customer.
65
+ # To create a notification for all customers, do not specify a `customer_id`.
64
66
  #
65
67
  # @return [String, nil]
66
68
  optional :customer_id, String
67
69
 
68
70
  # @!attribute evaluate_on_create
69
- # If true, the alert will evaluate immediately on customers that already meet the
70
- # alert threshold. If false, it will only evaluate on future customers that
71
- # trigger the alert threshold. Defaults to true.
71
+ # If true, the threshold notification will evaluate immediately on customers that
72
+ # already meet the notification threshold. If false, it will only evaluate on
73
+ # future customers that trigger the threshold. Defaults to true.
72
74
  #
73
75
  # @return [Boolean, nil]
74
76
  optional :evaluate_on_create, MetronomeSDK::Internal::Type::Boolean
75
77
 
76
78
  # @!attribute group_values
77
- # Only present for `spend_threshold_reached` alerts. Scope alert to a specific
78
- # group key on individual line items.
79
+ # Only present for `spend_threshold_reached` notifications. Scope notification to
80
+ # a specific group key on individual line items.
79
81
  #
80
82
  # @return [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>, nil]
81
83
  optional :group_values,
82
84
  -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::AlertCreateParams::GroupValue] }
83
85
 
84
86
  # @!attribute invoice_types_filter
85
- # Only supported for invoice_total_reached alerts. A list of invoice types to
86
- # evaluate.
87
+ # Only supported for invoice_total_reached threshold notifications. A list of
88
+ # invoice types to evaluate.
87
89
  #
88
90
  # @return [Array<String>, nil]
89
91
  optional :invoice_types_filter, MetronomeSDK::Internal::Type::ArrayOf[String]
90
92
 
91
93
  # @!attribute plan_id
92
- # If provided, will create this alert for this specific plan. To create an alert
93
- # for all customers, do not specify a `plan_id`.
94
+ # If provided, will create this threshold notification for this specific plan. To
95
+ # create a notification for all customers, do not specify a `plan_id`.
94
96
  #
95
97
  # @return [String, nil]
96
98
  optional :plan_id, String
@@ -107,35 +109,35 @@ module MetronomeSDK
107
109
  # Some parameter documentations has been truncated, see
108
110
  # {MetronomeSDK::Models::V1::AlertCreateParams} for more details.
109
111
  #
110
- # @param alert_type [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType] Type of the alert
112
+ # @param alert_type [Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType] Type of the threshold notification
111
113
  #
112
- # @param name [String] Name of the alert
114
+ # @param name [String] Name of the threshold notification
113
115
  #
114
- # @param threshold [Float] Threshold value of the alert policy. Depending upon the alert type, this number
116
+ # @param threshold [Float] Threshold value of the notification policy. Depending upon the notification typ
115
117
  #
116
- # @param billable_metric_id [String] For alerts of type `usage_threshold_reached`, specifies which billable metric to
118
+ # @param billable_metric_id [String] For threshold notifications of type `usage_threshold_reached`, specifies which b
117
119
  #
118
- # @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this alert ap
120
+ # @param credit_grant_type_filters [Array<String>] An array of strings, representing a way to filter the credit grant this threshol
119
121
  #
120
- # @param credit_type_id [String] ID of the credit's currency, defaults to USD. If the specific alert type require
122
+ # @param credit_type_id [String] ID of the credit's currency, defaults to USD. If the specific notification type
121
123
  #
122
- # @param custom_field_filters [Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>] A list of custom field filters for alert types that support advanced filtering.
124
+ # @param custom_field_filters [Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>] A list of custom field filters for threshold notification types that support adv
123
125
  #
124
- # @param customer_id [String] If provided, will create this alert for this specific customer. To create an ale
126
+ # @param customer_id [String] If provided, will create this threshold notification for this specific customer.
125
127
  #
126
- # @param evaluate_on_create [Boolean] If true, the alert will evaluate immediately on customers that already meet the
128
+ # @param evaluate_on_create [Boolean] If true, the threshold notification will evaluate immediately on customers that
127
129
  #
128
- # @param group_values [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>] Only present for `spend_threshold_reached` alerts. Scope alert to a specific gro
130
+ # @param group_values [Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Scope notification to
129
131
  #
130
- # @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached alerts. A list of invoice types to eval
132
+ # @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached threshold notifications. A list of invo
131
133
  #
132
- # @param plan_id [String] If provided, will create this alert for this specific plan. To create an alert f
134
+ # @param plan_id [String] If provided, will create this threshold notification for this specific plan. To
133
135
  #
134
136
  # @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
135
137
  #
136
138
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
137
139
 
138
- # Type of the alert
140
+ # Type of the threshold notification
139
141
  module AlertType
140
142
  extend MetronomeSDK::Internal::Type::Enum
141
143
 
@@ -702,6 +702,7 @@ module MetronomeSDK
702
702
  NONE = :NONE
703
703
  STRIPE = :STRIPE
704
704
  ANROK = :ANROK
705
+ AVALARA = :AVALARA
705
706
  PRECALCULATED = :PRECALCULATED
706
707
 
707
708
  # @!method self.values
@@ -927,6 +927,7 @@ module MetronomeSDK
927
927
  NONE = :NONE
928
928
  STRIPE = :STRIPE
929
929
  ANROK = :ANROK
930
+ AVALARA = :AVALARA
930
931
  PRECALCULATED = :PRECALCULATED
931
932
 
932
933
  # @!method self.values
@@ -1347,11 +1348,43 @@ module MetronomeSDK
1347
1348
  class HierarchyConfiguration < MetronomeSDK::Internal::Type::BaseModel
1348
1349
  # @!attribute parent
1349
1350
  #
1350
- # @return [MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::Parent]
1351
- required :parent, -> { MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Parent }
1351
+ # @return [MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::Parent, nil]
1352
+ optional :parent, -> { MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Parent }
1352
1353
 
1353
- # @!method initialize(parent:)
1354
+ # @!attribute parent_behavior
1355
+ #
1356
+ # @return [MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior, nil]
1357
+ optional :parent_behavior,
1358
+ -> { MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior }
1359
+
1360
+ # @!attribute payer
1361
+ # Indicates whether the parent should pay for the child's invoice charges
1362
+ #
1363
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::Payer, nil]
1364
+ optional :payer, enum: -> { MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::Payer }
1365
+
1366
+ # @!attribute usage_statement_behavior
1367
+ # Indicates the behavior of the child's invoice statements on the parent's
1368
+ # invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
1369
+ # consolidated invoices **SEPARATE**: Child's invoice statements will appear not
1370
+ # appear on parent's consolidated invoices
1371
+ #
1372
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior, nil]
1373
+ optional :usage_statement_behavior,
1374
+ enum: -> { MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior }
1375
+
1376
+ # @!method initialize(parent: nil, parent_behavior: nil, payer: nil, usage_statement_behavior: nil)
1377
+ # Some parameter documentations has been truncated, see
1378
+ # {MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration} for
1379
+ # more details.
1380
+ #
1354
1381
  # @param parent [MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::Parent]
1382
+ #
1383
+ # @param parent_behavior [MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior]
1384
+ #
1385
+ # @param payer [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::Payer] Indicates whether the parent should pay for the child's invoice charges
1386
+ #
1387
+ # @param usage_statement_behavior [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::UsageStatementBehavior] Indicates the behavior of the child's invoice statements on the parent's invoice
1355
1388
 
1356
1389
  # @see MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration#parent
1357
1390
  class Parent < MetronomeSDK::Internal::Type::BaseModel
@@ -1369,6 +1402,71 @@ module MetronomeSDK
1369
1402
  # @param contract_id [String]
1370
1403
  # @param customer_id [String]
1371
1404
  end
1405
+
1406
+ # @see MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration#parent_behavior
1407
+ class ParentBehavior < MetronomeSDK::Internal::Type::BaseModel
1408
+ # @!attribute invoice_consolidation_type
1409
+ # Indicates the desired behavior of consolidated invoices generated by the parent
1410
+ # in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
1411
+ # customers will be appended to the consolidated invoice **NONE**: Do not generate
1412
+ # consolidated invoices
1413
+ #
1414
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType, nil]
1415
+ optional :invoice_consolidation_type,
1416
+ enum: -> { MetronomeSDK::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType }
1417
+
1418
+ # @!method initialize(invoice_consolidation_type: nil)
1419
+ # Some parameter documentations has been truncated, see
1420
+ # {MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior}
1421
+ # for more details.
1422
+ #
1423
+ # @param invoice_consolidation_type [Symbol, MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior::InvoiceConsolidationType] Indicates the desired behavior of consolidated invoices generated by the parent
1424
+
1425
+ # Indicates the desired behavior of consolidated invoices generated by the parent
1426
+ # in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
1427
+ # customers will be appended to the consolidated invoice **NONE**: Do not generate
1428
+ # consolidated invoices
1429
+ #
1430
+ # @see MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration::ParentBehavior#invoice_consolidation_type
1431
+ module InvoiceConsolidationType
1432
+ extend MetronomeSDK::Internal::Type::Enum
1433
+
1434
+ CONCATENATE = :CONCATENATE
1435
+ NONE = :NONE
1436
+
1437
+ # @!method self.values
1438
+ # @return [Array<Symbol>]
1439
+ end
1440
+ end
1441
+
1442
+ # Indicates whether the parent should pay for the child's invoice charges
1443
+ #
1444
+ # @see MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration#payer
1445
+ module Payer
1446
+ extend MetronomeSDK::Internal::Type::Enum
1447
+
1448
+ SELF = :SELF
1449
+ PARENT = :PARENT
1450
+
1451
+ # @!method self.values
1452
+ # @return [Array<Symbol>]
1453
+ end
1454
+
1455
+ # Indicates the behavior of the child's invoice statements on the parent's
1456
+ # invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
1457
+ # consolidated invoices **SEPARATE**: Child's invoice statements will appear not
1458
+ # appear on parent's consolidated invoices
1459
+ #
1460
+ # @see MetronomeSDK::Models::V1::ContractCreateParams::HierarchyConfiguration#usage_statement_behavior
1461
+ module UsageStatementBehavior
1462
+ extend MetronomeSDK::Internal::Type::Enum
1463
+
1464
+ CONSOLIDATE = :CONSOLIDATE
1465
+ SEPARATE = :SEPARATE
1466
+
1467
+ # @!method self.values
1468
+ # @return [Array<Symbol>]
1469
+ end
1372
1470
  end
1373
1471
 
1374
1472
  # Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
@@ -47,6 +47,12 @@ module MetronomeSDK
47
47
  # @return [String]
48
48
  required :name, String
49
49
 
50
+ # @!attribute updated_at
51
+ # RFC 3339 timestamp indicating when the customer was last updated.
52
+ #
53
+ # @return [Time]
54
+ required :updated_at, Time
55
+
50
56
  # @!attribute archived_at
51
57
  # RFC 3339 timestamp indicating when the customer was archived. Null if the
52
58
  # customer is active.
@@ -60,7 +66,7 @@ module MetronomeSDK
60
66
  # @return [MetronomeSDK::Models::V1::CustomerDetail::CurrentBillableStatus, nil]
61
67
  optional :current_billable_status, -> { MetronomeSDK::V1::CustomerDetail::CurrentBillableStatus }
62
68
 
63
- # @!method initialize(id:, created_at:, custom_fields:, customer_config:, external_id:, ingest_aliases:, name:, archived_at: nil, current_billable_status: nil)
69
+ # @!method initialize(id:, created_at:, custom_fields:, customer_config:, external_id:, ingest_aliases:, name:, updated_at:, archived_at: nil, current_billable_status: nil)
64
70
  # Some parameter documentations has been truncated, see
65
71
  # {MetronomeSDK::Models::V1::CustomerDetail} for more details.
66
72
  #
@@ -78,6 +84,8 @@ module MetronomeSDK
78
84
  #
79
85
  # @param name [String]
80
86
  #
87
+ # @param updated_at [Time] RFC 3339 timestamp indicating when the customer was last updated.
88
+ #
81
89
  # @param archived_at [Time, nil] RFC 3339 timestamp indicating when the customer was archived. Null if the custom
82
90
  #
83
91
  # @param current_billable_status [MetronomeSDK::Models::V1::CustomerDetail::CurrentBillableStatus] This field's availability is dependent on your client's configuration.
@@ -53,14 +53,6 @@ module MetronomeSDK
53
53
  # @return [String]
54
54
  required :event_type, String
55
55
 
56
- # @!attribute customer_id
57
- # This has no effect for preview events, but may be set for consistency with Event
58
- # objects. They will be processed even if they do not match the customer's ID or
59
- # ingest aliases.
60
- #
61
- # @return [String, nil]
62
- optional :customer_id, String
63
-
64
56
  # @!attribute properties
65
57
  #
66
58
  # @return [Hash{Symbol=>Object}, nil]
@@ -73,26 +65,24 @@ module MetronomeSDK
73
65
  optional :timestamp, String
74
66
 
75
67
  # @!attribute transaction_id
76
- # This has no effect for preview events, but may be set for consistency with Event
77
- # objects. Duplicate transaction_ids are NOT filtered out, even within the same
78
- # request.
68
+ # Optional unique identifier for event deduplication. When provided, preview
69
+ # events are automatically deduplicated against historical events from the past 34
70
+ # days. Duplicate transaction IDs within the same request will return an error.
79
71
  #
80
72
  # @return [String, nil]
81
73
  optional :transaction_id, String
82
74
 
83
- # @!method initialize(event_type:, customer_id: nil, properties: nil, timestamp: nil, transaction_id: nil)
75
+ # @!method initialize(event_type:, properties: nil, timestamp: nil, transaction_id: nil)
84
76
  # Some parameter documentations has been truncated, see
85
77
  # {MetronomeSDK::Models::V1::CustomerPreviewEventsParams::Event} for more details.
86
78
  #
87
79
  # @param event_type [String]
88
80
  #
89
- # @param customer_id [String] This has no effect for preview events, but may be set for consistency with Event
90
- #
91
81
  # @param properties [Hash{Symbol=>Object}]
92
82
  #
93
83
  # @param timestamp [String] RFC 3339 formatted. If not provided, the current time will be used.
94
84
  #
95
- # @param transaction_id [String] This has no effect for preview events, but may be set for consistency with Event
85
+ # @param transaction_id [String] Optional unique identifier for event deduplication. When provided, preview event
96
86
  end
97
87
 
98
88
  # If set to "replace", the preview will be generated as if those were the only
@@ -7,11 +7,11 @@ module MetronomeSDK
7
7
  class CustomerPreviewEventsResponse < MetronomeSDK::Internal::Type::BaseModel
8
8
  # @!attribute data
9
9
  #
10
- # @return [MetronomeSDK::Models::V1::Customers::Invoice]
11
- required :data, -> { MetronomeSDK::V1::Customers::Invoice }
10
+ # @return [Array<MetronomeSDK::Models::V1::Customers::Invoice>]
11
+ required :data, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Customers::Invoice] }
12
12
 
13
13
  # @!method initialize(data:)
14
- # @param data [MetronomeSDK::Models::V1::Customers::Invoice]
14
+ # @param data [Array<MetronomeSDK::Models::V1::Customers::Invoice>]
15
15
  end
16
16
  end
17
17
  end
@@ -22,8 +22,8 @@ module MetronomeSDK
22
22
  optional :next_page, String
23
23
 
24
24
  # @!attribute alert_statuses
25
- # Optionally filter by alert status. If absent, only enabled alerts will be
26
- # returned.
25
+ # Optionally filter by threshold notification status. If absent, only enabled
26
+ # notifications will be returned.
27
27
  #
28
28
  # @return [Array<Symbol, MetronomeSDK::Models::V1::Customers::AlertListParams::AlertStatus>, nil]
29
29
  optional :alert_statuses,
@@ -37,7 +37,7 @@ module MetronomeSDK
37
37
  #
38
38
  # @param next_page [String] Cursor that indicates where the next page of results should start.
39
39
  #
40
- # @param alert_statuses [Array<Symbol, MetronomeSDK::Models::V1::Customers::AlertListParams::AlertStatus>] Optionally filter by alert status. If absent, only enabled alerts will be return
40
+ # @param alert_statuses [Array<Symbol, MetronomeSDK::Models::V1::Customers::AlertListParams::AlertStatus>] Optionally filter by threshold notification status. If absent, only enabled noti
41
41
  #
42
42
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
43
43
 
@@ -10,7 +10,7 @@ module MetronomeSDK
10
10
  include MetronomeSDK::Internal::Type::RequestParameters
11
11
 
12
12
  # @!attribute alert_id
13
- # The Metronome ID of the alert
13
+ # The Metronome ID of the threshold notification
14
14
  #
15
15
  # @return [String]
16
16
  required :alert_id, String
@@ -22,7 +22,7 @@ module MetronomeSDK
22
22
  required :customer_id, String
23
23
 
24
24
  # @!method initialize(alert_id:, customer_id:, request_options: {})
25
- # @param alert_id [String] The Metronome ID of the alert
25
+ # @param alert_id [String] The Metronome ID of the threshold notification
26
26
  #
27
27
  # @param customer_id [String] The Metronome ID of the customer
28
28
  #
@@ -10,7 +10,7 @@ module MetronomeSDK
10
10
  include MetronomeSDK::Internal::Type::RequestParameters
11
11
 
12
12
  # @!attribute alert_id
13
- # The Metronome ID of the alert
13
+ # The Metronome ID of the threshold notification
14
14
  #
15
15
  # @return [String]
16
16
  required :alert_id, String
@@ -22,16 +22,16 @@ module MetronomeSDK
22
22
  required :customer_id, String
23
23
 
24
24
  # @!attribute group_values
25
- # Only present for `spend_threshold_reached` alerts. Retrieve the alert for a
26
- # specific group key-value pair.
25
+ # Only present for `spend_threshold_reached` notifications. Retrieve the
26
+ # notification for a specific group key-value pair.
27
27
  #
28
28
  # @return [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>, nil]
29
29
  optional :group_values,
30
30
  -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Customers::AlertRetrieveParams::GroupValue] }
31
31
 
32
32
  # @!attribute plans_or_contracts
33
- # When parallel alerts are enabled during migration, this flag denotes whether to
34
- # fetch alerts for plans or contracts.
33
+ # When parallel threshold notifications are enabled during migration, this flag
34
+ # denotes whether to fetch notifications for plans or contracts.
35
35
  #
36
36
  # @return [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts, nil]
37
37
  optional :plans_or_contracts,
@@ -41,13 +41,13 @@ module MetronomeSDK
41
41
  # Some parameter documentations has been truncated, see
42
42
  # {MetronomeSDK::Models::V1::Customers::AlertRetrieveParams} for more details.
43
43
  #
44
- # @param alert_id [String] The Metronome ID of the alert
44
+ # @param alert_id [String] The Metronome ID of the threshold notification
45
45
  #
46
46
  # @param customer_id [String] The Metronome ID of the customer
47
47
  #
48
- # @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached` alerts. Retrieve the alert for a spec
48
+ # @param group_values [Array<MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::GroupValue>] Only present for `spend_threshold_reached` notifications. Retrieve the notificat
49
49
  #
50
- # @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel alerts are enabled during migration, this flag denotes whether to
50
+ # @param plans_or_contracts [Symbol, MetronomeSDK::Models::V1::Customers::AlertRetrieveParams::PlansOrContracts] When parallel threshold notifications are enabled during migration, this flag de
51
51
  #
52
52
  # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
53
53
 
@@ -63,15 +63,15 @@ module MetronomeSDK
63
63
  required :value, String
64
64
 
65
65
  # @!method initialize(key:, value:)
66
- # Scopes alert evaluation to a specific presentation group key on individual line
67
- # items. Only present for spend alerts.
66
+ # Scopes threshold notification evaluation to a specific presentation group key on
67
+ # individual line items. Only present for spend notifications.
68
68
  #
69
69
  # @param key [String]
70
70
  # @param value [String]
71
71
  end
72
72
 
73
- # When parallel alerts are enabled during migration, this flag denotes whether to
74
- # fetch alerts for plans or contracts.
73
+ # When parallel threshold notifications are enabled during migration, this flag
74
+ # denotes whether to fetch notifications for plans or contracts.
75
75
  module PlansOrContracts
76
76
  extend MetronomeSDK::Internal::Type::Enum
77
77