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.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +29 -1
  4. data/lib/stigg/internal/my_cursor_id_page.rb +32 -4
  5. data/lib/stigg/internal/type/base_model.rb +2 -2
  6. data/lib/stigg/models/v1/{coupon_create_response.rb → coupon.rb} +31 -26
  7. data/lib/stigg/models/v1/coupon_create_params.rb +2 -0
  8. data/lib/stigg/models/v1/coupon_list_params.rb +14 -14
  9. data/lib/stigg/models/v1/coupon_list_response.rb +262 -278
  10. data/lib/stigg/models/v1/customer_import_params.rb +75 -0
  11. data/lib/stigg/models/v1/customer_import_response.rb +35 -0
  12. data/lib/stigg/models/v1/customer_list_params.rb +14 -14
  13. data/lib/stigg/models/v1/customer_list_response.rb +160 -174
  14. data/lib/stigg/models/v1/{customer_create_params.rb → customer_provision_params.rb} +18 -16
  15. data/lib/stigg/models/v1/customer_response.rb +9 -2
  16. data/lib/stigg/models/v1/customer_update_params.rb +2 -0
  17. data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +3 -1
  18. data/lib/stigg/models/v1/customers/{promotional_create_params.rb → promotional_entitlement_grant_params.rb} +46 -44
  19. data/lib/stigg/models/v1/customers/{promotional_create_response.rb → promotional_entitlement_grant_response.rb} +105 -32
  20. data/lib/stigg/models/v1/customers/{promotional_revoke_params.rb → promotional_entitlement_revoke_params.rb} +2 -2
  21. data/lib/stigg/models/v1/customers/{promotional_revoke_response.rb → promotional_entitlement_revoke_response.rb} +107 -33
  22. data/lib/stigg/models/v1/event_report_params.rb +91 -0
  23. data/lib/stigg/models/v1/event_report_response.rb +25 -0
  24. data/lib/stigg/models/v1/{subscription_retrieve_response.rb → subscription.rb} +67 -26
  25. data/lib/stigg/models/v1/subscription_cancel_params.rb +75 -0
  26. data/lib/stigg/models/v1/subscription_delegate_params.rb +7 -2
  27. data/lib/stigg/models/v1/subscription_import_params.rb +92 -0
  28. data/lib/stigg/models/v1/subscription_import_response.rb +32 -0
  29. data/lib/stigg/models/v1/subscription_list_params.rb +20 -24
  30. data/lib/stigg/models/v1/subscription_list_response.rb +255 -236
  31. data/lib/stigg/models/v1/subscription_migrate_params.rb +3 -3
  32. data/lib/stigg/models/v1/subscription_preview_params.rb +139 -46
  33. data/lib/stigg/models/v1/subscription_preview_response.rb +164 -49
  34. data/lib/stigg/models/v1/subscription_provision_params.rb +1693 -0
  35. data/lib/stigg/models/v1/subscription_provision_response.rb +1038 -0
  36. data/lib/stigg/models/v1/subscription_transfer_params.rb +2 -6
  37. data/lib/stigg/models/v1/subscription_update_params.rb +1114 -0
  38. data/lib/stigg/models/v1/subscriptions/{future_update_cancel_pending_payment_response.rb → cancel_subscription.rb} +9 -5
  39. data/lib/stigg/models/v1/usage_history_params.rb +54 -0
  40. data/lib/stigg/models/v1/usage_history_response.rb +155 -0
  41. data/lib/stigg/models/v1/usage_report_params.rb +114 -0
  42. data/lib/stigg/models/v1/usage_report_response.rb +120 -0
  43. data/lib/stigg/models.rb +0 -4
  44. data/lib/stigg/resources/v1/coupons.rb +16 -14
  45. data/lib/stigg/resources/v1/customers/payment_method.rb +6 -5
  46. data/lib/stigg/resources/v1/customers/{promotional.rb → promotional_entitlements.rb} +17 -17
  47. data/lib/stigg/resources/v1/customers.rb +78 -56
  48. data/lib/stigg/resources/v1/events.rb +38 -0
  49. data/lib/stigg/resources/v1/subscriptions/future_update.rb +10 -8
  50. data/lib/stigg/resources/v1/subscriptions.rb +206 -79
  51. data/lib/stigg/resources/v1/usage.rb +79 -0
  52. data/lib/stigg/resources/v1.rb +6 -42
  53. data/lib/stigg/version.rb +1 -1
  54. data/lib/stigg.rb +25 -23
  55. data/rbi/stigg/internal/my_cursor_id_page.rbi +27 -0
  56. data/rbi/stigg/models/v1/coupon.rbi +891 -0
  57. data/rbi/stigg/models/v1/coupon_create_params.rbi +1 -0
  58. data/rbi/stigg/models/v1/coupon_list_params.rbi +21 -21
  59. data/rbi/stigg/models/v1/coupon_list_response.rbi +812 -869
  60. data/rbi/stigg/models/v1/customer_import_params.rbi +130 -0
  61. data/rbi/stigg/models/v1/customer_import_response.rbi +76 -0
  62. data/rbi/stigg/models/v1/customer_list_params.rbi +21 -21
  63. data/rbi/stigg/models/v1/customer_list_response.rbi +307 -347
  64. data/rbi/stigg/models/v1/{customer_create_params.rbi → customer_provision_params.rbi} +36 -35
  65. data/rbi/stigg/models/v1/customer_response.rbi +8 -1
  66. data/rbi/stigg/models/v1/customer_update_params.rbi +1 -0
  67. data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +3 -0
  68. data/rbi/stigg/models/v1/customers/{promotional_create_params.rbi → promotional_entitlement_grant_params.rbi} +78 -77
  69. data/rbi/stigg/models/v1/customers/promotional_entitlement_grant_response.rbi +690 -0
  70. data/rbi/stigg/models/v1/customers/{promotional_revoke_params.rbi → promotional_entitlement_revoke_params.rbi} +2 -2
  71. data/rbi/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbi +696 -0
  72. data/rbi/stigg/models/v1/event_report_params.rbi +168 -0
  73. data/rbi/stigg/models/v1/event_report_response.rbi +35 -0
  74. data/rbi/stigg/models/v1/{subscription_migrate_response.rbi → subscription.rbi} +130 -98
  75. data/rbi/stigg/models/v1/subscription_cancel_params.rbi +182 -0
  76. data/rbi/stigg/models/v1/subscription_delegate_params.rbi +6 -2
  77. data/rbi/stigg/models/v1/subscription_import_params.rbi +148 -0
  78. data/rbi/stigg/models/v1/subscription_import_response.rbi +69 -0
  79. data/rbi/stigg/models/v1/subscription_list_params.rbi +26 -28
  80. data/rbi/stigg/models/v1/subscription_list_response.rbi +460 -435
  81. data/rbi/stigg/models/v1/subscription_migrate_params.rbi +3 -3
  82. data/rbi/stigg/models/v1/subscription_preview_params.rbi +112 -14
  83. data/rbi/stigg/models/v1/subscription_preview_response.rbi +139 -6
  84. data/rbi/stigg/models/v1/subscription_provision_params.rbi +5306 -0
  85. data/rbi/stigg/models/v1/subscription_provision_response.rbi +3175 -0
  86. data/rbi/stigg/models/v1/subscription_transfer_params.rbi +2 -4
  87. data/rbi/stigg/models/v1/subscription_update_params.rbi +3578 -0
  88. data/rbi/stigg/models/v1/subscriptions/{future_update_cancel_schedule_response.rbi → cancel_subscription.rbi} +10 -16
  89. data/rbi/stigg/models/v1/usage_history_params.rbi +79 -0
  90. data/rbi/stigg/models/v1/usage_history_response.rbi +347 -0
  91. data/rbi/stigg/models/v1/usage_report_params.rbi +227 -0
  92. data/rbi/stigg/models/v1/usage_report_response.rbi +162 -0
  93. data/rbi/stigg/models.rbi +0 -4
  94. data/rbi/stigg/resources/v1/coupons.rbi +22 -14
  95. data/rbi/stigg/resources/v1/customers/payment_method.rbi +9 -3
  96. data/rbi/stigg/resources/v1/customers/{promotional.rbi → promotional_entitlements.rbi} +13 -9
  97. data/rbi/stigg/resources/v1/customers.rbi +84 -53
  98. data/rbi/stigg/resources/v1/events.rbi +28 -0
  99. data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +14 -10
  100. data/rbi/stigg/resources/v1/subscriptions.rbi +242 -58
  101. data/rbi/stigg/resources/v1/usage.rbi +57 -0
  102. data/rbi/stigg/resources/v1.rbi +4 -26
  103. data/sig/stigg/internal/my_cursor_id_page.rbs +17 -0
  104. data/sig/stigg/models/v1/{coupon_create_response.rbs → coupon.rbs} +29 -32
  105. data/sig/stigg/models/v1/coupon_list_params.rbs +11 -11
  106. data/sig/stigg/models/v1/coupon_list_response.rbs +331 -351
  107. data/sig/stigg/models/v1/customer_import_params.rbs +74 -0
  108. data/sig/stigg/models/v1/customer_import_response.rbs +30 -0
  109. data/sig/stigg/models/v1/customer_list_params.rbs +11 -11
  110. data/sig/stigg/models/v1/customer_list_response.rbs +133 -153
  111. data/sig/stigg/models/v1/{customer_create_params.rbs → customer_provision_params.rbs} +22 -22
  112. data/sig/stigg/models/v1/customers/{promotional_create_params.rbs → promotional_entitlement_grant_params.rbs} +43 -43
  113. data/sig/stigg/models/v1/customers/promotional_entitlement_grant_response.rbs +281 -0
  114. data/sig/stigg/models/v1/customers/{promotional_revoke_params.rbs → promotional_entitlement_revoke_params.rbs} +2 -2
  115. data/sig/stigg/models/v1/customers/promotional_entitlement_revoke_response.rbs +281 -0
  116. data/sig/stigg/models/v1/event_report_params.rbs +82 -0
  117. data/sig/stigg/models/v1/event_report_response.rbs +15 -0
  118. data/sig/stigg/models/v1/{subscription_retrieve_response.rbs → subscription.rbs} +61 -35
  119. data/sig/stigg/models/v1/subscription_cancel_params.rbs +79 -0
  120. data/sig/stigg/models/v1/subscription_import_params.rbs +84 -0
  121. data/sig/stigg/models/v1/subscription_import_response.rbs +30 -0
  122. data/sig/stigg/models/v1/subscription_list_params.rbs +14 -14
  123. data/sig/stigg/models/v1/subscription_list_response.rbs +196 -189
  124. data/sig/stigg/models/v1/subscription_preview_params.rbs +2 -6
  125. data/sig/stigg/models/v1/subscription_provision_params.rbs +2223 -0
  126. data/sig/stigg/models/v1/subscription_provision_response.rbs +1305 -0
  127. data/sig/stigg/models/v1/subscription_update_params.rbs +1544 -0
  128. data/sig/stigg/models/v1/subscriptions/cancel_subscription.rbs +34 -0
  129. data/sig/stigg/models/v1/usage_history_params.rbs +52 -0
  130. data/sig/stigg/models/v1/usage_history_response.rbs +129 -0
  131. data/sig/stigg/models/v1/usage_report_params.rbs +102 -0
  132. data/sig/stigg/models/v1/usage_report_response.rbs +87 -0
  133. data/sig/stigg/models.rbs +0 -4
  134. data/sig/stigg/resources/v1/coupons.rbs +5 -5
  135. data/sig/stigg/resources/v1/customers/{promotional.rbs → promotional_entitlements.rbs} +5 -5
  136. data/sig/stigg/resources/v1/customers.rbs +20 -17
  137. data/sig/stigg/resources/v1/events.rbs +14 -0
  138. data/sig/stigg/resources/v1/subscriptions/future_update.rbs +2 -2
  139. data/sig/stigg/resources/v1/subscriptions.rbs +68 -20
  140. data/sig/stigg/resources/v1/usage.rbs +24 -0
  141. data/sig/stigg/resources/v1.rbs +2 -8
  142. metadata +77 -71
  143. data/lib/stigg/models/v1/coupon_retrieve_response.rb +0 -317
  144. data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +0 -56
  145. data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +0 -145
  146. data/lib/stigg/models/v1/subscription_create_params.rb +0 -214
  147. data/lib/stigg/models/v1/subscription_create_response.rb +0 -338
  148. data/lib/stigg/models/v1/subscription_delegate_response.rb +0 -274
  149. data/lib/stigg/models/v1/subscription_migrate_response.rb +0 -274
  150. data/lib/stigg/models/v1/subscription_transfer_response.rb +0 -274
  151. data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +0 -32
  152. data/lib/stigg/models/v1_create_event_params.rb +0 -87
  153. data/lib/stigg/models/v1_create_event_response.rb +0 -16
  154. data/lib/stigg/models/v1_create_usage_params.rb +0 -96
  155. data/lib/stigg/models/v1_create_usage_response.rb +0 -112
  156. data/lib/stigg/resources/v1/customers/usage.rb +0 -59
  157. data/rbi/stigg/models/v1/coupon_create_response.rbi +0 -986
  158. data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +0 -986
  159. data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +0 -495
  160. data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +0 -497
  161. data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +0 -84
  162. data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +0 -353
  163. data/rbi/stigg/models/v1/subscription_create_params.rbi +0 -394
  164. data/rbi/stigg/models/v1/subscription_create_response.rbi +0 -668
  165. data/rbi/stigg/models/v1/subscription_delegate_response.rbi +0 -535
  166. data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +0 -535
  167. data/rbi/stigg/models/v1/subscription_transfer_response.rbi +0 -535
  168. data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +0 -79
  169. data/rbi/stigg/models/v1_create_event_params.rbi +0 -160
  170. data/rbi/stigg/models/v1_create_event_response.rbi +0 -23
  171. data/rbi/stigg/models/v1_create_usage_params.rbi +0 -177
  172. data/rbi/stigg/models/v1_create_usage_response.rbi +0 -150
  173. data/rbi/stigg/resources/v1/customers/usage.rbi +0 -45
  174. data/sig/stigg/models/v1/coupon_retrieve_response.rbs +0 -394
  175. data/sig/stigg/models/v1/customers/promotional_create_response.rbs +0 -209
  176. data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +0 -209
  177. data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +0 -54
  178. data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +0 -134
  179. data/sig/stigg/models/v1/subscription_create_params.rbs +0 -199
  180. data/sig/stigg/models/v1/subscription_create_response.rbs +0 -283
  181. data/sig/stigg/models/v1/subscription_delegate_response.rbs +0 -224
  182. data/sig/stigg/models/v1/subscription_migrate_response.rbs +0 -224
  183. data/sig/stigg/models/v1/subscription_transfer_response.rbs +0 -224
  184. data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +0 -34
  185. data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +0 -34
  186. data/sig/stigg/models/v1_create_event_params.rbs +0 -80
  187. data/sig/stigg/models/v1_create_event_response.rbs +0 -13
  188. data/sig/stigg/models/v1_create_usage_params.rbs +0 -90
  189. data/sig/stigg/models/v1_create_usage_response.rbs +0 -85
  190. 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: dad9def9c2060ac8c54995c4f63a0497d1c14a2022d7b6569925aca298bbcdaa
