stigg 0.1.0.pre.alpha.1

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 (230) hide show
  1. checksums.yaml +7 -0
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +45 -0
  4. data/README.md +233 -0
  5. data/SECURITY.md +23 -0
  6. data/lib/stigg/client.rb +72 -0
  7. data/lib/stigg/errors.rb +228 -0
  8. data/lib/stigg/file_part.rb +58 -0
  9. data/lib/stigg/internal/my_cursor_id_page.rb +82 -0
  10. data/lib/stigg/internal/transport/base_client.rb +570 -0
  11. data/lib/stigg/internal/transport/pooled_net_requester.rb +210 -0
  12. data/lib/stigg/internal/type/array_of.rb +168 -0
  13. data/lib/stigg/internal/type/base_model.rb +529 -0
  14. data/lib/stigg/internal/type/base_page.rb +55 -0
  15. data/lib/stigg/internal/type/boolean.rb +77 -0
  16. data/lib/stigg/internal/type/converter.rb +327 -0
  17. data/lib/stigg/internal/type/enum.rb +131 -0
  18. data/lib/stigg/internal/type/file_input.rb +110 -0
  19. data/lib/stigg/internal/type/hash_of.rb +188 -0
  20. data/lib/stigg/internal/type/request_parameters.rb +42 -0
  21. data/lib/stigg/internal/type/union.rb +237 -0
  22. data/lib/stigg/internal/type/unknown.rb +81 -0
  23. data/lib/stigg/internal/util.rb +920 -0
  24. data/lib/stigg/internal.rb +20 -0
  25. data/lib/stigg/models/v1/coupon_create_params.rb +221 -0
  26. data/lib/stigg/models/v1/coupon_create_response.rb +317 -0
  27. data/lib/stigg/models/v1/coupon_list_params.rb +40 -0
  28. data/lib/stigg/models/v1/coupon_list_response.rb +324 -0
  29. data/lib/stigg/models/v1/coupon_retrieve_params.rb +16 -0
  30. data/lib/stigg/models/v1/coupon_retrieve_response.rb +317 -0
  31. data/lib/stigg/models/v1/customer_archive_params.rb +16 -0
  32. data/lib/stigg/models/v1/customer_create_params.rb +185 -0
  33. data/lib/stigg/models/v1/customer_list_params.rb +40 -0
  34. data/lib/stigg/models/v1/customer_list_response.rb +223 -0
  35. data/lib/stigg/models/v1/customer_response.rb +216 -0
  36. data/lib/stigg/models/v1/customer_retrieve_params.rb +16 -0
  37. data/lib/stigg/models/v1/customer_unarchive_params.rb +16 -0
  38. data/lib/stigg/models/v1/customer_update_params.rb +107 -0
  39. data/lib/stigg/models/v1/customers/payment_method_attach_params.rb +197 -0
  40. data/lib/stigg/models/v1/customers/payment_method_detach_params.rb +18 -0
  41. data/lib/stigg/models/v1/customers/promotional_create_params.rb +294 -0
  42. data/lib/stigg/models/v1/customers/promotional_create_response.rb +268 -0
  43. data/lib/stigg/models/v1/customers/promotional_revoke_params.rb +24 -0
  44. data/lib/stigg/models/v1/customers/promotional_revoke_response.rb +268 -0
  45. data/lib/stigg/models/v1/customers/usage_retrieve_params.rb +56 -0
  46. data/lib/stigg/models/v1/customers/usage_retrieve_response.rb +145 -0
  47. data/lib/stigg/models/v1/subscription_create_params.rb +214 -0
  48. data/lib/stigg/models/v1/subscription_create_response.rb +338 -0
  49. data/lib/stigg/models/v1/subscription_delegate_params.rb +24 -0
  50. data/lib/stigg/models/v1/subscription_delegate_response.rb +274 -0
  51. data/lib/stigg/models/v1/subscription_list_params.rb +60 -0
  52. data/lib/stigg/models/v1/subscription_list_response.rb +281 -0
  53. data/lib/stigg/models/v1/subscription_migrate_params.rb +37 -0
  54. data/lib/stigg/models/v1/subscription_migrate_response.rb +274 -0
  55. data/lib/stigg/models/v1/subscription_preview_params.rb +644 -0
  56. data/lib/stigg/models/v1/subscription_preview_response.rb +431 -0
  57. data/lib/stigg/models/v1/subscription_retrieve_params.rb +16 -0
  58. data/lib/stigg/models/v1/subscription_retrieve_response.rb +274 -0
  59. data/lib/stigg/models/v1/subscription_transfer_params.rb +28 -0
  60. data/lib/stigg/models/v1/subscription_transfer_response.rb +274 -0
  61. data/lib/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_params.rb +18 -0
  62. data/lib/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rb +32 -0
  63. data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_params.rb +18 -0
  64. data/lib/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rb +32 -0
  65. data/lib/stigg/models/v1_create_event_params.rb +87 -0
  66. data/lib/stigg/models/v1_create_event_response.rb +16 -0
  67. data/lib/stigg/models/v1_create_usage_params.rb +96 -0
  68. data/lib/stigg/models/v1_create_usage_response.rb +112 -0
  69. data/lib/stigg/models.rb +47 -0
  70. data/lib/stigg/request_options.rb +77 -0
  71. data/lib/stigg/resources/v1/coupons.rb +95 -0
  72. data/lib/stigg/resources/v1/customers/payment_method.rb +67 -0
  73. data/lib/stigg/resources/v1/customers/promotional.rb +69 -0
  74. data/lib/stigg/resources/v1/customers/usage.rb +59 -0
  75. data/lib/stigg/resources/v1/customers.rb +177 -0
  76. data/lib/stigg/resources/v1/subscriptions/future_update.rb +56 -0
  77. data/lib/stigg/resources/v1/subscriptions.rb +241 -0
  78. data/lib/stigg/resources/v1.rb +70 -0
  79. data/lib/stigg/version.rb +5 -0
  80. data/lib/stigg.rb +108 -0
  81. data/manifest.yaml +17 -0
  82. data/rbi/stigg/client.rbi +49 -0
  83. data/rbi/stigg/errors.rbi +205 -0
  84. data/rbi/stigg/file_part.rbi +37 -0
  85. data/rbi/stigg/internal/my_cursor_id_page.rbi +19 -0
  86. data/rbi/stigg/internal/transport/base_client.rbi +297 -0
  87. data/rbi/stigg/internal/transport/pooled_net_requester.rbi +82 -0
  88. data/rbi/stigg/internal/type/array_of.rbi +104 -0
  89. data/rbi/stigg/internal/type/base_model.rbi +299 -0
  90. data/rbi/stigg/internal/type/base_page.rbi +42 -0
  91. data/rbi/stigg/internal/type/boolean.rbi +58 -0
  92. data/rbi/stigg/internal/type/converter.rbi +204 -0
  93. data/rbi/stigg/internal/type/enum.rbi +82 -0
  94. data/rbi/stigg/internal/type/file_input.rbi +58 -0
  95. data/rbi/stigg/internal/type/hash_of.rbi +104 -0
  96. data/rbi/stigg/internal/type/request_parameters.rbi +29 -0
  97. data/rbi/stigg/internal/type/union.rbi +126 -0
  98. data/rbi/stigg/internal/type/unknown.rbi +58 -0
  99. data/rbi/stigg/internal/util.rbi +478 -0
  100. data/rbi/stigg/internal.rbi +16 -0
  101. data/rbi/stigg/models/v1/coupon_create_params.rbi +758 -0
  102. data/rbi/stigg/models/v1/coupon_create_response.rbi +986 -0
  103. data/rbi/stigg/models/v1/coupon_list_params.rbi +70 -0
  104. data/rbi/stigg/models/v1/coupon_list_response.rbi +983 -0
  105. data/rbi/stigg/models/v1/coupon_retrieve_params.rbi +29 -0
  106. data/rbi/stigg/models/v1/coupon_retrieve_response.rbi +986 -0
  107. data/rbi/stigg/models/v1/customer_archive_params.rbi +29 -0
  108. data/rbi/stigg/models/v1/customer_create_params.rbi +376 -0
  109. data/rbi/stigg/models/v1/customer_list_params.rbi +70 -0
  110. data/rbi/stigg/models/v1/customer_list_response.rbi +447 -0
  111. data/rbi/stigg/models/v1/customer_response.rbi +423 -0
  112. data/rbi/stigg/models/v1/customer_retrieve_params.rbi +29 -0
  113. data/rbi/stigg/models/v1/customer_unarchive_params.rbi +29 -0
  114. data/rbi/stigg/models/v1/customer_update_params.rbi +226 -0
  115. data/rbi/stigg/models/v1/customers/payment_method_attach_params.rbi +769 -0
  116. data/rbi/stigg/models/v1/customers/payment_method_detach_params.rbi +34 -0
  117. data/rbi/stigg/models/v1/customers/promotional_create_params.rbi +639 -0
  118. data/rbi/stigg/models/v1/customers/promotional_create_response.rbi +495 -0
  119. data/rbi/stigg/models/v1/customers/promotional_revoke_params.rbi +42 -0
  120. data/rbi/stigg/models/v1/customers/promotional_revoke_response.rbi +497 -0
  121. data/rbi/stigg/models/v1/customers/usage_retrieve_params.rbi +84 -0
  122. data/rbi/stigg/models/v1/customers/usage_retrieve_response.rbi +353 -0
  123. data/rbi/stigg/models/v1/subscription_create_params.rbi +394 -0
  124. data/rbi/stigg/models/v1/subscription_create_response.rbi +668 -0
  125. data/rbi/stigg/models/v1/subscription_delegate_params.rbi +48 -0
  126. data/rbi/stigg/models/v1/subscription_delegate_response.rbi +535 -0
  127. data/rbi/stigg/models/v1/subscription_list_params.rbi +94 -0
  128. data/rbi/stigg/models/v1/subscription_list_response.rbi +543 -0
  129. data/rbi/stigg/models/v1/subscription_migrate_params.rbi +99 -0
  130. data/rbi/stigg/models/v1/subscription_migrate_response.rbi +535 -0
  131. data/rbi/stigg/models/v1/subscription_preview_params.rbi +1786 -0
  132. data/rbi/stigg/models/v1/subscription_preview_response.rbi +929 -0
  133. data/rbi/stigg/models/v1/subscription_retrieve_params.rbi +32 -0
  134. data/rbi/stigg/models/v1/subscription_retrieve_response.rbi +535 -0
  135. data/rbi/stigg/models/v1/subscription_transfer_params.rbi +50 -0
  136. data/rbi/stigg/models/v1/subscription_transfer_response.rbi +535 -0
  137. data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_params.rbi +34 -0
  138. data/rbi/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbi +79 -0
  139. data/rbi/stigg/models/v1/subscriptions/future_update_cancel_schedule_params.rbi +34 -0
  140. data/rbi/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbi +79 -0
  141. data/rbi/stigg/models/v1_create_event_params.rbi +160 -0
  142. data/rbi/stigg/models/v1_create_event_response.rbi +23 -0
  143. data/rbi/stigg/models/v1_create_usage_params.rbi +177 -0
  144. data/rbi/stigg/models/v1_create_usage_response.rbi +150 -0
  145. data/rbi/stigg/models.rbi +9 -0
  146. data/rbi/stigg/request_options.rbi +55 -0
  147. data/rbi/stigg/resources/v1/coupons.rbi +79 -0
  148. data/rbi/stigg/resources/v1/customers/payment_method.rbi +54 -0
  149. data/rbi/stigg/resources/v1/customers/promotional.rbi +53 -0
  150. data/rbi/stigg/resources/v1/customers/usage.rbi +45 -0
  151. data/rbi/stigg/resources/v1/customers.rbi +138 -0
  152. data/rbi/stigg/resources/v1/subscriptions/future_update.rbi +40 -0
  153. data/rbi/stigg/resources/v1/subscriptions.rbi +199 -0
  154. data/rbi/stigg/resources/v1.rbi +49 -0
  155. data/rbi/stigg/version.rbi +5 -0
  156. data/sig/stigg/client.rbs +26 -0
  157. data/sig/stigg/errors.rbs +117 -0
  158. data/sig/stigg/file_part.rbs +21 -0
  159. data/sig/stigg/internal/my_cursor_id_page.rbs +11 -0
  160. data/sig/stigg/internal/transport/base_client.rbs +133 -0
  161. data/sig/stigg/internal/transport/pooled_net_requester.rbs +48 -0
  162. data/sig/stigg/internal/type/array_of.rbs +48 -0
  163. data/sig/stigg/internal/type/base_model.rbs +102 -0
  164. data/sig/stigg/internal/type/base_page.rbs +24 -0
  165. data/sig/stigg/internal/type/boolean.rbs +26 -0
  166. data/sig/stigg/internal/type/converter.rbs +79 -0
  167. data/sig/stigg/internal/type/enum.rbs +32 -0
  168. data/sig/stigg/internal/type/file_input.rbs +25 -0
  169. data/sig/stigg/internal/type/hash_of.rbs +48 -0
  170. data/sig/stigg/internal/type/request_parameters.rbs +17 -0
  171. data/sig/stigg/internal/type/union.rbs +52 -0
  172. data/sig/stigg/internal/type/unknown.rbs +26 -0
  173. data/sig/stigg/internal/util.rbs +185 -0
  174. data/sig/stigg/internal.rbs +9 -0
  175. data/sig/stigg/models/v1/coupon_create_params.rbs +323 -0
  176. data/sig/stigg/models/v1/coupon_create_response.rbs +392 -0
  177. data/sig/stigg/models/v1/coupon_list_params.rbs +40 -0
  178. data/sig/stigg/models/v1/coupon_list_response.rbs +399 -0
  179. data/sig/stigg/models/v1/coupon_retrieve_params.rbs +17 -0
  180. data/sig/stigg/models/v1/coupon_retrieve_response.rbs +394 -0
  181. data/sig/stigg/models/v1/customer_archive_params.rbs +17 -0
  182. data/sig/stigg/models/v1/customer_create_params.rbs +169 -0
  183. data/sig/stigg/models/v1/customer_list_params.rbs +40 -0
  184. data/sig/stigg/models/v1/customer_list_response.rbs +198 -0
  185. data/sig/stigg/models/v1/customer_response.rbs +188 -0
  186. data/sig/stigg/models/v1/customer_retrieve_params.rbs +17 -0
  187. data/sig/stigg/models/v1/customer_unarchive_params.rbs +17 -0
  188. data/sig/stigg/models/v1/customer_update_params.rbs +110 -0
  189. data/sig/stigg/models/v1/customers/payment_method_attach_params.rbs +315 -0
  190. data/sig/stigg/models/v1/customers/payment_method_detach_params.rbs +19 -0
  191. data/sig/stigg/models/v1/customers/promotional_create_params.rbs +234 -0
  192. data/sig/stigg/models/v1/customers/promotional_create_response.rbs +209 -0
  193. data/sig/stigg/models/v1/customers/promotional_revoke_params.rbs +27 -0
  194. data/sig/stigg/models/v1/customers/promotional_revoke_response.rbs +209 -0
  195. data/sig/stigg/models/v1/customers/usage_retrieve_params.rbs +54 -0
  196. data/sig/stigg/models/v1/customers/usage_retrieve_response.rbs +134 -0
  197. data/sig/stigg/models/v1/subscription_create_params.rbs +199 -0
  198. data/sig/stigg/models/v1/subscription_create_response.rbs +283 -0
  199. data/sig/stigg/models/v1/subscription_delegate_params.rbs +26 -0
  200. data/sig/stigg/models/v1/subscription_delegate_response.rbs +224 -0
  201. data/sig/stigg/models/v1/subscription_list_params.rbs +58 -0
  202. data/sig/stigg/models/v1/subscription_list_response.rbs +229 -0
  203. data/sig/stigg/models/v1/subscription_migrate_params.rbs +43 -0
  204. data/sig/stigg/models/v1/subscription_migrate_response.rbs +224 -0
  205. data/sig/stigg/models/v1/subscription_preview_params.rbs +821 -0
  206. data/sig/stigg/models/v1/subscription_preview_response.rbs +466 -0
  207. data/sig/stigg/models/v1/subscription_retrieve_params.rbs +17 -0
  208. data/sig/stigg/models/v1/subscription_retrieve_response.rbs +224 -0
  209. data/sig/stigg/models/v1/subscription_transfer_params.rbs +26 -0
  210. data/sig/stigg/models/v1/subscription_transfer_response.rbs +224 -0
  211. data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_params.rbs +19 -0
  212. data/sig/stigg/models/v1/subscriptions/future_update_cancel_pending_payment_response.rbs +34 -0
  213. data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_params.rbs +19 -0
  214. data/sig/stigg/models/v1/subscriptions/future_update_cancel_schedule_response.rbs +34 -0
  215. data/sig/stigg/models/v1_create_event_params.rbs +80 -0
  216. data/sig/stigg/models/v1_create_event_response.rbs +13 -0
  217. data/sig/stigg/models/v1_create_usage_params.rbs +90 -0
  218. data/sig/stigg/models/v1_create_usage_response.rbs +85 -0
  219. data/sig/stigg/models.rbs +7 -0
  220. data/sig/stigg/request_options.rbs +34 -0
  221. data/sig/stigg/resources/v1/coupons.rbs +32 -0
  222. data/sig/stigg/resources/v1/customers/payment_method.rbs +25 -0
  223. data/sig/stigg/resources/v1/customers/promotional.rbs +23 -0
  224. data/sig/stigg/resources/v1/customers/usage.rbs +21 -0
  225. data/sig/stigg/resources/v1/customers.rbs +58 -0
  226. data/sig/stigg/resources/v1/subscriptions/future_update.rbs +21 -0
  227. data/sig/stigg/resources/v1/subscriptions.rbs +76 -0
  228. data/sig/stigg/resources/v1.rbs +23 -0
  229. data/sig/stigg/version.rbs +3 -0
  230. metadata +301 -0
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Internal
5
+ extend Stigg::Internal::Util::SorbetRuntimeSupport
6
+
7
+ OMIT =
8
+ Object.new.tap do
9
+ _1.define_singleton_method(:inspect) { "#<#{Stigg::Internal}::OMIT>" }
10
+ end
11
+ .freeze
12
+
13
+ define_sorbet_constant!(:AnyHash) do
14
+ T.type_alias { T::Hash[Symbol, T.anything] }
15
+ end
16
+ define_sorbet_constant!(:FileInput) do
17
+ T.type_alias { T.any(Pathname, StringIO, IO, String, Stigg::FilePart) }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,221 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ # @see Stigg::Resources::V1::Coupons#create
7
+ class CouponCreateParams < Stigg::Internal::Type::BaseModel
8
+ extend Stigg::Internal::Type::RequestParameters::Converter
9
+ include Stigg::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ # The unique identifier for the entity
13
+ #
14
+ # @return [String]
15
+ required :id, String
16
+
17
+ # @!attribute amounts_off
18
+ # Fixed amount discounts in different currencies
19
+ #
20
+ # @return [Array<Stigg::Models::V1::CouponCreateParams::AmountsOff>, nil]
21
+ required :amounts_off,
22
+ -> { Stigg::Internal::Type::ArrayOf[Stigg::V1::CouponCreateParams::AmountsOff] },
23
+ api_name: :amountsOff,
24
+ nil?: true
25
+
26
+ # @!attribute description
27
+ # Description of the coupon
28
+ #
29
+ # @return [String, nil]
30
+ required :description, String, nil?: true
31
+
32
+ # @!attribute duration_in_months
33
+ # Duration of the coupon validity in months
34
+ #
35
+ # @return [Integer, nil]
36
+ required :duration_in_months, Integer, api_name: :durationInMonths, nil?: true
37
+
38
+ # @!attribute name
39
+ # Name of the coupon
40
+ #
41
+ # @return [String]
42
+ required :name, String
43
+
44
+ # @!attribute percent_off
45
+ # Percentage discount off the original price
46
+ #
47
+ # @return [Float, nil]
48
+ required :percent_off, Float, api_name: :percentOff, nil?: true
49
+
50
+ # @!attribute additional_meta_data
51
+ # Metadata associated with the entity
52
+ #
53
+ # @return [Object, nil]
54
+ optional :additional_meta_data, Stigg::Internal::Type::Unknown, api_name: :additionalMetaData
55
+
56
+ # @!method initialize(id:, amounts_off:, description:, duration_in_months:, name:, percent_off:, additional_meta_data: nil, request_options: {})
57
+ # @param id [String] The unique identifier for the entity
58
+ #
59
+ # @param amounts_off [Array<Stigg::Models::V1::CouponCreateParams::AmountsOff>, nil] Fixed amount discounts in different currencies
60
+ #
61
+ # @param description [String, nil] Description of the coupon
62
+ #
63
+ # @param duration_in_months [Integer, nil] Duration of the coupon validity in months
64
+ #
65
+ # @param name [String] Name of the coupon
66
+ #
67
+ # @param percent_off [Float, nil] Percentage discount off the original price
68
+ #
69
+ # @param additional_meta_data [Object] Metadata associated with the entity
70
+ #
71
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
72
+
73
+ class AmountsOff < Stigg::Internal::Type::BaseModel
74
+ # @!attribute amount
75
+ # The price amount
76
+ #
77
+ # @return [Float]
78
+ required :amount, Float
79
+
80
+ # @!attribute currency
81
+ # The price currency
82
+ #
83
+ # @return [Symbol, Stigg::Models::V1::CouponCreateParams::AmountsOff::Currency]
84
+ required :currency, enum: -> { Stigg::V1::CouponCreateParams::AmountsOff::Currency }
85
+
86
+ # @!method initialize(amount:, currency:)
87
+ # @param amount [Float] The price amount
88
+ #
89
+ # @param currency [Symbol, Stigg::Models::V1::CouponCreateParams::AmountsOff::Currency] The price currency
90
+
91
+ # The price currency
92
+ #
93
+ # @see Stigg::Models::V1::CouponCreateParams::AmountsOff#currency
94
+ module Currency
95
+ extend Stigg::Internal::Type::Enum
96
+
97
+ USD = :usd
98
+ AED = :aed
99
+ ALL = :all
100
+ AMD = :amd
101
+ ANG = :ang
102
+ AUD = :aud
103
+ AWG = :awg
104
+ AZN = :azn
105
+ BAM = :bam
106
+ BBD = :bbd
107
+ BDT = :bdt
108
+ BGN = :bgn
109
+ BIF = :bif
110
+ BMD = :bmd
111
+ BND = :bnd
112
+ BSD = :bsd
113
+ BWP = :bwp
114
+ BYN = :byn
115
+ BZD = :bzd
116
+ BRL = :brl
117
+ CAD = :cad
118
+ CDF = :cdf
119
+ CHF = :chf
120
+ CNY = :cny
121
+ CZK = :czk
122
+ DKK = :dkk
123
+ DOP = :dop
124
+ DZD = :dzd
125
+ EGP = :egp
126
+ ETB = :etb
127
+ EUR = :eur
128
+ FJD = :fjd
129
+ GBP = :gbp
130
+ GEL = :gel
131
+ GIP = :gip
132
+ GMD = :gmd
133
+ GYD = :gyd
134
+ HKD = :hkd
135
+ HRK = :hrk
136
+ HTG = :htg
137
+ IDR = :idr
138
+ ILS = :ils
139
+ INR = :inr
140
+ ISK = :isk
141
+ JMD = :jmd
142
+ JPY = :jpy
143
+ KES = :kes
144
+ KGS = :kgs
145
+ KHR = :khr
146
+ KMF = :kmf
147
+ KRW = :krw
148
+ KYD = :kyd
149
+ KZT = :kzt
150
+ LBP = :lbp
151
+ LKR = :lkr
152
+ LRD = :lrd
153
+ LSL = :lsl
154
+ MAD = :mad
155
+ MDL = :mdl
156
+ MGA = :mga
157
+ MKD = :mkd
158
+ MMK = :mmk
159
+ MNT = :mnt
160
+ MOP = :mop
161
+ MRO = :mro
162
+ MVR = :mvr
163
+ MWK = :mwk
164
+ MXN = :mxn
165
+ MYR = :myr
166
+ MZN = :mzn
167
+ NAD = :nad
168
+ NGN = :ngn
169
+ NOK = :nok
170
+ NPR = :npr
171
+ NZD = :nzd
172
+ PGK = :pgk
173
+ PHP = :php
174
+ PKR = :pkr
175
+ PLN = :pln
176
+ QAR = :qar
177
+ RON = :ron
178
+ RSD = :rsd
179
+ RUB = :rub
180
+ RWF = :rwf
181
+ SAR = :sar
182
+ SBD = :sbd
183
+ SCR = :scr
184
+ SEK = :sek
185
+ SGD = :sgd
186
+ SLE = :sle
187
+ SLL = :sll
188
+ SOS = :sos
189
+ SZL = :szl
190
+ THB = :thb
191
+ TJS = :tjs
192
+ TOP = :top
193
+ TRY = :try
194
+ TTD = :ttd
195
+ TZS = :tzs
196
+ UAH = :uah
197
+ UZS = :uzs
198
+ VND = :vnd
199
+ VUV = :vuv
200
+ WST = :wst
201
+ XAF = :xaf
202
+ XCD = :xcd
203
+ YER = :yer
204
+ ZAR = :zar
205
+ ZMW = :zmw
206
+ CLP = :clp
207
+ DJF = :djf
208
+ GNF = :gnf
209
+ UGX = :ugx
210
+ PYG = :pyg
211
+ XOF = :xof
212
+ XPF = :xpf
213
+
214
+ # @!method self.values
215
+ # @return [Array<Symbol>]
216
+ end
217
+ end
218
+ end
219
+ end
220
+ end
221
+ end
@@ -0,0 +1,317 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ # @see Stigg::Resources::V1::Coupons#create
7
+ class CouponCreateResponse < Stigg::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ #
10
+ # @return [Stigg::Models::V1::CouponCreateResponse::Data]
11
+ required :data, -> { Stigg::Models::V1::CouponCreateResponse::Data }
12
+
13
+ # @!method initialize(data:)
14
+ # @param data [Stigg::Models::V1::CouponCreateResponse::Data]
15
+
16
+ # @see Stigg::Models::V1::CouponCreateResponse#data
17
+ class Data < Stigg::Internal::Type::BaseModel
18
+ # @!attribute id
19
+ # The unique identifier for the entity
20
+ #
21
+ # @return [String]
22
+ required :id, String
23
+
24
+ # @!attribute amounts_off
25
+ # Fixed amount discounts in different currencies
26
+ #
27
+ # @return [Array<Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff>, nil]
28
+ required :amounts_off,
29
+ -> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff] },
30
+ api_name: :amountsOff,
31
+ nil?: true
32
+
33
+ # @!attribute billing_id
34
+ # The unique identifier for the entity in the billing provider
35
+ #
36
+ # @return [String, nil]
37
+ required :billing_id, String, api_name: :billingId, nil?: true
38
+
39
+ # @!attribute billing_link_url
40
+ # The URL to the entity in the billing provider
41
+ #
42
+ # @return [String, nil]
43
+ required :billing_link_url, String, api_name: :billingLinkUrl, nil?: true
44
+
45
+ # @!attribute created_at
46
+ # Timestamp of when the record was created
47
+ #
48
+ # @return [Time]
49
+ required :created_at, Time, api_name: :createdAt
50
+
51
+ # @!attribute description
52
+ # Description of the coupon
53
+ #
54
+ # @return [String, nil]
55
+ required :description, String, nil?: true
56
+
57
+ # @!attribute duration_in_months
58
+ # Duration of the coupon validity in months
59
+ #
60
+ # @return [Float, nil]
61
+ required :duration_in_months, Float, api_name: :durationInMonths, nil?: true
62
+
63
+ # @!attribute name
64
+ # Name of the coupon
65
+ #
66
+ # @return [String]
67
+ required :name, String
68
+
69
+ # @!attribute percent_off
70
+ # Percentage discount off the original price
71
+ #
72
+ # @return [Float, nil]
73
+ required :percent_off, Float, api_name: :percentOff, nil?: true
74
+
75
+ # @!attribute source
76
+ # The source of the coupon
77
+ #
78
+ # @return [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::Source, nil]
79
+ required :source, enum: -> { Stigg::Models::V1::CouponCreateResponse::Data::Source }, nil?: true
80
+
81
+ # @!attribute status
82
+ # Current status of the coupon
83
+ #
84
+ # @return [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::Status]
85
+ required :status, enum: -> { Stigg::Models::V1::CouponCreateResponse::Data::Status }
86
+
87
+ # @!attribute type
88
+ # Type of the coupon (percentage or fixed amount)
89
+ #
90
+ # @return [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::Type]
91
+ required :type, enum: -> { Stigg::Models::V1::CouponCreateResponse::Data::Type }
92
+
93
+ # @!attribute updated_at
94
+ # Timestamp of when the record was last updated
95
+ #
96
+ # @return [Time]
97
+ required :updated_at, Time, api_name: :updatedAt
98
+
99
+ # @!method initialize(id:, amounts_off:, billing_id:, billing_link_url:, created_at:, description:, duration_in_months:, name:, percent_off:, source:, status:, type:, updated_at:)
100
+ # @param id [String] The unique identifier for the entity
101
+ #
102
+ # @param amounts_off [Array<Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff>, nil] Fixed amount discounts in different currencies
103
+ #
104
+ # @param billing_id [String, nil] The unique identifier for the entity in the billing provider
105
+ #
106
+ # @param billing_link_url [String, nil] The URL to the entity in the billing provider
107
+ #
108
+ # @param created_at [Time] Timestamp of when the record was created
109
+ #
110
+ # @param description [String, nil] Description of the coupon
111
+ #
112
+ # @param duration_in_months [Float, nil] Duration of the coupon validity in months
113
+ #
114
+ # @param name [String] Name of the coupon
115
+ #
116
+ # @param percent_off [Float, nil] Percentage discount off the original price
117
+ #
118
+ # @param source [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::Source, nil] The source of the coupon
119
+ #
120
+ # @param status [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::Status] Current status of the coupon
121
+ #
122
+ # @param type [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::Type] Type of the coupon (percentage or fixed amount)
123
+ #
124
+ # @param updated_at [Time] Timestamp of when the record was last updated
125
+
126
+ class AmountsOff < Stigg::Internal::Type::BaseModel
127
+ # @!attribute amount
128
+ # The price amount
129
+ #
130
+ # @return [Float]
131
+ required :amount, Float
132
+
133
+ # @!attribute currency
134
+ # The price currency
135
+ #
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
140
+
141
+ # @!method initialize(amount:, currency:)
142
+ # @param amount [Float] The price amount
143
+ #
144
+ # @param currency [Symbol, Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff::Currency, nil] The price currency
145
+
146
+ # The price currency
147
+ #
148
+ # @see Stigg::Models::V1::CouponCreateResponse::Data::AmountsOff#currency
149
+ module Currency
150
+ extend Stigg::Internal::Type::Enum
151
+
152
+ USD = :usd
153
+ AED = :aed
154
+ ALL = :all
155
+ AMD = :amd
156
+ ANG = :ang
157
+ AUD = :aud
158
+ AWG = :awg
159
+ AZN = :azn
160
+ BAM = :bam
161
+ BBD = :bbd
162
+ BDT = :bdt
163
+ BGN = :bgn
164
+ BIF = :bif
165
+ BMD = :bmd
166
+ BND = :bnd
167
+ BSD = :bsd
168
+ BWP = :bwp
169
+ BYN = :byn
170
+ BZD = :bzd
171
+ BRL = :brl
172
+ CAD = :cad
173
+ CDF = :cdf
174
+ CHF = :chf
175
+ CNY = :cny
176
+ CZK = :czk
177
+ DKK = :dkk
178
+ DOP = :dop
179
+ DZD = :dzd
180
+ EGP = :egp
181
+ ETB = :etb
182
+ EUR = :eur
183
+ FJD = :fjd
184
+ GBP = :gbp
185
+ GEL = :gel
186
+ GIP = :gip
187
+ GMD = :gmd
188
+ GYD = :gyd
189
+ HKD = :hkd
190
+ HRK = :hrk
191
+ HTG = :htg
192
+ IDR = :idr
193
+ ILS = :ils
194
+ INR = :inr
195
+ ISK = :isk
196
+ JMD = :jmd
197
+ JPY = :jpy
198
+ KES = :kes
199
+ KGS = :kgs
200
+ KHR = :khr
201
+ KMF = :kmf
202
+ KRW = :krw
203
+ KYD = :kyd
204
+ KZT = :kzt
205
+ LBP = :lbp
206
+ LKR = :lkr
207
+ LRD = :lrd
208
+ LSL = :lsl
209
+ MAD = :mad
210
+ MDL = :mdl
211
+ MGA = :mga
212
+ MKD = :mkd
213
+ MMK = :mmk
214
+ MNT = :mnt
215
+ MOP = :mop
216
+ MRO = :mro
217
+ MVR = :mvr
218
+ MWK = :mwk
219
+ MXN = :mxn
220
+ MYR = :myr
221
+ MZN = :mzn
222
+ NAD = :nad
223
+ NGN = :ngn
224
+ NOK = :nok
225
+ NPR = :npr
226
+ NZD = :nzd
227
+ PGK = :pgk
228
+ PHP = :php
229
+ PKR = :pkr
230
+ PLN = :pln
231
+ QAR = :qar
232
+ RON = :ron
233
+ RSD = :rsd
234
+ RUB = :rub
235
+ RWF = :rwf
236
+ SAR = :sar
237
+ SBD = :sbd
238
+ SCR = :scr
239
+ SEK = :sek
240
+ SGD = :sgd
241
+ SLE = :sle
242
+ SLL = :sll
243
+ SOS = :sos
244
+ SZL = :szl
245
+ THB = :thb
246
+ TJS = :tjs
247
+ TOP = :top
248
+ TRY = :try
249
+ TTD = :ttd
250
+ TZS = :tzs
251
+ UAH = :uah
252
+ UZS = :uzs
253
+ VND = :vnd
254
+ VUV = :vuv
255
+ WST = :wst
256
+ XAF = :xaf
257
+ XCD = :xcd
258
+ YER = :yer
259
+ ZAR = :zar
260
+ ZMW = :zmw
261
+ CLP = :clp
262
+ DJF = :djf
263
+ GNF = :gnf
264
+ UGX = :ugx
265
+ PYG = :pyg
266
+ XOF = :xof
267
+ XPF = :xpf
268
+
269
+ # @!method self.values
270
+ # @return [Array<Symbol>]
271
+ end
272
+ end
273
+
274
+ # The source of the coupon
275
+ #
276
+ # @see Stigg::Models::V1::CouponCreateResponse::Data#source
277
+ module Source
278
+ extend Stigg::Internal::Type::Enum
279
+
280
+ STIGG = :STIGG
281
+ STIGG_ADHOC = :STIGG_ADHOC
282
+ STRIPE = :STRIPE
283
+
284
+ # @!method self.values
285
+ # @return [Array<Symbol>]
286
+ end
287
+
288
+ # Current status of the coupon
289
+ #
290
+ # @see Stigg::Models::V1::CouponCreateResponse::Data#status
291
+ module Status
292
+ extend Stigg::Internal::Type::Enum
293
+
294
+ ACTIVE = :ACTIVE
295
+ ARCHIVED = :ARCHIVED
296
+
297
+ # @!method self.values
298
+ # @return [Array<Symbol>]
299
+ end
300
+
301
+ # Type of the coupon (percentage or fixed amount)
302
+ #
303
+ # @see Stigg::Models::V1::CouponCreateResponse::Data#type
304
+ module Type
305
+ extend Stigg::Internal::Type::Enum
306
+
307
+ FIXED = :FIXED
308
+ PERCENTAGE = :PERCENTAGE
309
+
310
+ # @!method self.values
311
+ # @return [Array<Symbol>]
312
+ end
313
+ end
314
+ end
315
+ end
316
+ end
317
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ # @see Stigg::Resources::V1::Coupons#list
7
+ class CouponListParams < Stigg::Internal::Type::BaseModel
8
+ extend Stigg::Internal::Type::RequestParameters::Converter
9
+ include Stigg::Internal::Type::RequestParameters
10
+
11
+ # @!attribute ending_before
12
+ # Ending before this UUID for pagination
13
+ #
14
+ # @return [String, nil]
15
+ optional :ending_before, String
16
+
17
+ # @!attribute limit
18
+ # Items per page
19
+ #
20
+ # @return [Integer, nil]
21
+ optional :limit, Integer
22
+
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
31
+ #
32
+ # @param limit [Integer] Items per page
33
+ #
34
+ # @param starting_after [String] Starting after this UUID for pagination
35
+ #
36
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
37
+ end
38
+ end
39
+ end
40
+ end