metronome-sdk 0.1.0 → 0.3.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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/internal/transport/base_client.rb +1 -1
  5. data/lib/metronome_sdk/internal/type/array_of.rb +1 -0
  6. data/lib/metronome_sdk/internal/type/base_model.rb +3 -1
  7. data/lib/metronome_sdk/internal/type/converter.rb +27 -0
  8. data/lib/metronome_sdk/internal/type/hash_of.rb +1 -0
  9. data/lib/metronome_sdk/internal/type/union.rb +9 -7
  10. data/lib/metronome_sdk/models/commit.rb +35 -5
  11. data/lib/metronome_sdk/models/contract_without_amendments.rb +128 -2
  12. data/lib/metronome_sdk/models/credit.rb +21 -3
  13. data/lib/metronome_sdk/models/schedule_point_in_time.rb +14 -1
  14. data/lib/metronome_sdk/models/v1/alert_create_params.rb +9 -11
  15. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +54 -5
  16. data/lib/metronome_sdk/models/v1/contract_create_params.rb +219 -23
  17. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +8 -1
  18. data/lib/metronome_sdk/models/v1/customers/commit_create_params.rb +10 -1
  19. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +29 -1
  20. data/lib/metronome_sdk/models/v1/customers/invoice.rb +13 -1
  21. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +2 -0
  22. data/lib/metronome_sdk/models/v2/contract_edit_commit_params.rb +12 -1
  23. data/lib/metronome_sdk/models/v2/contract_edit_credit_params.rb +12 -1
  24. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +259 -37
  25. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +602 -15
  26. data/lib/metronome_sdk/models/v2/contract_list_response.rb +194 -17
  27. data/lib/metronome_sdk/models/v2/contract_retrieve_response.rb +194 -17
  28. data/lib/metronome_sdk/resources/v1/alerts.rb +2 -2
  29. data/lib/metronome_sdk/resources/v1/contracts/products.rb +3 -1
  30. data/lib/metronome_sdk/resources/v2/contracts.rb +6 -2
  31. data/lib/metronome_sdk/version.rb +1 -1
  32. data/rbi/metronome_sdk/internal/transport/base_client.rbi +1 -1
  33. data/rbi/metronome_sdk/internal/type/converter.rbi +58 -0
  34. data/rbi/metronome_sdk/internal/type/union.rbi +9 -2
  35. data/rbi/metronome_sdk/models/commit.rbi +89 -15
  36. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +304 -6
  37. data/rbi/metronome_sdk/models/credit.rbi +54 -9
  38. data/rbi/metronome_sdk/models/schedule_point_in_time.rbi +17 -1
  39. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +16 -18
  40. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +76 -3
  41. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +433 -26
  42. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +9 -0
  43. data/rbi/metronome_sdk/models/v1/customers/commit_create_params.rbi +13 -0
  44. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +60 -0
  45. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +16 -0
  46. data/rbi/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbi +10 -0
  47. data/rbi/metronome_sdk/models/v2/contract_edit_commit_params.rbi +14 -0
  48. data/rbi/metronome_sdk/models/v2/contract_edit_credit_params.rbi +14 -0
  49. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +481 -38
  50. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1565 -42
  51. data/rbi/metronome_sdk/models/v2/contract_list_response.rbi +431 -37
  52. data/rbi/metronome_sdk/models/v2/contract_retrieve_response.rbi +431 -37
  53. data/rbi/metronome_sdk/resources/v1/alerts.rbi +5 -5
  54. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +2 -0
  55. data/rbi/metronome_sdk/resources/v2/contracts.rbi +12 -0
  56. data/sig/metronome_sdk/internal/transport/base_client.rbs +1 -1
  57. data/sig/metronome_sdk/internal/type/converter.rbs +17 -0
  58. data/sig/metronome_sdk/internal/type/union.rbs +2 -2
  59. data/sig/metronome_sdk/models/commit.rbs +50 -15
  60. data/sig/metronome_sdk/models/contract_without_amendments.rbs +120 -6
  61. data/sig/metronome_sdk/models/credit.rbs +30 -9
  62. data/sig/metronome_sdk/models/schedule_point_in_time.rbs +7 -0
  63. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +9 -9
  64. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +38 -3
  65. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +168 -6
  66. data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +7 -0
  67. data/sig/metronome_sdk/models/v1/customers/commit_create_params.rbs +7 -0
  68. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +21 -0
  69. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +5 -0
  70. data/sig/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbs +4 -0
  71. data/sig/metronome_sdk/models/v2/contract_edit_commit_params.rbs +5 -0
  72. data/sig/metronome_sdk/models/v2/contract_edit_credit_params.rbs +5 -0
  73. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +178 -6
  74. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +629 -6
  75. data/sig/metronome_sdk/models/v2/contract_list_response.rbs +205 -30
  76. data/sig/metronome_sdk/models/v2/contract_retrieve_response.rbs +205 -30
  77. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -1
  78. data/sig/metronome_sdk/resources/v1/contracts/products.rbs +1 -0
  79. data/sig/metronome_sdk/resources/v2/contracts.rbs +2 -0
  80. metadata +2 -2
