metronome-sdk 3.7.0 → 3.9.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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/internal/transport/base_client.rb +4 -1
  5. data/lib/metronome_sdk/models/commit.rb +10 -1
  6. data/lib/metronome_sdk/models/contract.rb +46 -16
  7. data/lib/metronome_sdk/models/contract_v2.rb +645 -16
  8. data/lib/metronome_sdk/models/contract_without_amendments.rb +178 -4
  9. data/lib/metronome_sdk/models/credit.rb +10 -1
  10. data/lib/metronome_sdk/models/override.rb +7 -1
  11. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration.rb +10 -2
  12. data/lib/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rb +3 -1
  13. data/lib/metronome_sdk/models/subscription.rb +90 -2
  14. data/lib/metronome_sdk/models/v1/alert_create_params.rb +127 -1
  15. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +17 -4
  16. data/lib/metronome_sdk/models/v1/contract_create_params.rb +290 -10
  17. data/lib/metronome_sdk/models/v1/contract_create_response.rb +243 -17
  18. data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rb +88 -0
  19. data/lib/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rb +62 -0
  20. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +10 -1
  21. data/lib/metronome_sdk/models/v1/customers/alert_retrieve_params.rb +127 -1
  22. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +130 -3
  23. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +10 -1
  24. data/lib/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rb +2 -0
  25. data/lib/metronome_sdk/models/v1/package_create_params.rb +279 -10
  26. data/lib/metronome_sdk/models/v1/package_list_response.rb +264 -7
  27. data/lib/metronome_sdk/models/v1/package_retrieve_response.rb +264 -7
  28. data/lib/metronome_sdk/models/v2/contract_edit_params.rb +517 -9
  29. data/lib/metronome_sdk/models/v2/contract_edit_response.rb +456 -8
  30. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +456 -8
  31. data/lib/metronome_sdk/resources/v1/alerts.rb +3 -1
  32. data/lib/metronome_sdk/resources/v1/contracts/rate_cards/rates.rb +4 -0
  33. data/lib/metronome_sdk/resources/v1/contracts.rb +68 -1
  34. data/lib/metronome_sdk/resources/v1/customers/alerts.rb +4 -2
  35. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +3 -1
  36. data/lib/metronome_sdk/resources/v1/dashboards.rb +7 -2
  37. data/lib/metronome_sdk/version.rb +1 -1
  38. data/lib/metronome_sdk.rb +2 -0
  39. data/rbi/metronome_sdk/models/commit.rbi +13 -0
  40. data/rbi/metronome_sdk/models/contract.rbi +47 -22
  41. data/rbi/metronome_sdk/models/contract_v2.rbi +1472 -96
  42. data/rbi/metronome_sdk/models/contract_without_amendments.rbi +463 -0
  43. data/rbi/metronome_sdk/models/credit.rbi +13 -0
  44. data/rbi/metronome_sdk/models/override.rbi +9 -0
  45. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration.rbi +11 -1
  46. data/rbi/metronome_sdk/models/prepaid_balance_threshold_configuration_v2.rbi +4 -0
  47. data/rbi/metronome_sdk/models/subscription.rbi +212 -3
  48. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +373 -0
  49. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +27 -6
  50. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +719 -9
  51. data/rbi/metronome_sdk/models/v1/contract_create_response.rbi +523 -32
  52. data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbi +112 -0
  53. data/rbi/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbi +119 -0
  54. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +13 -0
  55. data/rbi/metronome_sdk/models/v1/customers/alert_retrieve_params.rbi +360 -0
  56. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +379 -2
  57. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +13 -0
  58. data/rbi/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbi +10 -0
  59. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +706 -9
  60. data/rbi/metronome_sdk/models/v1/package_list_response.rbi +693 -3
  61. data/rbi/metronome_sdk/models/v1/package_retrieve_response.rbi +693 -3
  62. data/rbi/metronome_sdk/models/v2/contract_edit_params.rbi +1372 -69
  63. data/rbi/metronome_sdk/models/v2/contract_edit_response.rbi +1204 -67
  64. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +1204 -67
  65. data/rbi/metronome_sdk/resources/v1/alerts.rbi +8 -0
  66. data/rbi/metronome_sdk/resources/v1/contracts/rate_cards/rates.rbi +4 -0
  67. data/rbi/metronome_sdk/resources/v1/contracts.rbi +70 -0
  68. data/rbi/metronome_sdk/resources/v1/customers/alerts.rbi +8 -1
  69. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +4 -0
  70. data/rbi/metronome_sdk/resources/v1/dashboards.rbi +7 -2
  71. data/sig/metronome_sdk/models/commit.rbs +7 -0
  72. data/sig/metronome_sdk/models/contract.rbs +22 -11
  73. data/sig/metronome_sdk/models/contract_v2.rbs +559 -8
  74. data/sig/metronome_sdk/models/contract_without_amendments.rbs +169 -2
  75. data/sig/metronome_sdk/models/credit.rbs +7 -0
  76. data/sig/metronome_sdk/models/override.rbs +7 -0
  77. data/sig/metronome_sdk/models/subscription.rbs +88 -3
  78. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +144 -0
  79. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +7 -0
  80. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +278 -5
  81. data/sig/metronome_sdk/models/v1/contract_create_response.rbs +197 -17
  82. data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_params.rbs +63 -0
  83. data/sig/metronome_sdk/models/v1/contract_get_subscription_seats_history_response.rbs +59 -0
  84. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +7 -0
  85. data/sig/metronome_sdk/models/v1/customers/alert_retrieve_params.rbs +141 -0
  86. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +150 -0
  87. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +8 -1
  88. data/sig/metronome_sdk/models/v1/dashboard_get_embeddable_url_params.rbs +4 -0
  89. data/sig/metronome_sdk/models/v1/package_create_params.rbs +271 -5
  90. data/sig/metronome_sdk/models/v1/package_list_response.rbs +265 -5
  91. data/sig/metronome_sdk/models/v1/package_retrieve_response.rbs +263 -5
  92. data/sig/metronome_sdk/models/v2/contract_edit_params.rbs +472 -7
  93. data/sig/metronome_sdk/models/v2/contract_edit_response.rbs +428 -5
  94. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +427 -5
  95. data/sig/metronome_sdk/resources/v1/alerts.rbs +1 -0
  96. data/sig/metronome_sdk/resources/v1/contracts.rbs +13 -0
  97. data/sig/metronome_sdk/resources/v1/customers/alerts.rbs +1 -0
  98. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +1 -0
  99. metadata +8 -2
