dodopayments 2.1.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.md +3 -3
  4. data/lib/dodopayments/client.rb +15 -0
  5. data/lib/dodopayments/models/checkout_session_customization.rb +4 -4
  6. data/lib/dodopayments/models/checkout_session_request.rb +10 -1
  7. data/lib/dodopayments/models/customer_retrieve_payment_methods_response.rb +13 -1
  8. data/lib/dodopayments/models/customers/customer_portal_create_params.rb +13 -1
  9. data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
  10. data/lib/dodopayments/models/payment_method_types.rb +3 -0
  11. data/lib/dodopayments/models/product_collection_create_params.rb +98 -0
  12. data/lib/dodopayments/models/product_collection_create_response.rb +226 -0
  13. data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
  14. data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
  15. data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
  16. data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
  17. data/lib/dodopayments/models/product_collection_retrieve_response.rb +226 -0
  18. data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
  19. data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
  20. data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
  21. data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
  22. data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
  23. data/lib/dodopayments/models/product_collections/group_create_params.rb +71 -0
  24. data/lib/dodopayments/models/product_collections/group_create_response.rb +160 -0
  25. data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
  26. data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
  27. data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +60 -0
  28. data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +136 -0
  29. data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
  30. data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
  31. data/lib/dodopayments/models/subscription.rb +107 -1
  32. data/lib/dodopayments/models/subscription_cancel_change_plan_params.rb +20 -0
  33. data/lib/dodopayments/models/subscription_list_response.rb +109 -1
  34. data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +10 -1
  35. data/lib/dodopayments/models/update_subscription_plan_req.rb +29 -1
  36. data/lib/dodopayments/models/your_webhook_url_create_params.rb +32 -0
  37. data/lib/dodopayments/models.rb +20 -0
  38. data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
  39. data/lib/dodopayments/resources/customers/customer_portal.rb +6 -1
  40. data/lib/dodopayments/resources/invoices/payments.rb +18 -0
  41. data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
  42. data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
  43. data/lib/dodopayments/resources/product_collections.rb +179 -0
  44. data/lib/dodopayments/resources/subscriptions.rb +24 -2
  45. data/lib/dodopayments/resources/webhooks.rb +11 -1
  46. data/lib/dodopayments/resources/your_webhook_url.rb +56 -0
  47. data/lib/dodopayments/version.rb +1 -1
  48. data/lib/dodopayments.rb +31 -3
  49. data/rbi/dodopayments/client.rbi +12 -0
  50. data/rbi/dodopayments/models/checkout_session_customization.rbi +12 -13
  51. data/rbi/dodopayments/models/checkout_session_request.rbi +10 -0
  52. data/rbi/dodopayments/models/credit_entitlement_cart_response.rbi +4 -4
  53. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +2 -2
  54. data/rbi/dodopayments/models/customer_retrieve_payment_methods_response.rbi +6 -0
  55. data/rbi/dodopayments/models/customers/customer_portal_create_params.rbi +13 -0
  56. data/rbi/dodopayments/models/dispute.rbi +4 -4
  57. data/rbi/dodopayments/models/get_dispute.rbi +4 -4
  58. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
  59. data/rbi/dodopayments/models/license_key.rbi +2 -2
  60. data/rbi/dodopayments/models/meter_cart_response_item.rbi +2 -2
  61. data/rbi/dodopayments/models/payment.rbi +10 -12
  62. data/rbi/dodopayments/models/payment_method_types.rbi +3 -0
  63. data/rbi/dodopayments/models/product_collection_create_params.rbi +180 -0
  64. data/rbi/dodopayments/models/product_collection_create_response.rbi +303 -0
  65. data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
  66. data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
  67. data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
  68. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
  69. data/rbi/dodopayments/models/product_collection_retrieve_response.rbi +305 -0
  70. data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
  71. data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
  72. data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
  73. data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
  74. data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
  75. data/rbi/dodopayments/models/product_collections/group_create_params.rbi +123 -0
  76. data/rbi/dodopayments/models/product_collections/group_create_response.rbi +204 -0
  77. data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
  78. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
  79. data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +113 -0
  80. data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +156 -0
  81. data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
  82. data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
  83. data/rbi/dodopayments/models/refund.rbi +4 -4
  84. data/rbi/dodopayments/models/refund_list_item.rbi +4 -4
  85. data/rbi/dodopayments/models/subscription.rbi +169 -10
  86. data/rbi/dodopayments/models/subscription_cancel_change_plan_params.rbi +41 -0
  87. data/rbi/dodopayments/models/subscription_list_response.rbi +179 -0
  88. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +12 -1
  89. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +70 -0
  90. data/rbi/dodopayments/models/your_webhook_url_create_params.rbi +56 -0
  91. data/rbi/dodopayments/models.rbi +28 -0
  92. data/rbi/dodopayments/resources/checkout_sessions.rbi +8 -0
  93. data/rbi/dodopayments/resources/customers/customer_portal.rbi +4 -0
  94. data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
  95. data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
  96. data/rbi/dodopayments/resources/product_collections/groups.rbi +90 -0
  97. data/rbi/dodopayments/resources/product_collections.rbi +149 -0
  98. data/rbi/dodopayments/resources/subscriptions.rbi +27 -0
  99. data/rbi/dodopayments/resources/webhooks.rbi +10 -2
  100. data/rbi/dodopayments/resources/your_webhook_url.rbi +53 -0
  101. data/sig/dodopayments/client.rbs +7 -0
  102. data/sig/dodopayments/models/checkout_session_customization.rbs +4 -8
  103. data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
  104. data/sig/dodopayments/models/customers/customer_portal_create_params.rbs +7 -1
  105. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
  106. data/sig/dodopayments/models/product_collection_create_params.rbs +80 -0
  107. data/sig/dodopayments/models/product_collection_create_response.rbs +179 -0
  108. data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
  109. data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
  110. data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
  111. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
  112. data/sig/dodopayments/models/product_collection_retrieve_response.rbs +179 -0
  113. data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
  114. data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
  115. data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
  116. data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
  117. data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
  118. data/sig/dodopayments/models/product_collections/group_create_params.rbs +55 -0
  119. data/sig/dodopayments/models/product_collections/group_create_response.rbs +129 -0
  120. data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
  121. data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
  122. data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +52 -0
  123. data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +104 -0
  124. data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
  125. data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
  126. data/sig/dodopayments/models/subscription.rbs +75 -0
  127. data/sig/dodopayments/models/subscription_cancel_change_plan_params.rbs +24 -0
  128. data/sig/dodopayments/models/subscription_list_response.rbs +75 -0
  129. data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +5 -0
  130. data/sig/dodopayments/models/update_subscription_plan_req.rbs +25 -1
  131. data/sig/dodopayments/models/your_webhook_url_create_params.rbs +42 -0
  132. data/sig/dodopayments/models.rbs +20 -0
  133. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
  134. data/sig/dodopayments/resources/customers/customer_portal.rbs +1 -0
  135. data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
  136. data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
  137. data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
  138. data/sig/dodopayments/resources/product_collections.rbs +56 -0
  139. data/sig/dodopayments/resources/subscriptions.rbs +7 -0
  140. data/sig/dodopayments/resources/webhooks.rbs +3 -1
  141. data/sig/dodopayments/resources/your_webhook_url.rbs +18 -0
  142. metadata +97 -2
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#list
6
+ class ProductCollectionListParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute archived
11
+ # List archived collections
12
+ #
13
+ # @return [Boolean, nil]
14
+ optional :archived, Dodopayments::Internal::Type::Boolean
15
+
16
+ # @!attribute brand_id
17
+ # Filter by Brand id
18
+ #
19
+ # @return [String, nil]
20
+ optional :brand_id, String
21
+
22
+ # @!attribute page_number
23
+ # Page number default is 0
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :page_number, Integer
27
+
28
+ # @!attribute page_size
29
+ # Page size default is 10 max is 100
30
+ #
31
+ # @return [Integer, nil]
32
+ optional :page_size, Integer
33
+
34
+ # @!method initialize(archived: nil, brand_id: nil, page_number: nil, page_size: nil, request_options: {})
35
+ # @param archived [Boolean] List archived collections
36
+ #
37
+ # @param brand_id [String] Filter by Brand id
38
+ #
39
+ # @param page_number [Integer] Page number default is 0
40
+ #
41
+ # @param page_size [Integer] Page size default is 10 max is 100
42
+ #
43
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#list
6
+ class ProductCollectionListResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # Collection ID
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute created_at
14
+ # Timestamp when created
15
+ #
16
+ # @return [Time]
17
+ required :created_at, Time
18
+
19
+ # @!attribute name
20
+ # Collection name
21
+ #
22
+ # @return [String]
23
+ required :name, String
24
+
25
+ # @!attribute products_count
26
+ # Number of products in the collection
27
+ #
28
+ # @return [Integer]
29
+ required :products_count, Integer
30
+
31
+ # @!attribute updated_at
32
+ # Timestamp when last updated
33
+ #
34
+ # @return [Time]
35
+ required :updated_at, Time
36
+
37
+ # @!attribute description
38
+ # Collection description
39
+ #
40
+ # @return [String, nil]
41
+ optional :description, String, nil?: true
42
+
43
+ # @!attribute image
44
+ # Collection image URL
45
+ #
46
+ # @return [String, nil]
47
+ optional :image, String, nil?: true
48
+
49
+ # @!method initialize(id:, created_at:, name:, products_count:, updated_at:, description: nil, image: nil)
50
+ # @param id [String] Collection ID
51
+ #
52
+ # @param created_at [Time] Timestamp when created
53
+ #
54
+ # @param name [String] Collection name
55
+ #
56
+ # @param products_count [Integer] Number of products in the collection
57
+ #
58
+ # @param updated_at [Time] Timestamp when last updated
59
+ #
60
+ # @param description [String, nil] Collection description
61
+ #
62
+ # @param image [String, nil] Collection image URL
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#retrieve
6
+ class ProductCollectionRetrieveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
17
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,226 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#retrieve
6
+ class ProductCollectionRetrieveResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # Unique identifier for the product collection
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute brand_id
14
+ # Brand ID for the collection
15
+ #
16
+ # @return [String]
17
+ required :brand_id, String
18
+
19
+ # @!attribute created_at
20
+ # Timestamp when the collection was created
21
+ #
22
+ # @return [Time]
23
+ required :created_at, Time
24
+
25
+ # @!attribute groups
26
+ # Groups in this collection
27
+ #
28
+ # @return [Array<Dodopayments::Models::ProductCollectionRetrieveResponse::Group>]
29
+ required :groups,
30
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::ProductCollectionRetrieveResponse::Group] }
31
+
32
+ # @!attribute name
33
+ # Name of the collection
34
+ #
35
+ # @return [String]
36
+ required :name, String
37
+
38
+ # @!attribute updated_at
39
+ # Timestamp when the collection was last updated
40
+ #
41
+ # @return [Time]
42
+ required :updated_at, Time
43
+
44
+ # @!attribute description
45
+ # Description of the collection
46
+ #
47
+ # @return [String, nil]
48
+ optional :description, String, nil?: true
49
+
50
+ # @!attribute image
51
+ # URL of the collection image
52
+ #
53
+ # @return [String, nil]
54
+ optional :image, String, nil?: true
55
+
56
+ # @!method initialize(id:, brand_id:, created_at:, groups:, name:, updated_at:, description: nil, image: nil)
57
+ # @param id [String] Unique identifier for the product collection
58
+ #
59
+ # @param brand_id [String] Brand ID for the collection
60
+ #
61
+ # @param created_at [Time] Timestamp when the collection was created
62
+ #
63
+ # @param groups [Array<Dodopayments::Models::ProductCollectionRetrieveResponse::Group>] Groups in this collection
64
+ #
65
+ # @param name [String] Name of the collection
66
+ #
67
+ # @param updated_at [Time] Timestamp when the collection was last updated
68
+ #
69
+ # @param description [String, nil] Description of the collection
70
+ #
71
+ # @param image [String, nil] URL of the collection image
72
+
73
+ class Group < Dodopayments::Internal::Type::BaseModel
74
+ # @!attribute group_id
75
+ #
76
+ # @return [String]
77
+ required :group_id, String
78
+
79
+ # @!attribute products
80
+ #
81
+ # @return [Array<Dodopayments::Models::ProductCollectionRetrieveResponse::Group::Product>]
82
+ required :products,
83
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::ProductCollectionRetrieveResponse::Group::Product] }
84
+
85
+ # @!attribute status
86
+ #
87
+ # @return [Boolean]
88
+ required :status, Dodopayments::Internal::Type::Boolean
89
+
90
+ # @!attribute group_name
91
+ #
92
+ # @return [String, nil]
93
+ optional :group_name, String, nil?: true
94
+
95
+ # @!method initialize(group_id:, products:, status:, group_name: nil)
96
+ # @param group_id [String]
97
+ # @param products [Array<Dodopayments::Models::ProductCollectionRetrieveResponse::Group::Product>]
98
+ # @param status [Boolean]
99
+ # @param group_name [String, nil]
100
+
101
+ class Product < Dodopayments::Internal::Type::BaseModel
102
+ # @!attribute id
103
+ #
104
+ # @return [String]
105
+ required :id, String
106
+
107
+ # @!attribute addons_count
108
+ #
109
+ # @return [Integer]
110
+ required :addons_count, Integer
111
+
112
+ # @!attribute files_count
113
+ #
114
+ # @return [Integer]
115
+ required :files_count, Integer
116
+
117
+ # @!attribute has_credit_entitlements
118
+ # Whether this product has any credit entitlements attached
119
+ #
120
+ # @return [Boolean]
121
+ required :has_credit_entitlements, Dodopayments::Internal::Type::Boolean
122
+
123
+ # @!attribute is_recurring
124
+ #
125
+ # @return [Boolean]
126
+ required :is_recurring, Dodopayments::Internal::Type::Boolean
127
+
128
+ # @!attribute license_key_enabled
129
+ #
130
+ # @return [Boolean]
131
+ required :license_key_enabled, Dodopayments::Internal::Type::Boolean
132
+
133
+ # @!attribute meters_count
134
+ #
135
+ # @return [Integer]
136
+ required :meters_count, Integer
137
+
138
+ # @!attribute product_id
139
+ #
140
+ # @return [String]
141
+ required :product_id, String
142
+
143
+ # @!attribute status
144
+ #
145
+ # @return [Boolean]
146
+ required :status, Dodopayments::Internal::Type::Boolean
147
+
148
+ # @!attribute currency
149
+ #
150
+ # @return [Symbol, Dodopayments::Models::Currency, nil]
151
+ optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
152
+
153
+ # @!attribute description
154
+ #
155
+ # @return [String, nil]
156
+ optional :description, String, nil?: true
157
+
158
+ # @!attribute name
159
+ #
160
+ # @return [String, nil]
161
+ optional :name, String, nil?: true
162
+
163
+ # @!attribute price
164
+ #
165
+ # @return [Integer, nil]
166
+ optional :price, Integer, nil?: true
167
+
168
+ # @!attribute price_detail
169
+ # One-time price details.
170
+ #
171
+ # @return [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil]
172
+ optional :price_detail, union: -> { Dodopayments::Price }, nil?: true
173
+
174
+ # @!attribute tax_category
175
+ # Represents the different categories of taxation applicable to various products
176
+ # and services.
177
+ #
178
+ # @return [Symbol, Dodopayments::Models::TaxCategory, nil]
179
+ optional :tax_category, enum: -> { Dodopayments::TaxCategory }, nil?: true
180
+
181
+ # @!attribute tax_inclusive
182
+ #
183
+ # @return [Boolean, nil]
184
+ optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
185
+
186
+ # @!method initialize(id:, addons_count:, files_count:, has_credit_entitlements:, is_recurring:, license_key_enabled:, meters_count:, product_id:, status:, currency: nil, description: nil, name: nil, price: nil, price_detail: nil, tax_category: nil, tax_inclusive: nil)
187
+ # Some parameter documentations has been truncated, see
188
+ # {Dodopayments::Models::ProductCollectionRetrieveResponse::Group::Product} for
189
+ # more details.
190
+ #
191
+ # @param id [String]
192
+ #
193
+ # @param addons_count [Integer]
194
+ #
195
+ # @param files_count [Integer]
196
+ #
197
+ # @param has_credit_entitlements [Boolean] Whether this product has any credit entitlements attached
198
+ #
199
+ # @param is_recurring [Boolean]
200
+ #
201
+ # @param license_key_enabled [Boolean]
202
+ #
203
+ # @param meters_count [Integer]
204
+ #
205
+ # @param product_id [String]
206
+ #
207
+ # @param status [Boolean]
208
+ #
209
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil]
210
+ #
211
+ # @param description [String, nil]
212
+ #
213
+ # @param name [String, nil]
214
+ #
215
+ # @param price [Integer, nil]
216
+ #
217
+ # @param price_detail [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] One-time price details.
218
+ #
219
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
220
+ #
221
+ # @param tax_inclusive [Boolean, nil]
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#unarchive
6
+ class ProductCollectionUnarchiveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!method initialize(id:, request_options: {})
16
+ # @param id [String]
17
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#unarchive
6
+ class ProductCollectionUnarchiveResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute collection_id
8
+ # Collection ID that was unarchived
9
+ #
10
+ # @return [String]
11
+ required :collection_id, String
12
+
13
+ # @!attribute excluded_product_ids
14
+ # Product IDs that were excluded because they are archived
15
+ #
16
+ # @return [Array<String>]
17
+ required :excluded_product_ids, Dodopayments::Internal::Type::ArrayOf[String]
18
+
19
+ # @!attribute message
20
+ # Success message
21
+ #
22
+ # @return [String]
23
+ required :message, String
24
+
25
+ # @!method initialize(collection_id:, excluded_product_ids:, message:)
26
+ # @param collection_id [String] Collection ID that was unarchived
27
+ #
28
+ # @param excluded_product_ids [Array<String>] Product IDs that were excluded because they are archived
29
+ #
30
+ # @param message [String] Success message
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#update_images
6
+ class ProductCollectionUpdateImagesParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute force_update
16
+ # If true, generates a new image ID to force cache invalidation
17
+ #
18
+ # @return [Boolean, nil]
19
+ optional :force_update, Dodopayments::Internal::Type::Boolean, nil?: true
20
+
21
+ # @!method initialize(id:, force_update: nil, request_options: {})
22
+ # @param id [String]
23
+ #
24
+ # @param force_update [Boolean, nil] If true, generates a new image ID to force cache invalidation
25
+ #
26
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#update_images
6
+ class ProductCollectionUpdateImagesResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute url
8
+ # Presigned S3 URL for uploading the image
9
+ #
10
+ # @return [String]
11
+ required :url, String
12
+
13
+ # @!attribute image_id
14
+ # Optional image ID (present when force_update is true)
15
+ #
16
+ # @return [String, nil]
17
+ optional :image_id, String, nil?: true
18
+
19
+ # @!method initialize(url:, image_id: nil)
20
+ # @param url [String] Presigned S3 URL for uploading the image
21
+ #
22
+ # @param image_id [String, nil] Optional image ID (present when force_update is true)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::ProductCollections#update
6
+ class ProductCollectionUpdateParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute brand_id
16
+ # Optional brand_id update
17
+ #
18
+ # @return [String, nil]
19
+ optional :brand_id, String, nil?: true
20
+
21
+ # @!attribute description
22
+ # Optional description update - pass null to remove, omit to keep unchanged
23
+ #
24
+ # @return [String, nil]
25
+ optional :description, String, nil?: true
26
+
27
+ # @!attribute group_order
28
+ # Optional new order for groups (array of group UUIDs in desired order)
29
+ #
30
+ # @return [Array<String>, nil]
31
+ optional :group_order, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
32
+
33
+ # @!attribute image_id
34
+ # Optional image update - pass null to remove, omit to keep unchanged
35
+ #
36
+ # @return [String, nil]
37
+ optional :image_id, String, nil?: true
38
+
39
+ # @!attribute name
40
+ # Optional new name for the collection
41
+ #
42
+ # @return [String, nil]
43
+ optional :name, String, nil?: true
44
+
45
+ # @!method initialize(id:, brand_id: nil, description: nil, group_order: nil, image_id: nil, name: nil, request_options: {})
46
+ # @param id [String]
47
+ #
48
+ # @param brand_id [String, nil] Optional brand_id update
49
+ #
50
+ # @param description [String, nil] Optional description update - pass null to remove, omit to keep unchanged
51
+ #
52
+ # @param group_order [Array<String>, nil] Optional new order for groups (array of group UUIDs in desired order)
53
+ #
54
+ # @param image_id [String, nil] Optional image update - pass null to remove, omit to keep unchanged
55
+ #
56
+ # @param name [String, nil] Optional new name for the collection
57
+ #
58
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ # @see Dodopayments::Resources::ProductCollections::Groups#create
7
+ class GroupCreateParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute products
17
+ # Products in this group
18
+ #
19
+ # @return [Array<Dodopayments::Models::ProductCollections::GroupCreateParams::Product>]
20
+ required :products,
21
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::GroupCreateParams::Product] }
22
+
23
+ # @!attribute group_name
24
+ # Optional group name. Multiple groups can have null names, but named groups must
25
+ # be unique per collection
26
+ #
27
+ # @return [String, nil]
28
+ optional :group_name, String, nil?: true
29
+
30
+ # @!attribute status
31
+ # Status of the group (defaults to true if not provided)
32
+ #
33
+ # @return [Boolean, nil]
34
+ optional :status, Dodopayments::Internal::Type::Boolean, nil?: true
35
+
36
+ # @!method initialize(id:, products:, group_name: nil, status: nil, request_options: {})
37
+ # Some parameter documentations has been truncated, see
38
+ # {Dodopayments::Models::ProductCollections::GroupCreateParams} for more details.
39
+ #
40
+ # @param id [String]
41
+ #
42
+ # @param products [Array<Dodopayments::Models::ProductCollections::GroupCreateParams::Product>] Products in this group
43
+ #
44
+ # @param group_name [String, nil] Optional group name. Multiple groups can have null names, but named groups must
45
+ #
46
+ # @param status [Boolean, nil] Status of the group (defaults to true if not provided)
47
+ #
48
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
49
+
50
+ class Product < Dodopayments::Internal::Type::BaseModel
51
+ # @!attribute product_id
52
+ # Product ID to include in the group
53
+ #
54
+ # @return [String]
55
+ required :product_id, String
56
+
57
+ # @!attribute status
58
+ # Status of the product in this group (defaults to true if not provided)
59
+ #
60
+ # @return [Boolean, nil]
61
+ optional :status, Dodopayments::Internal::Type::Boolean, nil?: true
62
+
63
+ # @!method initialize(product_id:, status: nil)
64
+ # @param product_id [String] Product ID to include in the group
65
+ #
66
+ # @param status [Boolean, nil] Status of the product in this group (defaults to true if not provided)
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end