@@ -105,6 +105,16 @@ module MetronomeSDK
105
105
  MetronomeSDK::V1::Customers::CustomerAlert::Alert::GroupKeyFilter
106
106
  }
107
107
 
108
+ # @!attribute group_values
109
+ # Only present for `spend_threshold_reached` alerts. Scope alert to a specific
110
+ # group key on individual line items.
111
+ #
112
+ # @return [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupValue>, nil]
113
+ optional :group_values,
114
+ -> {
115
+ MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::Customers::CustomerAlert::Alert::GroupValue]
116
+ }
117
+
108
118
  # @!attribute invoice_types_filter
109
119
  # Only supported for invoice_total_reached alerts. A list of invoice types to
110
120
  # evaluate.
@@ -120,7 +130,7 @@ module MetronomeSDK
120
130
  # @return [String, nil]
121
131
  optional :uniqueness_key, String
122
132
 
123
- # @!method initialize(id:, name:, status:, threshold:, type:, updated_at:, credit_grant_type_filters: nil, credit_type: nil, custom_field_filters: nil, group_key_filter: nil, invoice_types_filter: nil, uniqueness_key: nil)
133
+ # @!method initialize(id:, name:, status:, threshold:, type:, updated_at:, credit_grant_type_filters: nil, credit_type: nil, custom_field_filters: nil, group_key_filter: nil, group_values: nil, invoice_types_filter: nil, uniqueness_key: nil)
124
134
  # Some parameter documentations has been truncated, see
125
135
  # {MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert} for more details.
126
136
  #
@@ -144,6 +154,8 @@ module MetronomeSDK
144
154
  #
145
155
  # @param group_key_filter [MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupKeyFilter] Scopes alert evaluation to a specific presentation group key on individual line
146
156
  #
157
+ # @param group_values [Array<MetronomeSDK::Models::V1::Customers::CustomerAlert::Alert::GroupValue>] Only present for `spend_threshold_reached` alerts. Scope alert to a specific gro
158
+ #
147
159
  # @param invoice_types_filter [Array<String>] Only supported for invoice_total_reached alerts. A list of invoice types to eval
148
160
  #
149
161
  # @param uniqueness_key [String] Prevents the creation of duplicates. If a request to create a record is made wit
@@ -245,6 +257,22 @@ module MetronomeSDK
245
257
  # @param key [String]
246
258
  # @param value [String]
247
259
  end
260
+
261
+ class GroupValue < MetronomeSDK::Internal::Type::BaseModel
262
+ # @!attribute key
263
+ #
264
+ # @return [String]
265
+ required :key, String
266
+
267
+ # @!attribute value
268
+ #
269
+ # @return [String]
270
+ required :value, String
271
+
272
+ # @!method initialize(key:, value:)
273
+ # @param key [String]
274
+ # @param value [String]
275
+ end
248
276
  end
249
277
 
250
278
  # The status of the customer alert. If the alert is archived, null will be
@@ -237,6 +237,16 @@ module MetronomeSDK
237
237
  # @return [Float]
238
238
  required :total, Float
239
239
 
240
+ # @!attribute type
241
+ # The type of line item. Possible values are 'aws_royalty',
242
+ # 'applied_commit_or_credit', 'scheduled', 'commit_purchase', 'cpu_conversion',
243
+ # 'discount', 'gcp_royalty', 'postpaid_trueup', 'professional_services',
244
+ # 'subscription', 'usage', 'legacy', 'minimum', 'product_charge',
245
+ # 'trial_discount', 'rollover', 'seat', 'grouped_charge'.
246
+ #
247
+ # @return [String]
248
+ required :type, String
249
+
240
250
  # @!attribute applied_commit_or_credit