@@ -103,7 +103,6 @@ module MetronomeSDK
103
103
  optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]
104
104
 
105
105
  # @!attribute customer_billing_provider_configuration
106
- # The billing provider configuration associated with the contract.
107
106
  #
108
107
  # @return [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration, nil]
109
108
  optional :customer_billing_provider_configuration,
@@ -238,7 +237,7 @@ module MetronomeSDK
238
237
  #
239
238
  # @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
240
239
  #
241
- # @param customer_billing_provider_configuration [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration] The billing provider configuration associated with the contract.
240
+ # @param customer_billing_provider_configuration [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration]
242
241
  #
243
242
  # @param ending_before [Time]
244
243
  #
@@ -368,29 +367,80 @@ module MetronomeSDK
368
367
  # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract#customer_billing_provider_configuration
369
368
  class CustomerBillingProviderConfiguration < MetronomeSDK::Internal::Type::BaseModel
370
369
  # @!attribute id
370
+ # ID of this configuration; can be provided as the
371
+ # billing_provider_configuration_id when creating a contract.
371
372
  #
372
- # @return [String, nil]
373
- optional :id, String
373
+ # @return [String]
374
+ required :id, String
375
+
376
+ # @!attribute archived_at
377
+ #
378
+ # @return [Time, nil]
379
+ required :archived_at, Time, nil?: true
374
380
 
375
381
  # @!attribute billing_provider
382
+ # The billing provider set for this configuration.
376
383
  #
377
- # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::BillingProvider, nil]
378
- optional :billing_provider,
384
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::BillingProvider]
385
+ required :billing_provider,
379
386
  enum: -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::BillingProvider }
380
387
 
388
+ # @!attribute configuration
389
+ # Configuration for the billing provider. The structure of this object is specific
390
+ # to the billing provider.
391
+ #
392
+ # @return [Hash{Symbol=>Object}]
393
+ required :configuration, MetronomeSDK::Internal::Type::HashOf[MetronomeSDK::Internal::Type::Unknown]
394
+
395
+ # @!attribute customer_id
396
+ #
397
+ # @return [String]
398
+ required :customer_id, String
399
+
381
400
  # @!attribute delivery_method
