metronome-sdk 3.5.0 → 3.6.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/README.md +1 -1
  4. data/lib/metronome_sdk/client.rb +15 -1
  5. data/lib/metronome_sdk/internal/transport/base_client.rb +2 -0
  6. data/lib/metronome_sdk/models/contract_v2.rb +362 -4
  7. data/lib/metronome_sdk/models/v1/alert_create_params.rb +1 -0
  8. data/lib/metronome_sdk/models/v1/contract_amend_params.rb +1 -177
  9. data/lib/metronome_sdk/models/v1/contract_create_params.rb +2 -179
  10. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_params.rb +119 -0
  11. data/lib/metronome_sdk/models/v1/contract_list_seat_balances_response.rb +315 -0
  12. data/lib/metronome_sdk/models/v1/contracts/product_create_params.rb +31 -1
  13. data/lib/metronome_sdk/models/v1/contracts/product_update_params.rb +31 -1
  14. data/lib/metronome_sdk/models/v1/customers/customer_alert.rb +1 -0
  15. data/lib/metronome_sdk/models/v1/customers/invoice.rb +8 -1
  16. data/lib/metronome_sdk/models/v1/customers/invoice_list_params.rb +29 -1
  17. data/lib/metronome_sdk/models/v1/package_create_params.rb +1 -18
  18. data/lib/metronome_sdk/models/v2/contract_get_edit_history_response.rb +362 -3
  19. data/lib/metronome_sdk/resources/v1/contracts/products.rb +6 -2
  20. data/lib/metronome_sdk/resources/v1/contracts.rb +69 -2
  21. data/lib/metronome_sdk/resources/v1/customers/invoices.rb +5 -1
  22. data/lib/metronome_sdk/resources/v1/packages.rb +1 -3
  23. data/lib/metronome_sdk/version.rb +1 -1
  24. data/lib/metronome_sdk.rb +2 -0
  25. data/rbi/metronome_sdk/models/contract_v2.rbi +763 -4
  26. data/rbi/metronome_sdk/models/v1/alert_create_params.rbi +5 -0
  27. data/rbi/metronome_sdk/models/v1/contract_amend_params.rbi +0 -396
  28. data/rbi/metronome_sdk/models/v1/contract_create_params.rbi +2 -398
  29. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_params.rbi +179 -0
  30. data/rbi/metronome_sdk/models/v1/contract_list_seat_balances_response.rbi +714 -0
  31. data/rbi/metronome_sdk/models/v1/contracts/product_create_params.rbi +74 -0
  32. data/rbi/metronome_sdk/models/v1/contracts/product_update_params.rbi +74 -0
  33. data/rbi/metronome_sdk/models/v1/customers/customer_alert.rbi +5 -0
  34. data/rbi/metronome_sdk/models/v1/customers/invoice.rbi +9 -0
  35. data/rbi/metronome_sdk/models/v1/customers/invoice_list_params.rbi +75 -0
  36. data/rbi/metronome_sdk/models/v1/package_create_params.rbi +0 -56
  37. data/rbi/metronome_sdk/models/v2/contract_get_edit_history_response.rbi +792 -4
  38. data/rbi/metronome_sdk/resources/v1/contracts/products.rbi +18 -0
  39. data/rbi/metronome_sdk/resources/v1/contracts.rbi +81 -3
  40. data/rbi/metronome_sdk/resources/v1/customers/invoices.rbi +7 -0
  41. data/rbi/metronome_sdk/resources/v1/packages.rbi +0 -3
  42. data/sig/metronome_sdk/models/contract_v2.rbs +324 -6
  43. data/sig/metronome_sdk/models/v1/alert_create_params.rbs +3 -1
  44. data/sig/metronome_sdk/models/v1/contract_amend_params.rbs +0 -137
  45. data/sig/metronome_sdk/models/v1/contract_create_params.rbs +0 -137
  46. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_params.rbs +96 -0
  47. data/sig/metronome_sdk/models/v1/contract_list_seat_balances_response.rbs +299 -0
  48. data/sig/metronome_sdk/models/v1/contracts/product_create_params.rbs +20 -0
  49. data/sig/metronome_sdk/models/v1/contracts/product_update_params.rbs +20 -0
  50. data/sig/metronome_sdk/models/v1/customers/customer_alert.rbs +3 -1
  51. data/sig/metronome_sdk/models/v1/customers/invoice.rbs +7 -0
  52. data/sig/metronome_sdk/models/v1/customers/invoice_list_params.rbs +29 -1
  53. data/sig/metronome_sdk/models/v1/package_create_params.rbs +0 -20
  54. data/sig/metronome_sdk/models/v2/contract_get_edit_history_response.rbs +319 -6
  55. data/sig/metronome_sdk/resources/v1/contracts/products.rbs +2 -0
  56. data/sig/metronome_sdk/resources/v1/contracts.rbs +15 -0
  57. data/sig/metronome_sdk/resources/v1/customers/invoices.rbs +2 -0
  58. data/sig/metronome_sdk/resources/v1/packages.rbs +0 -1
  59. metadata +8 -2