241
251
  # Details about the credit or commit that was applied to this line item. Only
242
252
  # present on line items with product of `USAGE`, `SUBSCRIPTION` or `COMPOSITE`
@@ -460,7 +470,7 @@ module MetronomeSDK
460
470
  # @return [Float, nil]
461
471
  optional :unit_price, Float
462
472
 
463
- # @!method initialize(credit_type:, name:, total:, applied_commit_or_credit: nil, commit_custom_fields: nil, commit_id: nil, commit_netsuite_item_id: nil, commit_netsuite_sales_order_id: nil, commit_segment_id: nil, commit_type: nil, custom_fields: nil, discount_custom_fields: nil, discount_id: nil, ending_before: nil, group_key: nil, group_value: nil, is_prorated: nil, list_price: nil, metadata: nil, netsuite_invoice_billing_end: nil, netsuite_invoice_billing_start: nil, netsuite_item_id: nil, postpaid_commit: nil, presentation_group_values: nil, pricing_group_values: nil, product_custom_fields: nil, product_id: nil, product_tags: nil, product_type: nil, professional_service_custom_fields: nil, professional_service_id: nil, quantity: nil, reseller_type: nil, scheduled_charge_custom_fields: nil, scheduled_charge_id: nil, starting_at: nil, sub_line_items: nil, subscription_custom_fields: nil, tier: nil, unit_price: nil)
473
+ # @!method initialize(credit_type:, name:, total:, type:, applied_commit_or_credit: nil, commit_custom_fields: nil, commit_id: nil, commit_netsuite_item_id: nil, commit_netsuite_sales_order_id: nil, commit_segment_id: nil, commit_type: nil, custom_fields: nil, discount_custom_fields: nil, discount_id: nil, ending_before: nil, group_key: nil, group_value: nil, is_prorated: nil, list_price: nil, metadata: nil, netsuite_invoice_billing_end: nil, netsuite_invoice_billing_start: nil, netsuite_item_id: nil, postpaid_commit: nil, presentation_group_values: nil, pricing_group_values: nil, product_custom_fields: nil, product_id: nil, product_tags: nil, product_type: nil, professional_service_custom_fields: nil, professional_service_id: nil, quantity: nil, reseller_type: nil, scheduled_charge_custom_fields: nil, scheduled_charge_id: nil, starting_at: nil, sub_line_items: nil, subscription_custom_fields: nil, tier: nil, unit_price: nil)
464
474
  # Some parameter documentations has been truncated, see
465
475
  # {MetronomeSDK::Models::V1::Customers::Invoice::LineItem} for more details.
466
476
  #
@@ -470,6 +480,8 @@ module MetronomeSDK
470
480
  #
471
481
  # @param total [Float]
472
482
  #
483
+ # @param type [String] The type of line item. Possible values are 'aws_royalty', 'applied_commit_or_cre
484
+ #
473
485
  # @param applied_commit_or_credit [MetronomeSDK::Models::V1::Customers::Invoice::LineItem::AppliedCommitOrCredit] Details about the credit or commit that was applied to this line item. Only pres
474
486
  #
475
487
  # @param commit_custom_fields [Hash{Symbol=>String}]
@@ -148,6 +148,8 @@ module MetronomeSDK
148
148
  USAGE_LINE_9 = :UsageLine_9
149
149
  PRIMARY_GREEN = :Primary_green
150
150
  PRIMARY_RED = :Primary_red
151
+ PROGRESS_BAR = :Progress_bar
152
+ PROGRESS_BAR_BACKGROUND = :Progress_bar_background
151
153
 
152
154
  # @!method self.values
153
155
  # @return [Array<Symbol>]
@@ -52,6 +52,13 @@ module MetronomeSDK
52
52
  # @return [MetronomeSDK::Models::V2::ContractEditCommitParams::InvoiceSchedule, nil]
53
53
  optional :invoice_schedule, -> { MetronomeSDK::V2::ContractEditCommitParams::InvoiceSchedule }
54
54
 