401
+ # The method to use for delivering invoices to this customer.
382
402
  #
383
- # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::DeliveryMethod, nil]
384
- optional :delivery_method,
403
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::DeliveryMethod]
404
+ required :delivery_method,
385
405
  enum: -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::DeliveryMethod }
386
406
 
387
- # @!method initialize(id: nil, billing_provider: nil, delivery_method: nil)
388
- # The billing provider configuration associated with the contract.
407
+ # @!attribute delivery_method_configuration
408
+ # Configuration for the delivery method. The structure of this object is specific
409
+ # to the delivery method.
389
410
  #
390
- # @param id [String]
391
- # @param billing_provider [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::BillingProvider]
392
- # @param delivery_method [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::DeliveryMethod]
411
+ # @return [Hash{Symbol=>Object}]
412
+ required :delivery_method_configuration,
413
+ MetronomeSDK::Internal::Type::HashOf[MetronomeSDK::Internal::Type::Unknown]
414
+
415
+ # @!attribute delivery_method_id
416
+ # ID of the delivery method to use for this customer.
417
+ #
418
+ # @return [String]
419
+ required :delivery_method_id, String
420
+
421
+ # @!method initialize(id:, archived_at:, billing_provider:, configuration:, customer_id:, delivery_method:, delivery_method_configuration:, delivery_method_id:)
422
+ # Some parameter documentations has been truncated, see
423
+ # {MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration}
424
+ # for more details.
425
+ #
426
+ # @param id [String] ID of this configuration; can be provided as the billing*provider_configuration*
427
+ #
428
+ # @param archived_at [Time, nil]
429
+ #
430
+ # @param billing_provider [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::BillingProvider] The billing provider set for this configuration.
431
+ #
432
+ # @param configuration [Hash{Symbol=>Object}] Configuration for the billing provider. The structure of this object is specific
433
+ #
434
+ # @param customer_id [String]
435
+ #
436
+ # @param delivery_method [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration::DeliveryMethod] The method to use for delivering invoices to this customer.
437
+ #
438
+ # @param delivery_method_configuration [Hash{Symbol=>Object}] Configuration for the delivery method. The structure of this object is specific
439
+ #
440
+ # @param delivery_method_id [String] ID of the delivery method to use for this customer.
393
441
 
442
+ # The billing provider set for this configuration.
443
+ #
394
444
  # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration#billing_provider
395
445
  module BillingProvider
396
446
  extend MetronomeSDK::Internal::Type::Enum
@@ -409,6 +459,8 @@ module MetronomeSDK
409
459
  # @return [Array<Symbol>]
410
460
  end
411
461
 
462
+ # The method to use for delivering invoices to this customer.
463
+ #
412
464
  # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::CustomerBillingProviderConfiguration#delivery_method
413
465
  module DeliveryMethod
414
466
  extend MetronomeSDK::Internal::Type::Enum
@@ -578,6 +630,14 @@ module MetronomeSDK
578
630
  optional :proration,
579
631
  enum: -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::Proration }
580
632
 
633
+ # @!attribute proration_rounding
634
+ # Rounding configuration for prorated recurring commit amounts.
635
+ #
636
+ # @return [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding, nil]
637
+ optional :proration_rounding,
638
+ -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding },
639
+ nil?: true
640
+
581
641
  # @!attribute recurrence_frequency
582
642
  # The frequency at which the recurring commits will be created. If not provided: -
583
643
  # The commits will be created on the usage invoice frequency. If provided: - The
@@ -611,7 +671,7 @@ module MetronomeSDK
611
671
  # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
612
672
  optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
613
673
 
614
- # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, invoice_amount: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
674
+ # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, invoice_amount: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, proration_rounding: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
615
675
  # Some parameter documentations has been truncated, see
616
676
  # {MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit}
617
677
  # for more details.
@@ -650,7 +710,9 @@ module MetronomeSDK
650
710
  #
651
711
  # @param proration [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::Proration] Determines whether the first and last commit will be prorated. If not provided,
652
712
  #