@@ -187,7 +187,7 @@ module MetronomeSDK
187
187
 
188
188
  # If provided, provisions a customer on a package instead of creating a
189
189
  # traditional contract. When specified, only customer_id, starting_at, package_id,
190
- # and uniqueness_key are allowed.
190
+ # uniqueness_key, transition, and custom_fields are allowed.
191
191
  sig { returns(T.nilable(String)) }
192
192
  attr_reader :package_id
193
193
 
@@ -558,7 +558,7 @@ module MetronomeSDK
558
558
  package_alias: nil,
559
559
  # If provided, provisions a customer on a package instead of creating a
560
560
  # traditional contract. When specified, only customer_id, starting_at, package_id,
561
- # and uniqueness_key are allowed.
561
+ # uniqueness_key, transition, and custom_fields are allowed.
562
562
  package_id: nil,
563
563
  prepaid_balance_threshold_configuration: nil,
564
564
  # This field's availability is dependent on your client's configuration.
@@ -983,24 +983,6 @@ module MetronomeSDK
983
983
  sig { params(netsuite_sales_order_id: String).void }
984
984
  attr_writer :netsuite_sales_order_id
985
985
 
986
- # optionally payment gate this commit
987
- sig do
988
- returns(
989
- T.nilable(
990
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig
991
- )
992
- )
993
- end
994
- attr_reader :payment_gate_config
995
-
996
- sig do
997
- params(
998
- payment_gate_config:
999
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::OrHash
1000
- ).void
1001
- end
1002
- attr_writer :payment_gate_config
1003
-
1004
986
  # If multiple commits are applicable, the one with the lower priority will apply
1005
987
  # first.
1006
988
  sig { returns(T.nilable(Float)) }
@@ -1075,8 +1057,6 @@ module MetronomeSDK
1075
1057
  MetronomeSDK::V1::ContractCreateParams::Commit::InvoiceSchedule::OrHash,
1076
1058
  name: String,
1077
1059
  netsuite_sales_order_id: String,
1078
- payment_gate_config:
1079
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::OrHash,
1080
1060
  priority: Float,
1081
1061
  rate_type:
1082
1062
  MetronomeSDK::V1::ContractCreateParams::Commit::RateType::OrSymbol,
@@ -1117,8 +1097,6 @@ module MetronomeSDK
1117
1097
  name: nil,
1118
1098
  # This field's availability is dependent on your client's configuration.
1119
1099
  netsuite_sales_order_id: nil,
1120
- # optionally payment gate this commit
1121
- payment_gate_config: nil,
1122
1100
  # If multiple commits are applicable, the one with the lower priority will apply
1123
1101
  # first.
1124
1102
  priority: nil,
@@ -1155,8 +1133,6 @@ module MetronomeSDK
1155
1133
  MetronomeSDK::V1::ContractCreateParams::Commit::InvoiceSchedule,
1156
1134
  name: String,
1157
1135
  netsuite_sales_order_id: String,
1158
- payment_gate_config:
1159
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig,
1160
1136
  priority: Float,
1161
1137
  rate_type:
1162
1138
  MetronomeSDK::V1::ContractCreateParams::Commit::RateType::OrSymbol,
@@ -1700,378 +1676,6 @@ module MetronomeSDK
1700
1676
  end
1701
1677
  end
1702
1678
 
