stigg 0.1.0.pre.beta.2 → 0.1.0.pre.beta.4

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/stigg/internal/transport/base_client.rb +2 -0
  5. data/lib/stigg/models/v1/credit_get_auto_recharge_params.rb +32 -0
  6. data/lib/stigg/models/v1/credit_get_auto_recharge_response.rb +145 -0
  7. data/lib/stigg/models/v1/credits/{custom_currency.rb → custom_currency_response.rb} +9 -9
  8. data/lib/stigg/models/v1/subscription_import_params.rb +2 -2
  9. data/lib/stigg/models/v1/subscription_preview_params.rb +6 -6
  10. data/lib/stigg/models/v1/subscription_provision_params.rb +4 -4
  11. data/lib/stigg/resources/v1/credits/custom_currencies.rb +8 -8
  12. data/lib/stigg/resources/v1/credits.rb +25 -3
  13. data/lib/stigg/resources/v1/subscriptions.rb +2 -2
  14. data/lib/stigg/version.rb +1 -1
  15. data/lib/stigg.rb +3 -4
  16. data/rbi/stigg/models/v1/credit_get_auto_recharge_params.rbi +56 -0
  17. data/rbi/stigg/models/v1/credit_get_auto_recharge_response.rbi +246 -0
  18. data/rbi/stigg/models/v1/credits/{custom_currency.rbi → custom_currency_response.rbi} +20 -12
  19. data/rbi/stigg/models/v1/subscription_import_params.rbi +2 -2
  20. data/rbi/stigg/models/v1/subscription_preview_params.rbi +6 -6
  21. data/rbi/stigg/models/v1/subscription_provision_params.rbi +4 -4
  22. data/rbi/stigg/resources/v1/credits/custom_currencies.rbi +4 -4
  23. data/rbi/stigg/resources/v1/credits.rbi +17 -2
  24. data/rbi/stigg/resources/v1/subscriptions.rbi +2 -2
  25. data/sig/stigg/models/v1/credit_get_auto_recharge_params.rbs +30 -0
  26. data/sig/stigg/models/v1/credit_get_auto_recharge_response.rbs +109 -0
  27. data/sig/stigg/models/v1/credits/{custom_currency.rbs → custom_currency_response.rbs} +12 -10
  28. data/sig/stigg/resources/v1/credits/custom_currencies.rbs +4 -4
  29. data/sig/stigg/resources/v1/credits.rbs +5 -1
  30. metadata +11 -14
  31. data/lib/stigg/models/v1/credits/auto_recharge_get_auto_recharge_params.rb +0 -34
  32. data/lib/stigg/models/v1/credits/auto_recharge_get_auto_recharge_response.rb +0 -147
  33. data/lib/stigg/resources/v1/credits/auto_recharge.rb +0 -44
  34. data/rbi/stigg/models/v1/credits/auto_recharge_get_auto_recharge_params.rbi +0 -58
  35. data/rbi/stigg/models/v1/credits/auto_recharge_get_auto_recharge_response.rbi +0 -257
  36. data/rbi/stigg/resources/v1/credits/auto_recharge.rbi +0 -36
  37. data/sig/stigg/models/v1/credits/auto_recharge_get_auto_recharge_params.rbs +0 -32
  38. data/sig/stigg/models/v1/credits/auto_recharge_get_auto_recharge_response.rbs +0 -113
  39. data/sig/stigg/resources/v1/credits/auto_recharge.rbs +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f109db145e987e2dc684f7073b27fcf0ce28bb1a7ba6f5f39335ad9fe6d2c856
4
- data.tar.gz: cdc9fd0dfa42be023387a44a4109f04ff3c776d0d4c12ceaca2893be9636a5ba
3
+ metadata.gz: 249c958d5421d800576ceee5879df6926ab2326f8710331b9d8a4b5596444a3e
4
+ data.tar.gz: 577134966cf75587de409e62f3668c2b231aa8a9f0c856fe662092f00d8a01bc
5
5
  SHA512:
6
- metadata.gz: 750b15519abb891d606b37d98efe08a0d776311794fc4576466e52ac29f2eccc66634bd460ece86fbad9d3601b3e2b8c1f0aa2745612a1095fa09e3625f95d4c
7
- data.tar.gz: 35673538aca99642bda1c7e0b01c75eac3fae3adcb1b9329e34efd19bb7b6584eceb8463739e62563b694b97465938428e6a6be31081b932a36f9d5b133ccf4c
6
+ metadata.gz: 3a73442035e11452368dc6b1120e8c8579adec9ab1c1ff21cefb6cfe54d333e7115550f848e7db01fb0e90ce5dac0ec2417767b8bbd67a0568e68497b99bbe71
7
+ data.tar.gz: c828c1daaecf5f769ca17c99cef44652f6ab1fe67f033c740f5eca867340278714d927b321041412082520039aa1abf8690ff52c71fb4cb4e309e6fc47f15593
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.4 (2026-05-14)
4
+
5
+ Full Changelog: [v0.1.0-beta.3...v0.1.0-beta.4](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.3...v0.1.0-beta.4)
6
+
7
+ ### Features
8
+
9
+ * **api:** fix credits resource ([2afca34](https://github.com/stiggio/stigg-ruby/commit/2afca34e49428caf0a750174cbf09a868c183faa))
10
+
11
+ ## 0.1.0-beta.3 (2026-05-14)
12
+
13
+ Full Changelog: [v0.1.0-beta.2...v0.1.0-beta.3](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.2...v0.1.0-beta.3)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **client:** elide content type header on requests without body ([7cf5869](https://github.com/stiggio/stigg-ruby/commit/7cf58699e5967da519c0756dc677ce68b53e964b))
18
+
19
+
20
+ ### Chores
21
+
22
+ * **internal:** regenerate SDK with no functional changes ([251a55c](https://github.com/stiggio/stigg-ruby/commit/251a55c685da67aa5332afa5784cc55d35b6c326))
23
+
3
24
  ## 0.1.0-beta.2 (2026-05-12)
4
25
 
5
26
  Full Changelog: [v0.1.0-beta.1...v0.1.0-beta.2](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.1...v0.1.0-beta.2)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "stigg", "~> 0.1.0.pre.beta.2"
27
+ gem "stigg", "~> 0.1.0.pre.beta.4"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -306,6 +306,8 @@ module Stigg
306
306
  Stigg::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
+ headers.delete("content-type") if body.nil?
310
+
309
311
  url = Stigg::Internal::Util.join_parsed_uri(@base_url_components, {**req, path: path, query: query})
310
312
  headers, encoded = Stigg::Internal::Util.encode_content(headers, body)
311
313
  {
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ # @see Stigg::Resources::V1::Credits#get_auto_recharge
7
+ class CreditGetAutoRechargeParams < Stigg::Internal::Type::BaseModel
8
+ extend Stigg::Internal::Type::RequestParameters::Converter
9
+ include Stigg::Internal::Type::RequestParameters
10
+
11
+ # @!attribute currency_id
12
+ # Filter by currency ID (required)
13
+ #
14
+ # @return [String]
15
+ required :currency_id, String
16
+
17
+ # @!attribute customer_id
18
+ # Filter by customer ID (required)
19
+ #
20
+ # @return [String]
21
+ required :customer_id, String
22
+
23
+ # @!method initialize(currency_id:, customer_id:, request_options: {})
24
+ # @param currency_id [String] Filter by currency ID (required)
25
+ #
26
+ # @param customer_id [String] Filter by customer ID (required)
27
+ #
28
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,145 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ # @see Stigg::Resources::V1::Credits#get_auto_recharge
7
+ class CreditGetAutoRechargeResponse < Stigg::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ # Automatic recharge configuration for a customer and currency
10
+ #
11
+ # @return [Stigg::Models::V1::CreditGetAutoRechargeResponse::Data]
12
+ required :data, -> { Stigg::Models::V1::CreditGetAutoRechargeResponse::Data }
13
+
14
+ # @!method initialize(data:)
15
+ # Response object
16
+ #
17
+ # @param data [Stigg::Models::V1::CreditGetAutoRechargeResponse::Data] Automatic recharge configuration for a customer and currency
18
+
19
+ # @see Stigg::Models::V1::CreditGetAutoRechargeResponse#data
20
+ class Data < Stigg::Internal::Type::BaseModel
21
+ # @!attribute id
22
+ # The unique configuration ID
23
+ #
24
+ # @return [String, nil]
25
+ required :id, String, nil?: true
26
+
27
+ # @!attribute created_at
28
+ # Timestamp of when the record was created
29
+ #
30
+ # @return [Time, nil]
31
+ required :created_at, Time, api_name: :createdAt, nil?: true
32
+
33
+ # @!attribute currency_id
34
+ # The currency ID for this configuration
35
+ #
36
+ # @return [String]
37
+ required :currency_id, String, api_name: :currencyId
38
+
39
+ # @!attribute customer_id
40
+ # The customer ID this configuration belongs to
41
+ #
42
+ # @return [String]
43
+ required :customer_id, String, api_name: :customerId
44
+
45
+ # @!attribute grant_expiration_period
46
+ # Expiration period for auto-recharge grants (1_MONTH or 1_YEAR)
47
+ #
48
+ # @return [Symbol, Stigg::Models::V1::CreditGetAutoRechargeResponse::Data::GrantExpirationPeriod]
49
+ required :grant_expiration_period,
50
+ enum: -> { Stigg::Models::V1::CreditGetAutoRechargeResponse::Data::GrantExpirationPeriod },
51
+ api_name: :grantExpirationPeriod
52
+
53
+ # @!attribute is_enabled
54
+ # Whether automatic recharge is enabled
55
+ #
56
+ # @return [Boolean]
57
+ required :is_enabled, Stigg::Internal::Type::Boolean, api_name: :isEnabled
58
+
59
+ # @!attribute max_spend_limit
60
+ # Maximum monthly spend limit for automatic recharges
61
+ #
62
+ # @return [Float, nil]
63
+ required :max_spend_limit, Float, api_name: :maxSpendLimit, nil?: true
64
+
65
+ # @!attribute target_balance
66
+ # The target credit balance to recharge to
67
+ #
68
+ # @return [Float]
69
+ required :target_balance, Float, api_name: :targetBalance
70
+
71
+ # @!attribute threshold_type
72
+ # The threshold type (CREDIT_AMOUNT or DOLLAR_AMOUNT)
73
+ #
74
+ # @return [Symbol, Stigg::Models::V1::CreditGetAutoRechargeResponse::Data::ThresholdType]
75
+ required :threshold_type,
76
+ enum: -> { Stigg::Models::V1::CreditGetAutoRechargeResponse::Data::ThresholdType },
77
+ api_name: :thresholdType
78
+
79
+ # @!attribute threshold_value
80
+ # The threshold value that triggers a recharge
81
+ #
82
+ # @return [Float]
83
+ required :threshold_value, Float, api_name: :thresholdValue
84
+
85
+ # @!attribute updated_at
86
+ # Timestamp of when the record was last updated
87
+ #
88
+ # @return [Time, nil]
89
+ required :updated_at, Time, api_name: :updatedAt, nil?: true
90
+
91
+ # @!method initialize(id:, created_at:, currency_id:, customer_id:, grant_expiration_period:, is_enabled:, max_spend_limit:, target_balance:, threshold_type:, threshold_value:, updated_at:)
92
+ # Automatic recharge configuration for a customer and currency
93
+ #
94
+ # @param id [String, nil] The unique configuration ID
95
+ #
96
+ # @param created_at [Time, nil] Timestamp of when the record was created
97
+ #
98
+ # @param currency_id [String] The currency ID for this configuration
99
+ #
100
+ # @param customer_id [String] The customer ID this configuration belongs to
101
+ #
102
+ # @param grant_expiration_period [Symbol, Stigg::Models::V1::CreditGetAutoRechargeResponse::Data::GrantExpirationPeriod] Expiration period for auto-recharge grants (1_MONTH or 1_YEAR)
103
+ #
104
+ # @param is_enabled [Boolean] Whether automatic recharge is enabled
105
+ #
106
+ # @param max_spend_limit [Float, nil] Maximum monthly spend limit for automatic recharges
107
+ #
108
+ # @param target_balance [Float] The target credit balance to recharge to
109
+ #
110
+ # @param threshold_type [Symbol, Stigg::Models::V1::CreditGetAutoRechargeResponse::Data::ThresholdType] The threshold type (CREDIT_AMOUNT or DOLLAR_AMOUNT)
111
+ #
112
+ # @param threshold_value [Float] The threshold value that triggers a recharge
113
+ #
114
+ # @param updated_at [Time, nil] Timestamp of when the record was last updated
115
+
116
+ # Expiration period for auto-recharge grants (1_MONTH or 1_YEAR)
117
+ #
118
+ # @see Stigg::Models::V1::CreditGetAutoRechargeResponse::Data#grant_expiration_period
119
+ module GrantExpirationPeriod
120
+ extend Stigg::Internal::Type::Enum
121
+
122
+ GRANT_EXPIRATION_PERIOD_1_MONTH = :"1_MONTH"
123
+ GRANT_EXPIRATION_PERIOD_1_YEAR = :"1_YEAR"
124
+
125
+ # @!method self.values
126
+ # @return [Array<Symbol>]
127
+ end
128
+
129
+ # The threshold type (CREDIT_AMOUNT or DOLLAR_AMOUNT)
130
+ #
131
+ # @see Stigg::Models::V1::CreditGetAutoRechargeResponse::Data#threshold_type
132
+ module ThresholdType
133
+ extend Stigg::Internal::Type::Enum
134
+
135
+ CREDIT_AMOUNT = :CREDIT_AMOUNT
136
+ DOLLAR_AMOUNT = :DOLLAR_AMOUNT
137
+
138
+ # @!method self.values
139
+ # @return [Array<Symbol>]
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
145
+ end
@@ -5,19 +5,19 @@ module Stigg
5
5
  module V1
6
6
  module Credits
7
7
  # @see Stigg::Resources::V1::Credits::CustomCurrencies#create
8
- class CustomCurrency < Stigg::Internal::Type::BaseModel
8
+ class CustomCurrencyResponse < Stigg::Internal::Type::BaseModel
9
9
  # @!attribute data
10
10
  # A custom currency used to denominate credit-based entitlements and pricing
11
11
  #
12
- # @return [Stigg::Models::V1::Credits::CustomCurrency::Data]
13
- required :data, -> { Stigg::V1::Credits::CustomCurrency::Data }
12
+ # @return [Stigg::Models::V1::Credits::CustomCurrencyResponse::Data]
13
+ required :data, -> { Stigg::V1::Credits::CustomCurrencyResponse::Data }
14
14
 
15
15
  # @!method initialize(data:)
16
16
  # Response object
17
17
  #
18
- # @param data [Stigg::Models::V1::Credits::CustomCurrency::Data] A custom currency used to denominate credit-based entitlements and pricing
18
+ # @param data [Stigg::Models::V1::Credits::CustomCurrencyResponse::Data] A custom currency used to denominate credit-based entitlements and pricing
19
19
 
20
- # @see Stigg::Models::V1::Credits::CustomCurrency#data
20
+ # @see Stigg::Models::V1::Credits::CustomCurrencyResponse#data
21
21
  class Data < Stigg::Internal::Type::BaseModel
22
22
  # @!attribute id
23
23
  # The unique identifier for the custom currency
@@ -64,8 +64,8 @@ module Stigg
64
64
  # @!attribute units
65
65
  # Singular and plural unit labels for a custom currency
66
66
  #
67
- # @return [Stigg::Models::V1::Credits::CustomCurrency::Data::Units, nil]
68
- required :units, -> { Stigg::V1::Credits::CustomCurrency::Data::Units }, nil?: true
67
+ # @return [Stigg::Models::V1::Credits::CustomCurrencyResponse::Data::Units, nil]
68
+ required :units, -> { Stigg::V1::Credits::CustomCurrencyResponse::Data::Units }, nil?: true
69
69
 
70
70
  # @!attribute updated_at
71
71
  # Timestamp of when the record was last updated
@@ -90,11 +90,11 @@ module Stigg
90
90
  #
91
91
  # @param symbol [String, nil] The symbol used to represent the custom currency
92
92
  #
93
- # @param units [Stigg::Models::V1::Credits::CustomCurrency::Data::Units, nil] Singular and plural unit labels for a custom currency
93
+ # @param units [Stigg::Models::V1::Credits::CustomCurrencyResponse::Data::Units, nil] Singular and plural unit labels for a custom currency
94
94
  #
95
95
  # @param updated_at [Time] Timestamp of when the record was last updated
96
96
 
97
- # @see Stigg::Models::V1::Credits::CustomCurrency::Data#units
97
+ # @see Stigg::Models::V1::Credits::CustomCurrencyResponse::Data#units
98
98
  class Units < Stigg::Internal::Type::BaseModel
99
99
  # @!attribute plural
100
100
  # Plural form of the unit label
@@ -162,7 +162,7 @@ module Stigg
162
162
  required :id, String
163
163
 
164
164
  # @!attribute quantity
165
- # Charge quantity
165
+ # Charge quantity. Minimum is 0 (zero is allowed).
166
166
  #
167
167
  # @return [Float]
168
168
  required :quantity, Float
@@ -178,7 +178,7 @@ module Stigg
178
178
  #
179
179
  # @param id [String] Charge ID
180
180
  #
181
- # @param quantity [Float] Charge quantity
181
+ # @param quantity [Float] Charge quantity. Minimum is 0 (zero is allowed).
182
182
  #
183
183
  # @param type [Symbol, Stigg::Models::V1::SubscriptionImportParams::Subscription::Charge::Type] Charge type
184
184
 
@@ -113,7 +113,7 @@ module Stigg
113
113
  api_name: :trialOverrideConfiguration
114
114
 
115
115
  # @!attribute unit_quantity
116
- # Unit quantity for per-unit pricing
116
+ # Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).
117
117
  #
118
118
  # @return [Integer, nil]
119
119
  optional :unit_quantity, Integer, api_name: :unitQuantity
@@ -149,7 +149,7 @@ module Stigg
149
149
  #
150
150
  # @param trial_override_configuration [Stigg::Models::V1::SubscriptionPreviewParams::TrialOverrideConfiguration] Trial period override settings
151
151
  #
152
- # @param unit_quantity [Integer] Unit quantity for per-unit pricing
152
+ # @param unit_quantity [Integer] Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).
153
153
  #
154
154
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
155
155
 
@@ -439,7 +439,7 @@ module Stigg
439
439
  required :feature_id, String, api_name: :featureId
440
440
 
441
441
  # @!attribute quantity
442
- # Quantity of feature units
442
+ # Quantity of feature units. Minimum is 0 (zero is allowed).
443
443
  #
444
444
  # @return [Float]
445
445
  required :quantity, Float
@@ -449,7 +449,7 @@ module Stigg
449
449
  #
450
450
  # @param feature_id [String] Feature ID
451
451
  #
452
- # @param quantity [Float] Quantity of feature units
452
+ # @param quantity [Float] Quantity of feature units. Minimum is 0 (zero is allowed).
453
453
  end
454
454
 
455
455
  # Billing cycle anchor behavior for the subscription
@@ -661,7 +661,7 @@ module Stigg
661
661
  required :id, String
662
662
 
663
663
  # @!attribute quantity
664
- # Charge quantity
664
+ # Charge quantity. Minimum is 0 (zero is allowed).
665
665
  #
666
666
  # @return [Float]
667
667
  required :quantity, Float
@@ -677,7 +677,7 @@ module Stigg
677
677
  #
678
678
  # @param id [String] Charge ID
679
679
  #
680
- # @param quantity [Float] Charge quantity
680
+ # @param quantity [Float] Charge quantity. Minimum is 0 (zero is allowed).
681
681
  #
682
682
  # @param type [Symbol, Stigg::Models::V1::SubscriptionPreviewParams::Charge::Type] Charge type
683
683
 
@@ -177,7 +177,7 @@ module Stigg
177
177
  api_name: :trialOverrideConfiguration
178
178
 
179
179
  # @!attribute unit_quantity
180
- # Unit quantity
180
+ # Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).
181
181
  #
182
182
  # @return [Integer, nil]
183
183
  optional :unit_quantity, Integer, api_name: :unitQuantity
@@ -233,7 +233,7 @@ module Stigg
233
233
  #
234
234
  # @param trial_override_configuration [Stigg::Models::V1::SubscriptionProvisionParams::TrialOverrideConfiguration] Trial period override settings
235
235
  #
236
- # @param unit_quantity [Integer] Unit quantity
236
+ # @param unit_quantity [Integer] Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).
237
237
  #
238
238
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
239
239
 
@@ -741,7 +741,7 @@ module Stigg
741
741
  required :id, String
742
742
 
743
743
  # @!attribute quantity
744
- # Charge quantity
744
+ # Charge quantity. Minimum is 0 (zero is allowed).
745
745
  #
746
746
  # @return [Float]
747
747
  required :quantity, Float
@@ -757,7 +757,7 @@ module Stigg
757
757
  #
758
758
  # @param id [String] Charge ID
759
759
  #
760
- # @param quantity [Float] Charge quantity
760
+ # @param quantity [Float] Charge quantity. Minimum is 0 (zero is allowed).
761
761
  #
762
762
  # @param type [Symbol, Stigg::Models::V1::SubscriptionProvisionParams::Charge::Type] Charge type
763
763
 
@@ -27,7 +27,7 @@ module Stigg
27
27
  #
28
28
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
29
29
  #
30
- # @return [Stigg::Models::V1::Credits::CustomCurrency]
30
+ # @return [Stigg::Models::V1::Credits::CustomCurrencyResponse]
31
31
  #
32
32
  # @see Stigg::Models::V1::Credits::CustomCurrencyCreateParams
33
33
  def create(params)
@@ -36,7 +36,7 @@ module Stigg
36
36
  method: :post,
37
37
  path: "api/v1/credits/custom-currencies",
38
38
  body: parsed,
39
- model: Stigg::V1::Credits::CustomCurrency,
39
+ model: Stigg::V1::Credits::CustomCurrencyResponse,
40
40
  options: options
41
41
  )
42
42
  end
@@ -62,7 +62,7 @@ module Stigg
62
62
  #
63
63
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
64
64
  #
65
- # @return [Stigg::Models::V1::Credits::CustomCurrency]
65
+ # @return [Stigg::Models::V1::Credits::CustomCurrencyResponse]
66
66
  #
67
67
  # @see Stigg::Models::V1::Credits::CustomCurrencyUpdateParams
68
68
  def update(currency_id, params = {})
@@ -71,7 +71,7 @@ module Stigg
71
71
  method: :patch,
72
72
  path: ["api/v1/credits/custom-currencies/%1$s", currency_id],
73
73
  body: parsed,
74
- model: Stigg::V1::Credits::CustomCurrency,
74
+ model: Stigg::V1::Credits::CustomCurrencyResponse,
75
75
  options: options
76
76
  )
77
77
  end
@@ -121,14 +121,14 @@ module Stigg
121
121
  #
122
122
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
123
123
  #
124
- # @return [Stigg::Models::V1::Credits::CustomCurrency]
124
+ # @return [Stigg::Models::V1::Credits::CustomCurrencyResponse]
125
125
  #
126
126
  # @see Stigg::Models::V1::Credits::CustomCurrencyArchiveParams
127
127
  def archive(currency_id, params = {})
128
128
  @client.request(
129
129
  method: :post,
130
130
  path: ["api/v1/credits/custom-currencies/%1$s/archive", currency_id],
131
- model: Stigg::V1::Credits::CustomCurrency,
131
+ model: Stigg::V1::Credits::CustomCurrencyResponse,
132
132
  options: params[:request_options]
133
133
  )
134
134
  end
@@ -163,14 +163,14 @@ module Stigg
163
163
  #
164
164
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
165
165
  #
166
- # @return [Stigg::Models::V1::Credits::CustomCurrency]
166
+ # @return [Stigg::Models::V1::Credits::CustomCurrencyResponse]
167
167
  #
168
168
  # @see Stigg::Models::V1::Credits::CustomCurrencyUnarchiveParams
169
169
  def unarchive(currency_id, params = {})
170
170
  @client.request(
171
171
  method: :post,
172
172
  path: ["api/v1/credits/custom-currencies/%1$s/unarchive", currency_id],
173
- model: Stigg::V1::Credits::CustomCurrency,
173
+ model: Stigg::V1::Credits::CustomCurrencyResponse,
174
174
  options: params[:request_options]
175
175
  )
176
176
  end
@@ -12,8 +12,31 @@ module Stigg
12
12
  # @return [Stigg::Resources::V1::Credits::CustomCurrencies]
13
13
  attr_reader :custom_currencies
14
14
 
15
- # @return [Stigg::Resources::V1::Credits::AutoRecharge]
16
- attr_reader :auto_recharge
15
+ # Retrieves the automatic recharge configuration for a customer and currency.
16
+ # Returns default settings if no configuration exists.
17
+ #
18
+ # @overload get_auto_recharge(currency_id:, customer_id:, request_options: {})
19
+ #
20
+ # @param currency_id [String] Filter by currency ID (required)
21
+ #
22
+ # @param customer_id [String] Filter by customer ID (required)
23
+ #
24
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
25
+ #
26
+ # @return [Stigg::Models::V1::CreditGetAutoRechargeResponse]
27
+ #
28
+ # @see Stigg::Models::V1::CreditGetAutoRechargeParams
29
+ def get_auto_recharge(params)
30
+ parsed, options = Stigg::V1::CreditGetAutoRechargeParams.dump_request(params)
31
+ query = Stigg::Internal::Util.encode_query_params(parsed)
32
+ @client.request(
33
+ method: :get,
34
+ path: "api/v1/credits/auto-recharge",
35
+ query: query.transform_keys(currency_id: "currencyId", customer_id: "customerId"),
36
+ model: Stigg::Models::V1::CreditGetAutoRechargeResponse,
37
+ options: options
38
+ )
39
+ end
17
40
 
18
41
  # Some parameter documentations has been truncated, see
19
42
  # {Stigg::Models::V1::CreditGetUsageParams} for more details.
@@ -104,7 +127,6 @@ module Stigg
104
127
  @client = client
105
128
  @grants = Stigg::Resources::V1::Credits::Grants.new(client: client)
106
129
  @custom_currencies = Stigg::Resources::V1::Credits::CustomCurrencies.new(client: client)
107
- @auto_recharge = Stigg::Resources::V1::Credits::AutoRecharge.new(client: client)
108
130
  end
109
131
  end
110
132
  end
@@ -284,7 +284,7 @@ module Stigg
284
284
  #
285
285
  # @param trial_override_configuration [Stigg::Models::V1::SubscriptionPreviewParams::TrialOverrideConfiguration] Trial period override settings
286
286
  #
287
- # @param unit_quantity [Integer] Unit quantity for per-unit pricing
287
+ # @param unit_quantity [Integer] Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).
288
288
  #
289
289
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
290
290
  #
@@ -357,7 +357,7 @@ module Stigg
357
357
  #
358
358
  # @param trial_override_configuration [Stigg::Models::V1::SubscriptionProvisionParams::TrialOverrideConfiguration] Trial period override settings
359
359
  #
360
- # @param unit_quantity [Integer] Unit quantity
360
+ # @param unit_quantity [Integer] Unit quantity for per-unit pricing. Minimum is 0 (zero is allowed).
361
361
  #
362
362
  # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
363
363
  #
data/lib/stigg/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stigg
4
- VERSION = "0.1.0.pre.beta.2"
4
+ VERSION = "0.1.0.pre.beta.4"
5
5
  end
data/lib/stigg.rb CHANGED
@@ -79,20 +79,20 @@ require_relative "stigg/models/v1/coupon_list_params"
79
79
  require_relative "stigg/models/v1/coupon_list_response"
80
80
  require_relative "stigg/models/v1/coupon_retrieve_params"
81
81
  require_relative "stigg/models/v1/coupon_update_coupon_params"
82
+ require_relative "stigg/models/v1/credit_get_auto_recharge_params"
83
+ require_relative "stigg/models/v1/credit_get_auto_recharge_response"
82
84
  require_relative "stigg/models/v1/credit_get_usage_params"
83
85
  require_relative "stigg/models/v1/credit_get_usage_response"
84
86
  require_relative "stigg/models/v1/credit_list_ledger_params"
85
87
  require_relative "stigg/models/v1/credit_list_ledger_response"
86
- require_relative "stigg/models/v1/credits/auto_recharge_get_auto_recharge_params"
87
- require_relative "stigg/models/v1/credits/auto_recharge_get_auto_recharge_response"
88
88
  require_relative "stigg/models/v1/credits/credit_grant_response"
89
- require_relative "stigg/models/v1/credits/custom_currency"
90
89
  require_relative "stigg/models/v1/credits/custom_currency_archive_params"
91
90
  require_relative "stigg/models/v1/credits/custom_currency_create_params"
92
91
  require_relative "stigg/models/v1/credits/custom_currency_list_associated_entities_params"
93
92
  require_relative "stigg/models/v1/credits/custom_currency_list_associated_entities_response"
94
93
  require_relative "stigg/models/v1/credits/custom_currency_list_params"
95
94
  require_relative "stigg/models/v1/credits/custom_currency_list_response"
95
+ require_relative "stigg/models/v1/credits/custom_currency_response"
96
96
  require_relative "stigg/models/v1/credits/custom_currency_unarchive_params"
97
97
  require_relative "stigg/models/v1/credits/custom_currency_update_params"
98
98
  require_relative "stigg/models/v1/credits/grant_create_params"
@@ -201,7 +201,6 @@ require_relative "stigg/resources/v1/addons"
201
201
  require_relative "stigg/resources/v1/addons/entitlements"
202
202
  require_relative "stigg/resources/v1/coupons"
203
203
  require_relative "stigg/resources/v1/credits"
204
- require_relative "stigg/resources/v1/credits/auto_recharge"
205
204
  require_relative "stigg/resources/v1/credits/custom_currencies"
206
205
  require_relative "stigg/resources/v1/credits/grants"
207
206
  require_relative "stigg/resources/v1/customers"
@@ -0,0 +1,56 @@
1
+ # typed: strong
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ class CreditGetAutoRechargeParams < Stigg::Internal::Type::BaseModel
7
+ extend Stigg::Internal::Type::RequestParameters::Converter
8
+ include Stigg::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Stigg::V1::CreditGetAutoRechargeParams,
14
+ Stigg::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # Filter by currency ID (required)
19
+ sig { returns(String) }
20
+ attr_accessor :currency_id
21
+
22
+ # Filter by customer ID (required)
23
+ sig { returns(String) }
24
+ attr_accessor :customer_id
25
+
26
+ sig do
27
+ params(
28
+ currency_id: String,
29
+ customer_id: String,
30
+ request_options: Stigg::RequestOptions::OrHash
31
+ ).returns(T.attached_class)
32
+ end
33
+ def self.new(
34
+ # Filter by currency ID (required)
35
+ currency_id:,
36
+ # Filter by customer ID (required)
37
+ customer_id:,
38
+ request_options: {}
39
+ )
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ {
45
+ currency_id: String,
46
+ customer_id: String,
47
+ request_options: Stigg::RequestOptions
48
+ }
49
+ )
50
+ end
51
+ def to_hash
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end