653
- # @param recurrence_frequency [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided:
713
+ # @param proration_rounding [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding, nil] Rounding configuration for prorated recurring commit amounts.
714
+ #
715
+ # @param recurrence_frequency [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided: -
654
716
  #
655
717
  # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
656
718
  #
@@ -795,6 +857,105 @@ module MetronomeSDK
795
857
  # @return [Array<Symbol>]
796
858
  end
797
859
 
860
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit#proration_rounding
861
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
862
+ # @!attribute access
863
+ #
864
+ # @return [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access, nil]
865
+ optional :access,
866
+ -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access }
867
+
868
+ # @!attribute invoice
869
+ #
870
+ # @return [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice, nil]
871
+ optional :invoice,
872
+ -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice }
873
+
874
+ # @!method initialize(access: nil, invoice: nil)
875
+ # Rounding configuration for prorated recurring commit amounts.
876
+ #
877
+ # @param access [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access]
878
+ # @param invoice [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice]
879
+
880
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding#access
881
+ class Access < MetronomeSDK::Internal::Type::BaseModel
882
+ # @!attribute decimal_places
883
+ # Number of decimal places to round to. Applied directly to the stored monetary
884
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
885
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
886
+ # dollar).
887
+ #
888
+ # @return [Float]
889
+ required :decimal_places, Float
890
+
891
+ # @!attribute rounding_method
892
+ #
893
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access::RoundingMethod]
894
+ required :rounding_method,
895
+ enum: -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access::RoundingMethod }
896
+
897
+ # @!method initialize(decimal_places:, rounding_method:)
898
+ # Some parameter documentations has been truncated, see
899
+ # {MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access}
900
+ # for more details.
901
+ #
902
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
903
+ #
904
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access::RoundingMethod]
905
+
906
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Access#rounding_method
907
+ module RoundingMethod
908
+ extend MetronomeSDK::Internal::Type::Enum
909
+
910
+ HALF_UP = :HALF_UP
911
+ FLOOR = :FLOOR
912
+ CEILING = :CEILING
913
+
914
+ # @!method self.values
915
+ # @return [Array<Symbol>]
916
+ end
917
+ end
918
+
919
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding#invoice
920
+ class Invoice < MetronomeSDK::Internal::Type::BaseModel
921
+ # @!attribute decimal_places
922
+ # Number of decimal places to round to. Applied directly to the stored monetary
923
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
924
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
925
+ # dollar).
926
+ #
927
+ # @return [Float]
928
+ required :decimal_places, Float
929
+
930
+ # @!attribute rounding_method
931
+ #
932
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice::RoundingMethod]
933
+ required :rounding_method,
934
+ enum: -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice::RoundingMethod }
935
+
936
+ # @!method initialize(decimal_places:, rounding_method:)
937
+ # Some parameter documentations has been truncated, see
938
+ # {MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice}
939
+ # for more details.
940
+ #
941
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
942
+ #
943
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice::RoundingMethod]
944
+
945
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCommit::ProrationRounding::Invoice#rounding_method
946
+ module RoundingMethod
947
+ extend MetronomeSDK::Internal::Type::Enum
948
+
949
+ HALF_UP = :HALF_UP
950
+ FLOOR = :FLOOR
951
+ CEILING = :CEILING
952
+
953
+ # @!method self.values
954
+ # @return [Array<Symbol>]
955
+ end
956
+ end
957
+ end
958
+
798
959
  # The frequency at which the recurring commits will be created. If not provided: -
799
960
  # The commits will be created on the usage invoice frequency. If provided: - The
800
961
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -809,6 +970,7 @@ module MetronomeSDK
809
970
  QUARTERLY = :QUARTERLY
810
971
  ANNUAL = :ANNUAL
811
972
  WEEKLY = :WEEKLY
973
+ DAILY = :DAILY
812
974
 
813
975
  # @!method self.values
814
976
  # @return [Array<Symbol>]
@@ -916,6 +1078,14 @@ module MetronomeSDK
916
1078
  optional :proration,
917
1079
  enum: -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::Proration }
918
1080
 
1081
+ # @!attribute proration_rounding
1082
+ # Rounding configuration for prorated recurring credit amounts.
1083
+ #
1084
+ # @return [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding, nil]
1085
+ optional :proration_rounding,
1086
+ -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding },
1087
+ nil?: true
1088
+
919
1089
  # @!attribute recurrence_frequency