1703
- class PaymentGateConfig < MetronomeSDK::Internal::Type::BaseModel
1704
- OrHash =
1705
- T.type_alias do
1706
- T.any(
1707
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig,
1708
- MetronomeSDK::Internal::AnyHash
1709
- )
1710
- end
1711
-
1712
- # Gate access to the commit balance based on successful collection of payment.
1713
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1714
- # facilitate payment using your own payment integration. Select NONE if you do not
1715
- # wish to payment gate the commit balance.
1716
- sig do
1717
- returns(
1718
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::OrSymbol
1719
- )
1720
- end
1721
- attr_accessor :payment_gate_type
1722
-
1723
- # Only applicable if using PRECALCULATED as your tax type.
1724
- sig do
1725
- returns(
1726
- T.nilable(
1727
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig
1728
- )
1729
- )
1730
- end
1731
- attr_reader :precalculated_tax_config
1732
-
1733
- sig do
1734
- params(
1735
- precalculated_tax_config:
1736
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig::OrHash
1737
- ).void
1738
- end
1739
- attr_writer :precalculated_tax_config
1740
-
1741
- # Only applicable if using STRIPE as your payment gate type.
1742
- sig do
1743
- returns(
1744
- T.nilable(
1745
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig
1746
- )
1747
- )
1748
- end
1749
- attr_reader :stripe_config
1750
-
1751
- sig do
1752
- params(
1753
- stripe_config:
1754
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::OrHash
1755
- ).void
1756
- end
1757
- attr_writer :stripe_config
1758
-
1759
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1760
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
1761
- # will default to NONE.
1762
- sig do
1763
- returns(
1764
- T.nilable(
1765
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1766
- )
1767
- )
1768
- end
1769
- attr_reader :tax_type
1770
-
1771
- sig do
1772
- params(
1773
- tax_type:
1774
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1775
- ).void
1776
- end
1777
- attr_writer :tax_type
1778
-
1779
- # optionally payment gate this commit
1780
- sig do
1781
- params(
1782
- payment_gate_type:
1783
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::OrSymbol,
1784
- precalculated_tax_config:
1785
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig::OrHash,
1786
- stripe_config:
1787
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::OrHash,
1788
- tax_type:
1789
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1790
- ).returns(T.attached_class)
1791
- end
1792
- def self.new(
1793
- # Gate access to the commit balance based on successful collection of payment.
1794
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1795
- # facilitate payment using your own payment integration. Select NONE if you do not
1796
- # wish to payment gate the commit balance.
1797
- payment_gate_type:,
1798
- # Only applicable if using PRECALCULATED as your tax type.
1799
- precalculated_tax_config: nil,
1800
- # Only applicable if using STRIPE as your payment gate type.
1801
- stripe_config: nil,
1802
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1803
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
1804
- # will default to NONE.
1805
- tax_type: nil
1806
- )
1807
- end
1808
-
1809
- sig do
1810
- override.returns(
1811
- {
1812
- payment_gate_type:
1813
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::OrSymbol,
1814
- precalculated_tax_config:
1815
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig,
1816
- stripe_config:
1817
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig,
1818
- tax_type:
1819
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::OrSymbol
1820
- }
1821
- )
1822
- end
1823
- def to_hash
1824
- end
1825
-
1826
- # Gate access to the commit balance based on successful collection of payment.
1827
- # Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1828
- # facilitate payment using your own payment integration. Select NONE if you do not
1829
- # wish to payment gate the commit balance.
1830
- module PaymentGateType
1831
- extend MetronomeSDK::Internal::Type::Enum
1832
-
1833
- TaggedSymbol =
1834
- T.type_alias do
1835
- T.all(
1836
- Symbol,
1837
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType
1838
- )
1839
- end
1840
- OrSymbol = T.type_alias { T.any(Symbol, String) }
1841
-
1842
- NONE =
1843
- T.let(
1844
- :NONE,
1845
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1846
- )
1847
- STRIPE =
1848
- T.let(
1849
- :STRIPE,
1850
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1851
- )
1852
- EXTERNAL =
1853
- T.let(
1854
- :EXTERNAL,
1855
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1856
- )
1857
-
1858
- sig do
1859
- override.returns(
1860
- T::Array[
1861
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PaymentGateType::TaggedSymbol
1862
- ]
1863
- )
1864
- end
1865
- def self.values
1866
- end
1867
- end
1868
-
1869
- class PrecalculatedTaxConfig < MetronomeSDK::Internal::Type::BaseModel
1870
- OrHash =
1871
- T.type_alias do
1872
- T.any(
1873
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::PrecalculatedTaxConfig,
1874
- MetronomeSDK::Internal::AnyHash
1875
- )
1876
- end
1877
-
1878
- # Amount of tax to be applied. This should be in the same currency and
1879
- # denomination as the commit's invoice schedule
1880
- sig { returns(Float) }
1881
- attr_accessor :tax_amount
1882
-
1883
- # Name of the tax to be applied. This may be used in an invoice line item
1884
- # description.
1885
- sig { returns(T.nilable(String)) }
1886
- attr_reader :tax_name
1887
-
1888
- sig { params(tax_name: String).void }
1889
- attr_writer :tax_name
1890
-
1891
- # Only applicable if using PRECALCULATED as your tax type.
1892
- sig do
1893
- params(tax_amount: Float, tax_name: String).returns(
1894
- T.attached_class
1895
- )
1896
- end
1897
- def self.new(
1898
- # Amount of tax to be applied. This should be in the same currency and
1899
- # denomination as the commit's invoice schedule
1900
- tax_amount:,
1901
- # Name of the tax to be applied. This may be used in an invoice line item
1902
- # description.
1903
- tax_name: nil
1904
- )
1905
- end
1906
-
1907
- sig { override.returns({ tax_amount: Float, tax_name: String }) }
1908
- def to_hash
1909
- end
1910
- end
1911
-
1912
- class StripeConfig < MetronomeSDK::Internal::Type::BaseModel
1913
- OrHash =
1914
- T.type_alias do
1915
- T.any(
1916
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig,
1917
- MetronomeSDK::Internal::AnyHash
1918
- )
1919
- end
1920
-
1921
- # If left blank, will default to INVOICE
1922
- sig do
1923
- returns(
1924
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::OrSymbol
1925
- )
1926
- end
1927
- attr_accessor :payment_type
1928
-
1929
- # Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1930
- # your payment type.
1931
- sig { returns(T.nilable(T::Hash[Symbol, String])) }
1932
- attr_reader :invoice_metadata
1933
-
1934
- sig { params(invoice_metadata: T::Hash[Symbol, String]).void }
1935
- attr_writer :invoice_metadata
1936
-
1937
- # If true, the payment will be made assuming the customer is present (i.e. on
1938
- # session).
1939
- #
1940
- # If false, the payment will be made assuming the customer is not present (i.e.
1941
- # off session). For cardholders from a country with an e-mandate requirement (e.g.
1942
- # India), the payment may be declined.
1943
- #
1944
- # If left blank, will default to false.
1945
- sig { returns(T.nilable(T::Boolean)) }
1946
- attr_reader :on_session_payment
1947
-
1948
- sig { params(on_session_payment: T::Boolean).void }
1949
- attr_writer :on_session_payment
1950
-
1951
- # Only applicable if using STRIPE as your payment gate type.
1952
- sig do
1953
- params(
1954
- payment_type:
1955
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::OrSymbol,
1956
- invoice_metadata: T::Hash[Symbol, String],
1957
- on_session_payment: T::Boolean
1958
- ).returns(T.attached_class)
1959
- end
1960
- def self.new(
1961
- # If left blank, will default to INVOICE
1962
- payment_type:,
1963
- # Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1964
- # your payment type.
1965
- invoice_metadata: nil,
1966
- # If true, the payment will be made assuming the customer is present (i.e. on
1967
- # session).
1968
- #
1969
- # If false, the payment will be made assuming the customer is not present (i.e.
1970
- # off session). For cardholders from a country with an e-mandate requirement (e.g.
1971
- # India), the payment may be declined.
1972
- #
1973
- # If left blank, will default to false.
1974
- on_session_payment: nil
1975
- )
1976
- end
1977
-
1978
- sig do
1979
- override.returns(
1980
- {
1981
- payment_type:
1982
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::OrSymbol,
1983
- invoice_metadata: T::Hash[Symbol, String],
1984
- on_session_payment: T::Boolean
1985
- }
1986
- )
1987
- end
1988
- def to_hash
1989
- end
1990
-
1991
- # If left blank, will default to INVOICE
1992
- module PaymentType
1993
- extend MetronomeSDK::Internal::Type::Enum
1994
-
1995
- TaggedSymbol =
1996
- T.type_alias do
1997
- T.all(
1998
- Symbol,
1999
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType
2000
- )
2001
- end
2002
- OrSymbol = T.type_alias { T.any(Symbol, String) }
2003
-
2004
- INVOICE =
2005
- T.let(
2006
- :INVOICE,
2007
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::TaggedSymbol
2008
- )
2009
- PAYMENT_INTENT =
2010
- T.let(
2011
- :PAYMENT_INTENT,
2012
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::TaggedSymbol
2013
- )
2014
-
2015
- sig do
2016
- override.returns(
2017
- T::Array[
2018
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::StripeConfig::PaymentType::TaggedSymbol
2019
- ]
2020
- )
2021
- end
2022
- def self.values
2023
- end
2024
- end
2025
- end
2026
-
2027
- # Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2028
- # not wish Metronome to calculate tax on your behalf. Leaving this field blank
2029
- # will default to NONE.
2030
- module TaxType
2031
- extend MetronomeSDK::Internal::Type::Enum
2032
-
2033
- TaggedSymbol =
2034
- T.type_alias do
2035
- T.all(
2036
- Symbol,
2037
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType
2038
- )
2039
- end
2040
- OrSymbol = T.type_alias { T.any(Symbol, String) }
2041
-
2042
- NONE =
2043
- T.let(
2044
- :NONE,
2045
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2046
- )
2047
- STRIPE =
2048
- T.let(
2049
- :STRIPE,
2050
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2051
- )
2052
- ANROK =
2053
- T.let(
2054
- :ANROK,
2055
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2056
- )
2057
- PRECALCULATED =
2058
- T.let(
2059
- :PRECALCULATED,
2060
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2061
- )
2062
-
2063
- sig do
2064
- override.returns(
2065
- T::Array[
2066
- MetronomeSDK::V1::ContractCreateParams::Commit::PaymentGateConfig::TaxType::TaggedSymbol
2067
- ]
2068
- )
2069
- end
2070
- def self.values
2071
- end
2072
- end
2073
- end
2074
-
2075
1679
  module RateType