55
+ # @!attribute priority
56
+ # If multiple commits are applicable, the one with the lower priority will apply
57
+ # first.
58
+ #
59
+ # @return [Float, nil]
60
+ optional :priority, Float, nil?: true
61
+
55
62
  # @!attribute product_id
56
63
  #
57
64
  # @return [String, nil]
@@ -62,6 +69,8 @@ module MetronomeSDK
62
69
  # or credit. A customer's usage needs to meet the condition of at least one of the
63
70
  # specifiers to contribute to a commit's or credit's drawdown. This field cannot
64
71
  # be used together with `applicable_product_ids` or `applicable_product_tags`.
72
+ # Instead, to target usage by product or product tag, pass those values in the
73
+ # body of `specifiers`.
65
74
  #
66
75
  # @return [Array<MetronomeSDK::Models::V2::ContractEditCommitParams::Specifier>, nil]
67
76
  optional :specifiers,
@@ -70,7 +79,7 @@ module MetronomeSDK
70
79
  },
71
80
  nil?: true
72
81
 
73
- # @!method initialize(commit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, invoice_contract_id: nil, invoice_schedule: nil, product_id: nil, specifiers: nil, request_options: {})
82
+ # @!method initialize(commit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, invoice_contract_id: nil, invoice_schedule: nil, priority: nil, product_id: nil, specifiers: nil, request_options: {})
74
83
  # Some parameter documentations has been truncated, see
75
84
  # {MetronomeSDK::Models::V2::ContractEditCommitParams} for more details.
76
85
  #
@@ -88,6 +97,8 @@ module MetronomeSDK
88
97
  #
89
98
  # @param invoice_schedule [MetronomeSDK::Models::V2::ContractEditCommitParams::InvoiceSchedule]
90
99
  #
100
+ # @param priority [Float, nil] If multiple commits are applicable, the one with the lower priority will apply f
101
+ #
91
102
  # @param product_id [String]
92
103
  #
93
104
  # @param specifiers [Array<MetronomeSDK::Models::V2::ContractEditCommitParams::Specifier>, nil] List of filters that determine what kind of customer usage draws down a commit o
@@ -39,6 +39,13 @@ module MetronomeSDK
39
39
  # @return [Array<String>, nil]
40
40
  optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String], nil?: true
41
41
 
42
+ # @!attribute priority
43
+ # If multiple commits are applicable, the one with the lower priority will apply
44
+ # first.
45
+ #
46
+ # @return [Float, nil]
47
+ optional :priority, Float, nil?: true
48
+
42
49
  # @!attribute product_id
43
50
  #
44
51
  # @return [String, nil]
@@ -49,6 +56,8 @@ module MetronomeSDK
49
56
  # or credit. A customer's usage needs to meet the condition of at least one of the
50
57
  # specifiers to contribute to a commit's or credit's drawdown. This field cannot
51
58
  # be used together with `applicable_product_ids` or `applicable_product_tags`.
59
+ # Instead, to target usage by product or product tag, pass those values in the
60
+ # body of `specifiers`.
52
61
  #
53
62
  # @return [Array<MetronomeSDK::Models::V2::ContractEditCreditParams::Specifier>, nil]
54
63
  optional :specifiers,
@@ -57,7 +66,7 @@ module MetronomeSDK
57
66
  },
58
67
  nil?: true
59
68
 
60
- # @!method initialize(credit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, product_id: nil, specifiers: nil, request_options: {})
69
+ # @!method initialize(credit_id:, customer_id:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, priority: nil, product_id: nil, specifiers: nil, request_options: {})
61
70
  # Some parameter documentations has been truncated, see
62
71
  # {MetronomeSDK::Models::V2::ContractEditCreditParams} for more details.
63
72
  #
@@ -71,6 +80,8 @@ module MetronomeSDK
71
80
  #
72
81
  # @param applicable_product_tags [Array<String>, nil] Which tags the credit applies to. If both applicable*product_ids and applicable*
73
82
  #
83
+ # @param priority [Float, nil] If multiple commits are applicable, the one with the lower priority will apply f
84
+ #
74
85
  # @param product_id [String]
75
86
  #
76
87
  # @param specifiers [Array<MetronomeSDK::Models::V2::ContractEditCreditParams::Specifier>, nil] List of filters that determine what kind of customer usage draws down a commit o