920
1090
  # The frequency at which the recurring commits will be created. If not provided: -
921
1091
  # The commits will be created on the usage invoice frequency. If provided: - The
@@ -949,7 +1119,7 @@ module MetronomeSDK
949
1119
  # @return [MetronomeSDK::Models::RecurringCommitSubscriptionConfig, nil]
950
1120
  optional :subscription_config, -> { MetronomeSDK::RecurringCommitSubscriptionConfig }
951
1121
 
952
- # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
1122
+ # @!method initialize(id:, access_amount:, commit_duration:, priority:, product:, rate_type:, starting_at:, applicable_product_ids: nil, applicable_product_tags: nil, contract: nil, description: nil, ending_before: nil, hierarchy_configuration: nil, name: nil, netsuite_sales_order_id: nil, proration: nil, proration_rounding: nil, recurrence_frequency: nil, rollover_fraction: nil, specifiers: nil, subscription_config: nil)
953
1123
  # Some parameter documentations has been truncated, see
954
1124
  # {MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit}
955
1125
  # for more details.
@@ -986,7 +1156,9 @@ module MetronomeSDK
986
1156
  #
987
1157
  # @param proration [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::Proration] Determines whether the first and last commit will be prorated. If not provided,
988
1158
  #
989
- # @param recurrence_frequency [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided:
1159
+ # @param proration_rounding [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding, nil] Rounding configuration for prorated recurring credit amounts.
1160
+ #
1161
+ # @param recurrence_frequency [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::RecurrenceFrequency] The frequency at which the recurring commits will be created. If not provided: -
990
1162
  #
991
1163
  # @param rollover_fraction [Float] Will be passed down to the individual commits. This controls how much of an indi
992
1164
  #
@@ -1106,6 +1278,59 @@ module MetronomeSDK
1106
1278
  # @return [Array<Symbol>]
1107
1279
  end
1108
1280
 
1281
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit#proration_rounding
1282
+ class ProrationRounding < MetronomeSDK::Internal::Type::BaseModel
1283
+ # @!attribute access
1284
+ #
1285
+ # @return [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access, nil]
1286
+ optional :access,
1287
+ -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access }
1288
+
1289
+ # @!method initialize(access: nil)
1290
+ # Rounding configuration for prorated recurring credit amounts.
1291
+ #
1292
+ # @param access [MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access]
1293
+
1294
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding#access
1295
+ class Access < MetronomeSDK::Internal::Type::BaseModel
1296
+ # @!attribute decimal_places
1297
+ # Number of decimal places to round to. Applied directly to the stored monetary
1298
+ # representation. Negative values round to powers of 10 (e.g., -2 rounds to
1299
+ # nearest 100 in the stored unit. For USD, this means rounding to the nearest
1300
+ # dollar).
1301
+ #
1302
+ # @return [Float]
1303
+ required :decimal_places, Float
1304
+
1305
+ # @!attribute rounding_method
1306
+ #
1307
+ # @return [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access::RoundingMethod]
1308
+ required :rounding_method,
1309
+ enum: -> { MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access::RoundingMethod }
1310
+
1311
+ # @!method initialize(decimal_places:, rounding_method:)
1312
+ # Some parameter documentations has been truncated, see
1313
+ # {MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access}
1314
+ # for more details.
1315
+ #
1316
+ # @param decimal_places [Float] Number of decimal places to round to. Applied directly to the stored monetary re
1317
+ #
1318
+ # @param rounding_method [Symbol, MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access::RoundingMethod]
1319
+
1320
+ # @see MetronomeSDK::Models::V1::ContractCreateResponse::Data::Contract::RecurringCredit::ProrationRounding::Access#rounding_method
1321
+ module RoundingMethod
1322
+ extend MetronomeSDK::Internal::Type::Enum
1323
+
1324
+ HALF_UP = :HALF_UP
1325
+ FLOOR = :FLOOR
1326
+ CEILING = :CEILING
1327
+
1328
+ # @!method self.values
1329
+ # @return [Array<Symbol>]
1330
+ end
1331
+ end
1332
+ end
1333
+
1109
1334
  # The frequency at which the recurring commits will be created. If not provided: -