2076
1680
  extend MetronomeSDK::Internal::Type::Enum
2077
1681
 
@@ -0,0 +1,179 @@
1
+ # typed: strong
2
+
3
+ module MetronomeSDK
4
+ module Models
5
+ module V1
6
+ class ContractListSeatBalancesParams < MetronomeSDK::Internal::Type::BaseModel
7
+ extend MetronomeSDK::Internal::Type::RequestParameters::Converter
8
+ include MetronomeSDK::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ MetronomeSDK::V1::ContractListSeatBalancesParams,
14
+ MetronomeSDK::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # The contract ID to retrieve seat balances for
19
+ sig { returns(String) }
20
+ attr_accessor :contract_id
21
+
22
+ # The customer ID to retrieve seat balances for
23
+ sig { returns(String) }
24
+ attr_accessor :customer_id
25
+
26
+ # Include only commits or credits with access that cover this specific date
27
+ # (cannot be used with starting_at or ending_before).
28
+ sig { returns(T.nilable(Time)) }
29
+ attr_reader :covering_date
30
+
31
+ sig { params(covering_date: Time).void }
32
+ attr_writer :covering_date
33
+
34
+ # Page token from a previous response to retrieve the next page
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :cursor
37
+
38
+ sig { params(cursor: String).void }
39
+ attr_writer :cursor
40
+
41
+ # Include only commits or credits with access effective on or before this date
42
+ # (cannot be used with covering_date).
43
+ sig { returns(T.nilable(Time)) }
44
+ attr_reader :effective_before
45
+
46
+ sig { params(effective_before: Time).void }
47
+ attr_writer :effective_before
48
+
49
+ # Include credits and commits in the response
50
+ sig { returns(T.nilable(T::Boolean)) }
51
+ attr_reader :include_credits_and_commits
52
+
53
+ sig { params(include_credits_and_commits: T::Boolean).void }
54
+ attr_writer :include_credits_and_commits
55
+
56
+ # Include ledger entries for each commit and commit. `include_credits_and_commits`
57
+ # must be set to `true` for `include_ledgers=true` to apply.
58
+ sig { returns(T.nilable(T::Boolean)) }
59
+ attr_reader :include_ledgers
60
+
61
+ sig { params(include_ledgers: T::Boolean).void }
62
+ attr_writer :include_ledgers
63
+
64
+ # Maximum number of seats to return. Range: 1-100. Default: 25. When
65
+ # `include_credits_and_commits = true`, if the total commits/credits across all
66
+ # seats exceeds 100, a limit of 100 applies to the total credits and commits.
67
+ # Seats are included greedily to maximize the number of seats returned. Example:
68
+ # if seat 1 has 98 commits and seat 2 has 10 commits, both seats will be returned
69
+ # (total: 108 commits). Each returned seat includes all of its associated credits
70
+ # and commits.
71
+ sig { returns(T.nilable(Integer)) }
72
+ attr_reader :limit
73
+
74
+ sig { params(limit: Integer).void }
75
+ attr_writer :limit
76
+
77
+ # Optional filter to only include specific seats.
78
+ sig { returns(T.nilable(T::Array[String])) }
79
+ attr_reader :seat_ids
80
+
81
+ sig { params(seat_ids: T::Array[String]).void }
82
+ attr_writer :seat_ids
83
+
84
+ # Include only commits or credits with access effective on or after this date
85
+ # (cannot be used with covering_date).
86
+ sig { returns(T.nilable(Time)) }
87
+ attr_reader :starting_at
88
+
89
+ sig { params(starting_at: Time).void }
90
+ attr_writer :starting_at
91
+
92
+ # Optional filter to only include seats from specific subscriptions. If
93
+ # subscriptions ids are not mapped to SEAT_BASED subscriptions, error will be
94
+ # returned.
95
+ sig { returns(T.nilable(T::Array[String])) }
96
+ attr_reader :subscription_ids
97
+
98
+ sig { params(subscription_ids: T::Array[String]).void }
99
+ attr_writer :subscription_ids
100
+
101
+ sig do
102
+ params(
103
+ contract_id: String,
104
+ customer_id: String,
105
+ covering_date: Time,
106
+ cursor: String,
107
+ effective_before: Time,
108
+ include_credits_and_commits: T::Boolean,
109
+ include_ledgers: T::Boolean,
110
+ limit: Integer,
111
+ seat_ids: T::Array[String],
112
+ starting_at: Time,
113
+ subscription_ids: T::Array[String],
114
+ request_options: MetronomeSDK::RequestOptions::OrHash
115
+ ).returns(T.attached_class)
116
+ end
117
+ def self.new(
118
+ # The contract ID to retrieve seat balances for
119
+ contract_id:,
120
+ # The customer ID to retrieve seat balances for
121
+ customer_id:,
122
+ # Include only commits or credits with access that cover this specific date
123
+ # (cannot be used with starting_at or ending_before).
124
+ covering_date: nil,
125
+ # Page token from a previous response to retrieve the next page
126
+ cursor: nil,
127
+ # Include only commits or credits with access effective on or before this date
128
+ # (cannot be used with covering_date).
129
+ effective_before: nil,
130
+ # Include credits and commits in the response
131
+ include_credits_and_commits: nil,
132
+ # Include ledger entries for each commit and commit. `include_credits_and_commits`
133
+ # must be set to `true` for `include_ledgers=true` to apply.
134
+ include_ledgers: nil,
135
+ # Maximum number of seats to return. Range: 1-100. Default: 25. When
136
+ # `include_credits_and_commits = true`, if the total commits/credits across all
137
+ # seats exceeds 100, a limit of 100 applies to the total credits and commits.
138
+ # Seats are included greedily to maximize the number of seats returned. Example:
139
+ # if seat 1 has 98 commits and seat 2 has 10 commits, both seats will be returned
140
+ # (total: 108 commits). Each returned seat includes all of its associated credits
141
+ # and commits.
142
+ limit: nil,
143
+ # Optional filter to only include specific seats.
144
+ seat_ids: nil,
145
+ # Include only commits or credits with access effective on or after this date
146
+ # (cannot be used with covering_date).
147
+ starting_at: nil,
148
+ # Optional filter to only include seats from specific subscriptions. If
149
+ # subscriptions ids are not mapped to SEAT_BASED subscriptions, error will be
150
+ # returned.
151
+ subscription_ids: nil,
152
+ request_options: {}
153
+ )
154
+ end
155
+
156
+ sig do
157
+ override.returns(
158
+ {
159
+ contract_id: String,
160
+ customer_id: String,
161
+ covering_date: Time,
162
+ cursor: String,
163
+ effective_before: Time,
164
+ include_credits_and_commits: T::Boolean,
165
+ include_ledgers: T::Boolean,
166
+ limit: Integer,
167
+ seat_ids: T::Array[String],
168
+ starting_at: Time,
169
+ subscription_ids: T::Array[String],
170
+ request_options: MetronomeSDK::RequestOptions
171
+ }
172
+ )
173
+ end
174
+ def to_hash
175
+ end
176
+ end
177
+ end
178
+ end
179
+ end