stigg 0.1.0.pre.alpha.1 → 0.1.0.pre.alpha.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +29 -1
- data/lib/stigg/internal/my_cursor_id_page.rb +32 -4
- data/lib/stigg/internal/type/base_model.rb +2 -2
- data/lib/stigg/models/v1/{coupon_create_response.rb → coupon.rb} +31 -26
- data/lib/stigg/models/v1/coupon_create_params.rb +2 -0
- data/lib/stigg/models/v1/coupon_list_params.rb +14 -14
- data/lib/stigg/models/v1/coupon_list_response.rb +262 -278
- data/lib/stigg/models/v1/customer_import_params.rb +75 -0
- data/lib/stigg/models/v1/customer_import_response.rb +35 -0
- data/lib/stigg/models/v1/customer_list_params.rb +14 -14
- data/lib/stigg/models/v1/customer_list_response.rb +160 -174
- data/lib/stigg/models/v1/{customer_create_params.rb → customer_provision_params.rb} +18 -16
- data/lib/stigg/models/v1/customer_response.rb +9 -2
- data/lib/stigg/models/v1/customer_update_params.rb +2 -0
- data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +3 -1
- data/lib/stigg/models/v1/customers/{promotional_create_params.rb → promotional_entitlement_grant_params.rb} +46 -44
- data/lib/stigg/models/v1/customers/{promotional_create_response.rb → promotional_entitlement_grant_response.rb} +105 -32
- data/lib/stigg/models/v1/customers/{promotional_revoke_params.rb → promotional_entitlement_revoke_params.rb} +2 -2
- data/lib/stigg/models/v1/customers/{promotional_revoke_response.rb → promotional_entitlement_revoke_response.rb} +107 -33
- data/lib/stigg/models/v1/event_report_params.rb +91 -0
- data/lib/stigg/models/v1/event_report_response.rb +25 -0
- data/lib/stigg/models/v1/{subscription_retrieve_response.rb → subscription.rb} +67 -26
- data/lib/stigg/models/v1/subscription_cancel_params.rb +75 -0
- data/lib/stigg/models/v1/subscription_delegate_params.rb +7 -2
- data/lib/stigg/models/v1/subscription_import_params.rb +92 -0
- data/lib/stigg/models/v1/subscription_import_response.rb +32 -0
- data/lib/stigg/models/v1/subscription_list_params.rb +20 -24
- data/lib/stigg/models/v1/subscription_list_response.rb +255 -236
- data/lib/stigg/models/v1/subscription_migrate_params.rb +3 -3
- data/lib/stigg/models/v1/subscription_preview_params.rb +139 -46
- data/lib/stigg/models/v1/subscription_preview_response.rb +164 -49
- data/lib/stigg/models/v1/subscription_provision_params.rb +1693 -0
- data/lib/stigg/models/v1/subscription_provision_response.rb +1038 -0
- data/lib/stigg/models/v1/subscription_transfer_params.rb +2 -6
- data/lib/stigg/models/v1/subscription_update_params.rb +1114 -0
- data/lib/stigg/models/v1/subscriptions/{future_update_cancel_pending_payment_response.rb → cancel_subscription.rb} +9 -5
- data/lib/stigg/models/v1/usage_history_params.rb +54 -0
- data/lib/stigg/models/v1/usage_history_response.rb +155 -0
- data/lib/stigg/models/v1/usage_report_params.rb +114 -0
- data/lib/stigg/models/v1/usage_report_response.rb +120 -0
- data/lib/stigg/models.rb +0 -4
- data/lib/stigg/resources/v1/coupons.rb +16 -14
- data/lib/stigg/resources/v1/customers/payment_method.rb +6 -5
- data/lib/stigg/resources/v1/customers/{promotional.rb → promotional_entitlements.rb} +17 -17
- data/lib/stigg/resources/v1/customers.rb +78 -56
- data/lib/stigg/resources/v1/events.rb +38 -0
- data/lib/stigg/resources/v1/subscriptions/future_update.rb +10 -8
- data/lib/stigg/resources/v1/subscriptions.rb +206 -79
- data/lib/stigg/resources/v1/usage.rb +79 -0
- data/lib/stigg/resources/v1.rb +6 -42
- data/lib/stigg/version.rb +1 -1
- data/lib/stigg.rb +25 -23
- data/rbi/stigg/internal/my_cursor_id_page.rbi +27 -0
- data/rbi/stigg/models/v1/coupon.rbi +891 -0
- data/rbi/stigg/models/v1/coupon_create_params.rbi +1 -0
- data/rbi/stigg/models/v1/coupon_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/coupon_list_response.rbi +812 -869
- data/rbi/stigg/models/v1/customer_import_params.rbi +130 -0
- data/rbi/stigg/models/v1/customer_import_response.rbi +76 -0
- data/rbi/stigg/models/v1/customer_list_params.rbi +21 -21
- data/rbi/stigg/models/v1/customer_list_response.rbi +307 -347
- data/rbi/stigg/models/v1/{customer_create_params.rbi → customer_provision_params.rbi} +36 -35
- data/rbi/stigg/models/v1/customer_response.rbi +8 -1
- data/rbi/stigg/models/v1/customer_update_params.rbi +1 -0
- data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +3 -0
- data/rbi/stigg/models/v1/customers/{promotional_create_params.rbi → promotional_entitlement_grant_params.rbi} +78 -77
- data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_response.rbi +690 -0
- data/rbi/stigg/models/v1/customers/{promotional_revoke_params.rbi → promotional_entitlement_revoke_params.rbi} +2 -2
- data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbi +696 -0
- data/rbi/stigg/models/v1/event_report_params.rbi +168 -0
- data/rbi/stigg/models/v1/event_report_response.rbi +35 -0
- data/rbi/stigg/models/v1/{subscription_migrate_response.rbi → subscription.rbi} +130 -98
- data/rbi/stigg/models/v1/subscription_cancel_params.rbi +182 -0
- data/rbi/stigg/models/v1/subscription_delegate_params.rbi +6 -2
- data/rbi/stigg/models/v1/subscription_import_params.rbi +148 -0
- data/rbi/stigg/models/v1/subscription_import_response.rbi +69 -0
- data/rbi/stigg/models/v1/subscription_list_params.rbi +26 -28
- data/rbi/stigg/models/v1/subscription_list_response.rbi +460 -435
- data/rbi/stigg/models/v1/subscription_migrate_params.rbi +3 -3
- data/rbi/stigg/models/v1/subscription_preview_params.rbi +112 -14
- data/rbi/stigg/models/v1/subscription_preview_response.rbi +139 -6
- data/rbi/stigg/models/v1/subscription_provision_params.rbi +5306 -0
- data/rbi/stigg/models/v1/subscription_provision_response.rbi +3175 -0
- data/rbi/stigg/models/v1/subscription_transfer_params.rbi +2 -4
- data/rbi/stigg/models/v1/subscription_update_params.rbi +3578 -0
- data/rbi/stigg/models/v1/subscriptions/{future_update_cancel_schedule_response.rbi → cancel_subscription.rbi} +10 -16
- data/rbi/stigg/models/v1/usage_history_params.rbi +79 -0
- data/rbi/stigg/models/v1/usage_history_response.rbi +347 -0
- data/rbi/stigg/models/v1/usage_report_params.rbi +227 -0
- data/rbi/stigg/models/v1/usage_report_response.rbi +162 -0
- data/rbi/stigg/models.rbi +0 -4
- data/rbi/stigg/resources/v1/coupons.rbi +22 -14
- data/rbi/stigg/resources/v1/customers/payment_method.rbi +9 -3
- data/rbi/stigg/resources/v1/customers/{promotional.rbi → promotional_entitlements.rbi} +13 -9
- data/rbi/stigg/resources/v1/customers.rbi +84 -53
- data/rbi/stigg/resources/v1/events.rbi +28 -0
- data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +14 -10
- data/rbi/stigg/resources/v1/subscriptions.rbi +242 -58
- data/rbi/stigg/resources/v1/usage.rbi +57 -0
- data/rbi/stigg/resources/v1.rbi +4 -26
- data/sig/stigg/internal/my_cursor_id_page.rbs +17 -0
- data/sig/stigg/models/v1/{coupon_create_response.rbs → coupon.rbs} +29 -32
- data/sig/stigg/models/v1/coupon_list_params.rbs +11 -11
- data/sig/stigg/models/v1/coupon_list_response.rbs +331 -351
- data/sig/stigg/models/v1/customer_import_params.rbs +74 -0
- data/sig/stigg/models/v1/customer_import_response.rbs +30 -0
- data/sig/stigg/models/v1/customer_list_params.rbs +11 -11
- data/sig/stigg/models/v1/customer_list_response.rbs +133 -153
- data/sig/stigg/models/v1/{customer_create_params.rbs → customer_provision_params.rbs} +22 -22
- data/sig/stigg/models/v1/customers/{promotional_create_params.rbs → promotional_entitlement_grant_params.rbs} +43 -43
- data/sig/stigg/models/v1/customers/promotional_entitlement_grant_response.rbs +281 -0
- data/sig/stigg/models/v1/customers/{promotional_revoke_params.rbs → promotional_entitlement_revoke_params.rbs} +2 -2
- data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbs +281 -0
- data/sig/stigg/models/v1/event_report_params.rbs +82 -0
- data/sig/stigg/models/v1/event_report_response.rbs +15 -0
- data/sig/stigg/models/v1/{subscription_retrieve_response.rbs → subscription.rbs} +61 -35
- data/sig/stigg/models/v1/subscription_cancel_params.rbs +79 -0
- data/sig/stigg/models/v1/subscription_import_params.rbs +84 -0
- data/sig/stigg/models/v1/subscription_import_response.rbs +30 -0
- data/sig/stigg/models/v1/subscription_list_params.rbs +14 -14
- data/sig/stigg/models/v1/subscription_list_response.rbs +196 -189
- data/sig/stigg/models/v1/subscription_preview_params.rbs +2 -6
- data/sig/stigg/models/v1/subscription_provision_params.rbs +2223 -0
- data/sig/stigg/models/v1/subscription_provision_response.rbs +1305 -0
- data/sig/stigg/models/v1/subscription_update_params.rbs +1544 -0
- data/sig/stigg/models/v1/subscriptions/cancel_subscription.rbs +34 -0
- data/sig/stigg/models/v1/usage_history_params.rbs +52 -0
- data/sig/stigg/models/v1/usage_history_response.rbs +129 -0
- data/sig/stigg/models/v1/usage_report_params.rbs +102 -0
- data/sig/stigg/models/v1/usage_report_response.rbs +87 -0
- data/sig/stigg/models.rbs +0 -4
- data/sig/stigg/resources/v1/coupons.rbs +5 -5
- data/sig/stigg/resources/v1/customers/{promotional.rbs → promotional_entitlements.rbs} +5 -5
- data/sig/stigg/resources/v1/customers.rbs +20 -17
- data/sig/stigg/resources/v1/events.rbs +14 -0
- data/sig/stigg/resources/v1/subscriptions/future_update.rbs +2 -2
- data/sig/stigg/resources/v1/subscriptions.rbs +68 -20
- data/sig/stigg/resources/v1/usage.rbs +24 -0
- data/sig/stigg/resources/v1.rbs +2 -8
- metadata +77 -71
- data/lib/stigg/models/v1/coupon_retrieve_response.rb +0 -317
- data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +0 -56
- data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +0 -145
- data/lib/stigg/models/v1/subscription_create_params.rb +0 -214
- data/lib/stigg/models/v1/subscription_create_response.rb +0 -338
- data/lib/stigg/models/v1/subscription_delegate_response.rb +0 -274
- data/lib/stigg/models/v1/subscription_migrate_response.rb +0 -274
- data/lib/stigg/models/v1/subscription_transfer_response.rb +0 -274
- data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +0 -32
- data/lib/stigg/models/v1_create_event_params.rb +0 -87
- data/lib/stigg/models/v1_create_event_response.rb +0 -16
- data/lib/stigg/models/v1_create_usage_params.rb +0 -96
- data/lib/stigg/models/v1_create_usage_response.rb +0 -112
- data/lib/stigg/resources/v1/customers/usage.rb +0 -59
- data/rbi/stigg/models/v1/coupon_create_response.rbi +0 -986
- data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +0 -986
- data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +0 -495
- data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +0 -497
- data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +0 -84
- data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +0 -353
- data/rbi/stigg/models/v1/subscription_create_params.rbi +0 -394
- data/rbi/stigg/models/v1/subscription_create_response.rbi +0 -668
- data/rbi/stigg/models/v1/subscription_delegate_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscription_transfer_response.rbi +0 -535
- data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +0 -79
- data/rbi/stigg/models/v1_create_event_params.rbi +0 -160
- data/rbi/stigg/models/v1_create_event_response.rbi +0 -23
- data/rbi/stigg/models/v1_create_usage_params.rbi +0 -177
- data/rbi/stigg/models/v1_create_usage_response.rbi +0 -150
- data/rbi/stigg/resources/v1/customers/usage.rbi +0 -45
- data/sig/stigg/models/v1/coupon_retrieve_response.rbs +0 -394
- data/sig/stigg/models/v1/customers/promotional_create_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +0 -209
- data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +0 -54
- data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +0 -134
- data/sig/stigg/models/v1/subscription_create_params.rbs +0 -199
- data/sig/stigg/models/v1/subscription_create_response.rbs +0 -283
- data/sig/stigg/models/v1/subscription_delegate_response.rbs +0 -224
- data/sig/stigg/models/v1/subscription_migrate_response.rbs +0 -224
- data/sig/stigg/models/v1/subscription_transfer_response.rbs +0 -224
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +0 -34
- data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +0 -34
- data/sig/stigg/models/v1_create_event_params.rbs +0 -80
- data/sig/stigg/models/v1_create_event_response.rbs +0 -13
- data/sig/stigg/models/v1_create_usage_params.rbs +0 -90
- data/sig/stigg/models/v1_create_usage_response.rbs +0 -85
- data/sig/stigg/resources/v1/customers/usage.rbs +0 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8e60f4fdad10d2d4b37e4f5d646accf564f8b280a86e1c9ba46b488138b1f43
|
|
4
|
+
data.tar.gz: eb0423ccd6a83e037421ab3e2d78187e6aff8024175a974af11d06d7f9f8a587
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2a1589cf8dc649e0d0cbadd3d2b3d4722b062d9da08c4b435052c2e457fcbfbaeb92b0a9ae110a02a2692fdfae37fc2ca80ba2b9e6d80cadedd19a487d66d10
|
|
7
|
+
data.tar.gz: 6abfbdeca00d4e2a8269c0afd32ef00ddc785d710e38ff7d49787539dceee459e9ac0c094d06c0df6cbace4b59e8725f420c6c9ee43ce24683fb9e845ba18ff4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.3 (2026-01-29)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update stainless config ([9d48da5](https://github.com/stiggio/stigg-ruby/commit/9d48da56de7780968ac51cdf3f80073bd8f3e7da))
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.2 (2026-01-28)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([5401740](https://github.com/stiggio/stigg-ruby/commit/5401740b164e4f2e4dfec6b1551d4c6bba400eda))
|
|
18
|
+
* **api:** api update ([af0dbbf](https://github.com/stiggio/stigg-ruby/commit/af0dbbfbe7cabffe473c52077d91594b7c4ec181))
|
|
19
|
+
* **api:** api update ([985e956](https://github.com/stiggio/stigg-ruby/commit/985e9563afe956a76da955a97571a93ba293b097))
|
|
20
|
+
* **api:** api update ([fa4a31b](https://github.com/stiggio/stigg-ruby/commit/fa4a31b7afa59ab427d38557fab38d93ad72ca28))
|
|
21
|
+
* **api:** api update ([59c9248](https://github.com/stiggio/stigg-ruby/commit/59c92487bd880f091b5c4411c2c8c15491bc7ec2))
|
|
22
|
+
* **api:** comment out promotional endpoints ([3c40e53](https://github.com/stiggio/stigg-ruby/commit/3c40e538184cca72a2048129672b65eb787f466c))
|
|
23
|
+
* **api:** improved cursor pagination ([b5650f4](https://github.com/stiggio/stigg-ruby/commit/b5650f4dcd6d97b8539ea76426aece84f8741496))
|
|
24
|
+
|
|
3
25
|
## 0.1.0-alpha.1 (2026-01-26)
|
|
4
26
|
|
|
5
27
|
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/stiggio/stigg-ruby/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "stigg", "~> 0.1.0.pre.alpha.
|
|
18
|
+
gem "stigg", "~> 0.1.0.pre.alpha.3"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -35,6 +35,34 @@ customer_response = stigg.v1.customers.retrieve("REPLACE_ME")
|
|
|
35
35
|
puts(customer_response.data)
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
### Pagination
|
|
39
|
+
|
|
40
|
+
List methods in the Stigg API are paginated.
|
|
41
|
+
|
|
42
|
+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
|
|
43
|
+
|
|
44
|
+
```ruby
|
|
45
|
+
page = stigg.v1.customers.list(limit: 30)
|
|
46
|
+
|
|
47
|
+
# Fetch single item from page.
|
|
48
|
+
customer = page.data[0]
|
|
49
|
+
puts(customer.id)
|
|
50
|
+
|
|
51
|
+
# Automatically fetches more pages as needed.
|
|
52
|
+
page.auto_paging_each do |customer|
|
|
53
|
+
puts(customer.id)
|
|
54
|
+
end
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Alternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
if page.next_page?
|
|
61
|
+
new_page = page.next_page
|
|
62
|
+
puts(new_page.data[0].id)
|
|
63
|
+
end
|
|
64
|
+
```
|
|
65
|
+
|
|
38
66
|
### Handling errors
|
|
39
67
|
|
|
40
68
|
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Stigg::Errors::APIError` will be thrown:
|
|
@@ -10,8 +10,8 @@ module Stigg
|
|
|
10
10
|
# end
|
|
11
11
|
#
|
|
12
12
|
# @example
|
|
13
|
-
# my_cursor_id_page.auto_paging_each do |
|
|
14
|
-
# puts(
|
|
13
|
+
# my_cursor_id_page.auto_paging_each do |customer|
|
|
14
|
+
# puts(customer)
|
|
15
15
|
# end
|
|
16
16
|
class MyCursorIDPage
|
|
17
17
|
include Stigg::Internal::Type::BasePage
|
|
@@ -19,9 +19,12 @@ module Stigg
|
|
|
19
19
|
# @return [Array<generic<Elem>>, nil]
|
|
20
20
|
attr_accessor :data
|
|
21
21
|
|
|
22
|
+
# @return [Pagination]
|
|
23
|
+
attr_accessor :pagination
|
|
24
|
+
|
|
22
25
|
# @return [Boolean]
|
|
23
26
|
def next_page?
|
|
24
|
-
!data.to_a.empty?
|
|
27
|
+
!data.to_a.empty? && (!pagination&.prev.to_s.empty? || !pagination&.next_.to_s.empty?)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @raise [Stigg::HTTP::Error]
|
|
@@ -32,7 +35,10 @@ module Stigg
|
|
|
32
35
|
raise RuntimeError.new(message)
|
|
33
36
|
end
|
|
34
37
|
|
|
35
|
-
req = Stigg::Internal::Util.deep_merge(
|
|
38
|
+
req = Stigg::Internal::Util.deep_merge(
|
|
39
|
+
@req,
|
|
40
|
+
{query: pagination&.prev.nil? ? {after: pagination&.next_} : {before: pagination&.prev}}
|
|
41
|
+
)
|
|
36
42
|
@client.request(req)
|
|
37
43
|
end
|
|
38
44
|
|
|
@@ -67,6 +73,12 @@ module Stigg
|
|
|
67
73
|
@data = data.map { Stigg::Internal::Type::Converter.coerce(@model, _1) }
|
|
68
74
|
else
|
|
69
75
|
end
|
|
76
|
+
case page_data
|
|
77
|
+
in {pagination: Hash | nil => pagination}
|
|
78
|
+
@pagination =
|
|
79
|
+
Stigg::Internal::Type::Converter.coerce(Stigg::Internal::MyCursorIDPage::Pagination, pagination)
|
|
80
|
+
else
|
|
81
|
+
end
|
|
70
82
|
end
|
|
71
83
|
|
|
72
84
|
# @api private
|
|
@@ -77,6 +89,22 @@ module Stigg
|
|
|
77
89
|
|
|
78
90
|
"#<#{self.class}[#{model}]:0x#{object_id.to_s(16)}>"
|
|
79
91
|
end
|
|
92
|
+
|
|
93
|
+
class Pagination < Stigg::Internal::Type::BaseModel
|
|
94
|
+
# @!attribute next_
|
|
95
|
+
#
|
|
96
|
+
# @return [String, nil]
|
|
97
|
+
optional :next_, String, api_name: :next
|
|
98
|
+
|
|
99
|
+
# @!attribute prev
|
|
100
|
+
#
|
|
101
|
+
# @return [String, nil]
|
|
102
|
+
optional :prev, String
|
|
103
|
+
|
|
104
|
+
# @!method initialize(next_: nil, prev: nil)
|
|
105
|
+
# @param next_ [String]
|
|
106
|
+
# @param prev [String]
|
|
107
|
+
end
|
|
80
108
|
end
|
|
81
109
|
end
|
|
82
110
|
end
|
|
@@ -438,8 +438,8 @@ module Stigg
|
|
|
438
438
|
# @return [Hash{Symbol=>Object}]
|
|
439
439
|
#
|
|
440
440
|
# @example
|
|
441
|
-
# # `
|
|
442
|
-
#
|
|
441
|
+
# # `customer_response` is a `Stigg::V1::CustomerResponse`
|
|
442
|
+
# customer_response => {
|
|
443
443
|
# data: data
|
|
444
444
|
# }
|
|
445
445
|
def deconstruct_keys(keys)
|
|
@@ -4,16 +4,19 @@ module Stigg
|
|
|
4
4
|
module Models
|
|
5
5
|
module V1
|
|
6
6
|
# @see Stigg::Resources::V1::Coupons#create
|
|
7
|
-
class
|
|
7
|
+
class Coupon < Stigg::Internal::Type::BaseModel
|
|
8
8
|
# @!attribute data
|
|
9
|
+
# Discount instrument with percentage or fixed amount
|
|
9
10
|
#
|
|
10
|
-
# @return [Stigg::Models::V1::
|
|
11
|
-
required :data, -> { Stigg::
|
|
11
|
+
# @return [Stigg::Models::V1::Coupon::Data]
|
|
12
|
+
required :data, -> { Stigg::V1::Coupon::Data }
|
|
12
13
|
|
|
13
14
|
# @!method initialize(data:)
|
|
14
|
-
#
|
|
15
|
+
# Response object
|
|
16
|
+
#
|
|
17
|
+
# @param data [Stigg::Models::V1::Coupon::Data] Discount instrument with percentage or fixed amount
|
|
15
18
|
|
|
16
|
-
# @see Stigg::Models::V1::
|
|
19
|
+
# @see Stigg::Models::V1::Coupon#data
|
|
17
20
|
class Data < Stigg::Internal::Type::BaseModel
|
|
18
21
|
# @!attribute id
|
|
19
22
|
# The unique identifier for the entity
|
|
@@ -24,9 +27,9 @@ module Stigg
|
|
|
24
27
|
# @!attribute amounts_off
|
|
25
28
|
# Fixed amount discounts in different currencies
|
|
26
29
|
#
|
|
27
|
-
# @return [Array<Stigg::Models::V1::
|
|
30
|
+
# @return [Array<Stigg::Models::V1::Coupon::Data::AmountsOff>, nil]
|
|
28
31
|
required :amounts_off,
|
|
29
|
-
-> { Stigg::Internal::Type::ArrayOf[Stigg::
|
|
32
|
+
-> { Stigg::Internal::Type::ArrayOf[Stigg::V1::Coupon::Data::AmountsOff] },
|
|
30
33
|
api_name: :amountsOff,
|
|
31
34
|
nil?: true
|
|
32
35
|
|
|
@@ -75,20 +78,20 @@ module Stigg
|
|
|
75
78
|
# @!attribute source
|
|
76
79
|
# The source of the coupon
|
|
77
80
|
#
|
|
78
|
-
# @return [Symbol, Stigg::Models::V1::
|
|
79
|
-
required :source, enum: -> { Stigg::
|
|
81
|
+
# @return [Symbol, Stigg::Models::V1::Coupon::Data::Source, nil]
|
|
82
|
+
required :source, enum: -> { Stigg::V1::Coupon::Data::Source }, nil?: true
|
|
80
83
|
|
|
81
84
|
# @!attribute status
|
|
82
85
|
# Current status of the coupon
|
|
83
86
|
#
|
|
84
|
-
# @return [Symbol, Stigg::Models::V1::
|
|
85
|
-
required :status, enum: -> { Stigg::
|
|
87
|
+
# @return [Symbol, Stigg::Models::V1::Coupon::Data::Status]
|
|
88
|
+
required :status, enum: -> { Stigg::V1::Coupon::Data::Status }
|
|
86
89
|
|
|
87
90
|
# @!attribute type
|
|
88
91
|
# Type of the coupon (percentage or fixed amount)
|
|
89
92
|
#
|
|
90
|
-
# @return [Symbol, Stigg::Models::V1::
|
|
91
|
-
required :type, enum: -> { Stigg::
|
|
93
|
+
# @return [Symbol, Stigg::Models::V1::Coupon::Data::Type]
|
|
94
|
+
required :type, enum: -> { Stigg::V1::Coupon::Data::Type }
|
|
92
95
|
|
|
93
96
|
# @!attribute updated_at
|
|
94
97
|
# Timestamp of when the record was last updated
|
|
@@ -97,9 +100,11 @@ module Stigg
|
|
|
97
100
|
required :updated_at, Time, api_name: :updatedAt
|
|
98
101
|
|
|
99
102
|
# @!method initialize(id:, amounts_off:, billing_id:, billing_link_url:, created_at:, description:, duration_in_months:, name:, percent_off:, source:, status:, type:, updated_at:)
|
|
103
|
+
# Discount instrument with percentage or fixed amount
|
|
104
|
+
#
|
|
100
105
|
# @param id [String] The unique identifier for the entity
|
|
101
106
|
#
|
|
102
|
-
# @param amounts_off [Array<Stigg::Models::V1::
|
|
107
|
+
# @param amounts_off [Array<Stigg::Models::V1::Coupon::Data::AmountsOff>, nil] Fixed amount discounts in different currencies
|
|
103
108
|
#
|
|
104
109
|
# @param billing_id [String, nil] The unique identifier for the entity in the billing provider
|
|
105
110
|
#
|
|
@@ -115,11 +120,11 @@ module Stigg
|
|
|
115
120
|
#
|
|
116
121
|
# @param percent_off [Float, nil] Percentage discount off the original price
|
|
117
122
|
#
|
|
118
|
-
# @param source [Symbol, Stigg::Models::V1::
|
|
123
|
+
# @param source [Symbol, Stigg::Models::V1::Coupon::Data::Source, nil] The source of the coupon
|
|
119
124
|
#
|
|
120
|
-
# @param status [Symbol, Stigg::Models::V1::
|
|
125
|
+
# @param status [Symbol, Stigg::Models::V1::Coupon::Data::Status] Current status of the coupon
|
|
121
126
|
#
|
|
122
|
-
# @param type [Symbol, Stigg::Models::V1::
|
|
127
|
+
# @param type [Symbol, Stigg::Models::V1::Coupon::Data::Type] Type of the coupon (percentage or fixed amount)
|
|
123
128
|
#
|
|
124
129
|
# @param updated_at [Time] Timestamp of when the record was last updated
|
|
125
130
|
|
|
@@ -133,19 +138,19 @@ module Stigg
|
|
|
133
138
|
# @!attribute currency
|
|
134
139
|
# The price currency
|
|
135
140
|
#
|
|
136
|
-
# @return [Symbol, Stigg::Models::V1::
|
|
137
|
-
required :currency,
|
|
138
|
-
enum: -> { Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff::Currency },
|
|
139
|
-
nil?: true
|
|
141
|
+
# @return [Symbol, Stigg::Models::V1::Coupon::Data::AmountsOff::Currency]
|
|
142
|
+
required :currency, enum: -> { Stigg::V1::Coupon::Data::AmountsOff::Currency }
|
|
140
143
|
|
|
141
144
|
# @!method initialize(amount:, currency:)
|
|
145
|
+
# Monetary amount with currency
|
|
146
|
+
#
|
|
142
147
|
# @param amount [Float] The price amount
|
|
143
148
|
#
|
|
144
|
-
# @param currency [Symbol, Stigg::Models::V1::
|
|
149
|
+
# @param currency [Symbol, Stigg::Models::V1::Coupon::Data::AmountsOff::Currency] The price currency
|
|
145
150
|
|
|
146
151
|
# The price currency
|
|
147
152
|
#
|
|
148
|
-
# @see Stigg::Models::V1::
|
|
153
|
+
# @see Stigg::Models::V1::Coupon::Data::AmountsOff#currency
|
|
149
154
|
module Currency
|
|
150
155
|
extend Stigg::Internal::Type::Enum
|
|
151
156
|
|
|
@@ -273,7 +278,7 @@ module Stigg
|
|
|
273
278
|
|
|
274
279
|
# The source of the coupon
|
|
275
280
|
#
|
|
276
|
-
# @see Stigg::Models::V1::
|
|
281
|
+
# @see Stigg::Models::V1::Coupon::Data#source
|
|
277
282
|
module Source
|
|
278
283
|
extend Stigg::Internal::Type::Enum
|
|
279
284
|
|
|
@@ -287,7 +292,7 @@ module Stigg
|
|
|
287
292
|
|
|
288
293
|
# Current status of the coupon
|
|
289
294
|
#
|
|
290
|
-
# @see Stigg::Models::V1::
|
|
295
|
+
# @see Stigg::Models::V1::Coupon::Data#status
|
|
291
296
|
module Status
|
|
292
297
|
extend Stigg::Internal::Type::Enum
|
|
293
298
|
|
|
@@ -300,7 +305,7 @@ module Stigg
|
|
|
300
305
|
|
|
301
306
|
# Type of the coupon (percentage or fixed amount)
|
|
302
307
|
#
|
|
303
|
-
# @see Stigg::Models::V1::
|
|
308
|
+
# @see Stigg::Models::V1::Coupon::Data#type
|
|
304
309
|
module Type
|
|
305
310
|
extend Stigg::Internal::Type::Enum
|
|
306
311
|
|
|
@@ -84,6 +84,8 @@ module Stigg
|
|
|
84
84
|
required :currency, enum: -> { Stigg::V1::CouponCreateParams::AmountsOff::Currency }
|
|
85
85
|
|
|
86
86
|
# @!method initialize(amount:, currency:)
|
|
87
|
+
# Monetary amount with currency
|
|
88
|
+
#
|
|
87
89
|
# @param amount [Float] The price amount
|
|
88
90
|
#
|
|
89
91
|
# @param currency [Symbol, Stigg::Models::V1::CouponCreateParams::AmountsOff::Currency] The price currency
|
|
@@ -8,30 +8,30 @@ module Stigg
|
|
|
8
8
|
extend Stigg::Internal::Type::RequestParameters::Converter
|
|
9
9
|
include Stigg::Internal::Type::RequestParameters
|
|
10
10
|
|
|
11
|
-
# @!attribute
|
|
12
|
-
#
|
|
11
|
+
# @!attribute after
|
|
12
|
+
# Return items that come after this cursor
|
|
13
13
|
#
|
|
14
14
|
# @return [String, nil]
|
|
15
|
-
optional :
|
|
15
|
+
optional :after, String
|
|
16
|
+
|
|
17
|
+
# @!attribute before
|
|
18
|
+
# Return items that come before this cursor
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :before, String
|
|
16
22
|
|
|
17
23
|
# @!attribute limit
|
|
18
|
-
#
|
|
24
|
+
# Maximum number of items to return
|
|
19
25
|
#
|
|
20
26
|
# @return [Integer, nil]
|
|
21
27
|
optional :limit, Integer
|
|
22
28
|
|
|
23
|
-
# @!
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
# @return [String, nil]
|
|
27
|
-
optional :starting_after, String
|
|
28
|
-
|
|
29
|
-
# @!method initialize(ending_before: nil, limit: nil, starting_after: nil, request_options: {})
|
|
30
|
-
# @param ending_before [String] Ending before this UUID for pagination
|
|
29
|
+
# @!method initialize(after: nil, before: nil, limit: nil, request_options: {})
|
|
30
|
+
# @param after [String] Return items that come after this cursor
|
|
31
31
|
#
|
|
32
|
-
# @param
|
|
32
|
+
# @param before [String] Return items that come before this cursor
|
|
33
33
|
#
|
|
34
|
-
# @param
|
|
34
|
+
# @param limit [Integer] Maximum number of items to return
|
|
35
35
|
#
|
|
36
36
|
# @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
|
|
37
37
|
end
|