1110
1335
  # The commits will be created on the usage invoice frequency. If provided: - The
1111
1336
  # period defined in the duration will correspond to this frequency. - Commits will
@@ -1120,6 +1345,7 @@ module MetronomeSDK
1120
1345
  QUARTERLY = :QUARTERLY
1121
1346
  ANNUAL = :ANNUAL
1122
1347
  WEEKLY = :WEEKLY
1348
+ DAILY = :DAILY
1123
1349
 
1124
1350
  # @!method self.values
1125
1351
  # @return [Array<Symbol>]
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MetronomeSDK
4
+ module Models
5
+ module V1
6
+ # @see MetronomeSDK::Resources::V1::Contracts#get_subscription_seats_history
7
+ class ContractGetSubscriptionSeatsHistoryParams < MetronomeSDK::Internal::Type::BaseModel
8
+ extend MetronomeSDK::Internal::Type::RequestParameters::Converter
9
+ include MetronomeSDK::Internal::Type::RequestParameters
10
+
11
+ # @!attribute contract_id
12
+ #
13
+ # @return [String]
14
+ required :contract_id, String
15
+
16
+ # @!attribute customer_id
17
+ #
18
+ # @return [String]
19
+ required :customer_id, String
20
+
21
+ # @!attribute subscription_id
22
+ #
23
+ # @return [String]
24
+ required :subscription_id, String
25
+
26
+ # @!attribute covering_date
27
+ # Get the seats history segment for the covering date. Cannot be used with
28
+ # `starting_at` or `ending_before`.
29
+ #
30
+ # @return [Time, nil]
31
+ optional :covering_date, Time, nil?: true
32
+
33
+ # @!attribute cursor
34
+ # Cursor for pagination. Use the value from the `next_page` field of the previous
35
+ # response to retrieve the next page of results.
36
+ #
37
+ # @return [String, nil]
38
+ optional :cursor, String, nil?: true
39
+
40
+ # @!attribute ending_before
41
+ # Include seats history segments that are active at or before this timestamp. Use
42
+ # with `starting_at` to get a specific time range. If not set, there's no upper
43
+ # bound.
44
+ #
45
+ # @return [Time, nil]
46
+ optional :ending_before, Time, nil?: true
47
+
48
+ # @!attribute limit
49
+ # Maximum number of seat schedule entries to return. Defaults to 10. Required
50
+ # range: 1 <= x <= 10.
51
+ #
52
+ # @return [Integer, nil]
53
+ optional :limit, Integer, nil?: true
54
+
55
+ # @!attribute starting_at
56
+ # Include seats history segments that are active at or after this timestamp. Use
57
+ # with `ending_before` to get a specific time range. If not set, there's no lower
58
+ # bound.
59
+ #
60
+ # @return [Time, nil]
61
+ optional :starting_at, Time, nil?: true
62
+
63
+ # @!method initialize(contract_id:, customer_id:, subscription_id:, covering_date: nil, cursor: nil, ending_before: nil, limit: nil, starting_at: nil, request_options: {})
64
+ # Some parameter documentations has been truncated, see
65
+ # {MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryParams} for more
66
+ # details.
67
+ #
68
+ # @param contract_id [String]
69
+ #
70
+ # @param customer_id [String]
71
+ #
72
+ # @param subscription_id [String]
73
+ #
74
+ # @param covering_date [Time, nil] Get the seats history segment for the covering date. Cannot be used with `starti
75
+ #
76
+ # @param cursor [String, nil] Cursor for pagination. Use the value from the `next_page` field of the previous
77
+ #
78
+ # @param ending_before [Time, nil] Include seats history segments that are active at or before this timestamp. Use
79
+ #
80
+ # @param limit [Integer, nil] Maximum number of seat schedule entries to return. Defaults to 10. Required rang
81
+ #
82
+ # @param starting_at [Time, nil] Include seats history segments that are active at or after this timestamp. Use w
83
+ #
84
+ # @param request_options [MetronomeSDK::RequestOptions, Hash{Symbol=>Object}]
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MetronomeSDK
4
+ module Models
5
+ module V1
6
+ # @see MetronomeSDK::Resources::V1::Contracts#get_subscription_seats_history
7
+ class ContractGetSubscriptionSeatsHistoryResponse < MetronomeSDK::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ #
10
+ # @return [Array<MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryResponse::Data>]
11
+ required :data,
12
+ -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryResponse::Data] }
13
+
14
+ # @!attribute next_page
15
+ # Cursor for the next page of results
16
+ #
17
+ # @return [String, nil]
18
+ required :next_page, String, nil?: true
19
+
20
+ # @!method initialize(data:, next_page:)
21
+ # @param data [Array<MetronomeSDK::Models::V1::ContractGetSubscriptionSeatsHistoryResponse::Data>]
22
+ #
23
+ # @param next_page [String, nil] Cursor for the next page of results
24
+
25
+ class Data < MetronomeSDK::Internal::Type::BaseModel
26
+ # @!attribute assigned_seat_ids
27
+ # Array of seat IDs that are assigned in this period
28
+ #
29
+ # @return [Array<String>]
30
+ required :assigned_seat_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
31
+
32
+ # @!attribute ending_before
33
+ # The end time of this seat schedule period (null if ongoing)
34
+ #
35
+ # @return [Time, nil]
36
+ required :ending_before, Time, nil?: true
37
+
38
+ # @!attribute starting_at
39
+ # The start time of this seat schedule period
40
+ #
41
+ # @return [Time]
42
+ required :starting_at, Time
43
+
44
+ # @!attribute total_quantity
45
+ # Total number of assigned and unassigned seats in this period
46
+ #
47
+ # @return [Integer]
48
+ required :total_quantity, Integer
49
+
50
+ # @!method initialize(assigned_seat_ids:, ending_before:, starting_at:, total_quantity:)
51
+ # @param assigned_seat_ids [Array<String>] Array of seat IDs that are assigned in this period
52
+ #
53
+ # @param ending_before [Time, nil] The end time of this seat schedule period (null if ongoing)
54
+ #
55
+ # @param starting_at [Time] The start time of this seat schedule period
56
+ #
57
+ # @param total_quantity [Integer] Total number of assigned and unassigned seats in this period
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -71,6 +71,13 @@ module MetronomeSDK
71
71
  # @return [Array<String>, nil]