4
- data.tar.gz: f50551f0e1863014f5b3dfaa2dde3e789c035bdef3898626ff21b51ef32d6535
3
+ metadata.gz: d8e60f4fdad10d2d4b37e4f5d646accf564f8b280a86e1c9ba46b488138b1f43
4
+ data.tar.gz: eb0423ccd6a83e037421ab3e2d78187e6aff8024175a974af11d06d7f9f8a587
5
5
  SHA512:
6
- metadata.gz: 751c86239a5713845dd854d30c4ac147750aa4aefe5403be71dc123813a108234d941a4c2c637fb4e5e78f8e22f0cef9a29acf8f89b8e5b6c43466931738ddc7
7
- data.tar.gz: 440230700abfdf4768089e975647a0425284bab3407e39b1aa749a98fa9c30a86f1c9c621dd85f49e2d64c51b89801ebb602f1474b03f522f32c815b1b0ad9eb
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.1"
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 |item|
14
- # puts(item)
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(@req, {query: {starting_after: data&.last&.cursor_id}})
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
- # # `v1_create_event_response` is a `Stigg::Models::V1CreateEventResponse`
442
- # v1_create_event_response => {
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 CouponCreateResponse < Stigg::Internal::Type::BaseModel
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::CouponCreateResponse::Data]
11
- required :data, -> { Stigg::Models::V1::CouponCreateResponse::Data }
11
+ # @return [Stigg::Models::V1::Coupon::Data]
12
+ required :data, -> { Stigg::V1::Coupon::Data }
12
13
 