72
72
  optional :seat_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
73
73
 
74
+ # @!attribute skip_missing_seat_ids
75
+ # When true, any seat_ids not found in contract subscriptions will be silently
76
+ # omitted from the response instead of returning a 400 error.
77
+ #
78
+ # @return [Boolean, nil]
79
+ optional :skip_missing_seat_ids, MetronomeSDK::Internal::Type::Boolean
80
+
74
81
  # @!attribute starting_at
75
82
  # Include only commits or credits with access effective on or after this date
76
83
  # (cannot be used with covering_date).
@@ -86,7 +93,7 @@ module MetronomeSDK
86
93
  # @return [Array<String>, nil]
87
94
  optional :subscription_ids, MetronomeSDK::Internal::Type::ArrayOf[String]
88
95
 
89
- # @!method initialize(contract_id:, customer_id:, covering_date: nil, cursor: nil, effective_before: nil, include_credits_and_commits: nil, include_ledgers: nil, limit: nil, seat_ids: nil, starting_at: nil, subscription_ids: nil, request_options: {})
96
+ # @!method initialize(contract_id:, customer_id:, covering_date: nil, cursor: nil, effective_before: nil, include_credits_and_commits: nil, include_ledgers: nil, limit: nil, seat_ids: nil, skip_missing_seat_ids: nil, starting_at: nil, subscription_ids: nil, request_options: {})
90
97
  # Some parameter documentations has been truncated, see
91
98
  # {MetronomeSDK::Models::V1::ContractListSeatBalancesParams} for more details.
92
99
  #
@@ -108,6 +115,8 @@ module MetronomeSDK
108
115
  #
109
116
  # @param seat_ids [Array<String>] Optional filter to only include specific seats.
110
117
  #
118
+ # @param skip_missing_seat_ids [Boolean] When true, any seat_ids not found in contract subscriptions will be silently omi
119
+ #
111
120
  # @param starting_at [Time] Include only commits or credits with access effective on or after this date (can
112
121
  #
113
122
  # @param subscription_ids [Array<String>] Optional filter to only include seats from specific subscriptions. If subscripti