13
14
  # @!method initialize(data:)
14
- # @param data [Stigg::Models::V1::CouponCreateResponse::Data]
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::CouponCreateResponse#data
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::CouponCreateResponse::Data::AmountsOff>, nil]
30
+ # @return [Array<Stigg::Models::V1::Coupon::Data::AmountsOff>, nil]
28
31
  required :amounts_off,
29
- -> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff] },
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::CouponCreateResponse::Data::Source, nil]
79
- required :source, enum: -> { Stigg::Models::V1::CouponCreateResponse::Data::Source }, nil?: true
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::CouponCreateResponse::Data::Status]
85
- required :status, enum: -> { Stigg::Models::V1::CouponCreateResponse::Data::Status }
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::CouponCreateResponse::Data::Type]
91
- required :type, enum: -> { Stigg::Models::V1::CouponCreateResponse::Data::Type }
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::CouponCreateResponse::Data::AmountsOff>, nil] Fixed amount discounts in different currencies
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::CouponCreateResponse::Data::Source, nil] The source of the coupon
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::CouponCreateResponse::Data::Status] Current status of the coupon
125
+ # @param status [Symbol, Stigg::Models::V1::Coupon::Data::Status] Current status of the coupon
121
126
  #
122
- # @param type [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::Type] Type of the coupon (percentage or fixed amount)
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::CouponCreateResponse::Data::AmountsOff::Currency, nil]
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::CouponCreateResponse::Data::AmountsOff::Currency, nil] The price currency
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::CouponCreateResponse::Data::AmountsOff#currency
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::CouponCreateResponse::Data#source
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::CouponCreateResponse::Data#status
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::CouponCreateResponse::Data#type
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 ending_before
12
- # Ending before this UUID for pagination
11
+ # @!attribute after
12
+ # Return items that come after this cursor
13
13
  #
14
14
  # @return [String, nil]
15
- optional :ending_before, String
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
- # Items per page
24
+ # Maximum number of items to return
19
25
  #
20
26
  # @return [Integer, nil]
21
27
  optional :limit, Integer
22
28
 
23
- # @!attribute starting_after
24
- # Starting after this UUID for pagination
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 limit [Integer] Items per page
32
+ # @param before [String] Return items that come before this cursor
33
33
  #
34
- # @param starting_after [String] Starting after this UUID for pagination
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