dodopayments 2.3.0 → 2.4.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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/client.rb +0 -8
  5. data/lib/dodopayments/models/customer_delete_payment_method_params.rb +26 -0
  6. data/lib/dodopayments/models/dispute.rb +9 -1
  7. data/lib/dodopayments/models/dispute_list_response.rb +9 -1
  8. data/lib/dodopayments/models/get_dispute.rb +9 -1
  9. data/lib/dodopayments/models.rb +2 -18
  10. data/lib/dodopayments/resources/customers.rb +25 -0
  11. data/lib/dodopayments/resources/invoices/payments.rb +0 -18
  12. data/lib/dodopayments/version.rb +1 -1
  13. data/lib/dodopayments.rb +4 -29
  14. data/rbi/dodopayments/client.rbi +0 -6
  15. data/rbi/dodopayments/models/credit_entitlement_cart_response.rbi +4 -4
  16. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +2 -2
  17. data/rbi/dodopayments/models/{your_webhook_url_create_params.rbi → customer_delete_payment_method_params.rbi} +9 -19
  18. data/rbi/dodopayments/models/dispute.rbi +12 -4
  19. data/rbi/dodopayments/models/dispute_list_response.rbi +11 -3
  20. data/rbi/dodopayments/models/get_dispute.rbi +12 -4
  21. data/rbi/dodopayments/models/license_key.rbi +2 -2
  22. data/rbi/dodopayments/models/meter_cart_response_item.rbi +2 -2
  23. data/rbi/dodopayments/models/payment.rbi +12 -10
  24. data/rbi/dodopayments/models/refund.rbi +4 -4
  25. data/rbi/dodopayments/models/refund_list_item.rbi +4 -4
  26. data/rbi/dodopayments/models/subscription.rbi +10 -8
  27. data/rbi/dodopayments/models.rbi +3 -25
  28. data/rbi/dodopayments/resources/customers.rbi +16 -0
  29. data/rbi/dodopayments/resources/invoices/payments.rbi +0 -9
  30. data/sig/dodopayments/client.rbs +0 -4
  31. data/sig/dodopayments/models/{product_collection_update_images_params.rbs → customer_delete_payment_method_params.rbs} +9 -9
  32. data/sig/dodopayments/models/dispute.rbs +5 -0
  33. data/sig/dodopayments/models/dispute_list_response.rbs +8 -3
  34. data/sig/dodopayments/models/get_dispute.rbs +5 -0
  35. data/sig/dodopayments/models.rbs +2 -18
  36. data/sig/dodopayments/resources/customers.rbs +6 -0
  37. data/sig/dodopayments/resources/invoices/payments.rbs +0 -5
  38. metadata +4 -79
  39. data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +0 -22
  40. data/lib/dodopayments/models/product_collection_create_params.rb +0 -98
  41. data/lib/dodopayments/models/product_collection_create_response.rb +0 -226
  42. data/lib/dodopayments/models/product_collection_delete_params.rb +0 -20
  43. data/lib/dodopayments/models/product_collection_list_params.rb +0 -46
  44. data/lib/dodopayments/models/product_collection_list_response.rb +0 -65
  45. data/lib/dodopayments/models/product_collection_retrieve_params.rb +0 -20
  46. data/lib/dodopayments/models/product_collection_retrieve_response.rb +0 -226
  47. data/lib/dodopayments/models/product_collection_unarchive_params.rb +0 -20
  48. data/lib/dodopayments/models/product_collection_unarchive_response.rb +0 -33
  49. data/lib/dodopayments/models/product_collection_update_images_params.rb +0 -29
  50. data/lib/dodopayments/models/product_collection_update_images_response.rb +0 -25
  51. data/lib/dodopayments/models/product_collection_update_params.rb +0 -61
  52. data/lib/dodopayments/models/product_collections/group_create_params.rb +0 -71
  53. data/lib/dodopayments/models/product_collections/group_create_response.rb +0 -160
  54. data/lib/dodopayments/models/product_collections/group_delete_params.rb +0 -28
  55. data/lib/dodopayments/models/product_collections/group_update_params.rb +0 -59
  56. data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +0 -60
  57. data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +0 -136
  58. data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +0 -36
  59. data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +0 -47
  60. data/lib/dodopayments/models/your_webhook_url_create_params.rb +0 -32
  61. data/lib/dodopayments/resources/product_collections/groups/items.rb +0 -111
  62. data/lib/dodopayments/resources/product_collections/groups.rb +0 -109
  63. data/lib/dodopayments/resources/product_collections.rb +0 -179
  64. data/lib/dodopayments/resources/your_webhook_url.rb +0 -56
  65. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +0 -40
  66. data/rbi/dodopayments/models/product_collection_create_params.rbi +0 -180
  67. data/rbi/dodopayments/models/product_collection_create_response.rbi +0 -303
  68. data/rbi/dodopayments/models/product_collection_delete_params.rbi +0 -38
  69. data/rbi/dodopayments/models/product_collection_list_params.rbi +0 -82
  70. data/rbi/dodopayments/models/product_collection_list_response.rbi +0 -88
  71. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +0 -38
  72. data/rbi/dodopayments/models/product_collection_retrieve_response.rbi +0 -305
  73. data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +0 -38
  74. data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +0 -56
  75. data/rbi/dodopayments/models/product_collection_update_images_params.rbi +0 -52
  76. data/rbi/dodopayments/models/product_collection_update_images_response.rbi +0 -40
  77. data/rbi/dodopayments/models/product_collection_update_params.rbi +0 -84
  78. data/rbi/dodopayments/models/product_collections/group_create_params.rbi +0 -123
  79. data/rbi/dodopayments/models/product_collections/group_create_response.rbi +0 -204
  80. data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +0 -48
  81. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +0 -80
  82. data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +0 -113
  83. data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +0 -156
  84. data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +0 -55
  85. data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +0 -68
  86. data/rbi/dodopayments/resources/product_collections/groups/items.rbi +0 -83
  87. data/rbi/dodopayments/resources/product_collections/groups.rbi +0 -90
  88. data/rbi/dodopayments/resources/product_collections.rbi +0 -149
  89. data/rbi/dodopayments/resources/your_webhook_url.rbi +0 -53
  90. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +0 -25
  91. data/sig/dodopayments/models/product_collection_create_params.rbs +0 -80
  92. data/sig/dodopayments/models/product_collection_create_response.rbs +0 -179
  93. data/sig/dodopayments/models/product_collection_delete_params.rbs +0 -23
  94. data/sig/dodopayments/models/product_collection_list_params.rbs +0 -49
  95. data/sig/dodopayments/models/product_collection_list_response.rbs +0 -50
  96. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +0 -23
  97. data/sig/dodopayments/models/product_collection_retrieve_response.rbs +0 -179
  98. data/sig/dodopayments/models/product_collection_unarchive_params.rbs +0 -23
  99. data/sig/dodopayments/models/product_collection_unarchive_response.rbs +0 -30
  100. data/sig/dodopayments/models/product_collection_update_images_response.rbs +0 -16
  101. data/sig/dodopayments/models/product_collection_update_params.rbs +0 -51
  102. data/sig/dodopayments/models/product_collections/group_create_params.rbs +0 -55
  103. data/sig/dodopayments/models/product_collections/group_create_response.rbs +0 -129
  104. data/sig/dodopayments/models/product_collections/group_delete_params.rbs +0 -30
  105. data/sig/dodopayments/models/product_collections/group_update_params.rbs +0 -48
  106. data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +0 -52
  107. data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +0 -104
  108. data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +0 -36
  109. data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +0 -40
  110. data/sig/dodopayments/models/your_webhook_url_create_params.rbs +0 -42
  111. data/sig/dodopayments/resources/product_collections/groups/items.rbs +0 -33
  112. data/sig/dodopayments/resources/product_collections/groups.rbs +0 -34
  113. data/sig/dodopayments/resources/product_collections.rbs +0 -56
  114. data/sig/dodopayments/resources/your_webhook_url.rbs +0 -18
@@ -1,109 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Dodopayments
4
- module Resources
5
- class ProductCollections
6
- class Groups
7
- # @return [Dodopayments::Resources::ProductCollections::Groups::Items]
8
- attr_reader :items
9
-
10
- # Some parameter documentations has been truncated, see
11
- # {Dodopayments::Models::ProductCollections::GroupCreateParams} for more details.
12
- #
13
- # @overload create(id, products:, group_name: nil, status: nil, request_options: {})
14
- #
15
- # @param id [String] Product Collection Id
16
- #
17
- # @param products [Array<Dodopayments::Models::ProductCollections::GroupCreateParams::Product>] Products in this group
18
- #
19
- # @param group_name [String, nil] Optional group name. Multiple groups can have null names, but named groups must
20
- #
21
- # @param status [Boolean, nil] Status of the group (defaults to true if not provided)
22
- #
23
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
24
- #
25
- # @return [Dodopayments::Models::ProductCollections::GroupCreateResponse]
26
- #
27
- # @see Dodopayments::Models::ProductCollections::GroupCreateParams
28
- def create(id, params)
29
- parsed, options = Dodopayments::ProductCollections::GroupCreateParams.dump_request(params)
30
- @client.request(
31
- method: :post,
32
- path: ["product-collections/%1$s/groups", id],
33
- body: parsed,
34
- model: Dodopayments::Models::ProductCollections::GroupCreateResponse,
35
- options: options
36
- )
37
- end
38
-
39
- # Some parameter documentations has been truncated, see
40
- # {Dodopayments::Models::ProductCollections::GroupUpdateParams} for more details.
41
- #
42
- # @overload update(group_id, id:, group_name: nil, product_order: nil, status: nil, request_options: {})
43
- #
44
- # @param group_id [String] Path param: Product Collection Group Id
45
- #
46
- # @param id [String] Path param: Product Collection Id
47
- #
48
- # @param group_name [String, nil] Body param: Optional group name update: Some(Some(name)) = set name, Some(None)
49
- #
50
- # @param product_order [Array<String>, nil] Body param: Optional new order for products in this group (array of product_coll
51
- #
52
- # @param status [Boolean, nil] Body param: Optional status update
53
- #
54
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
55
- #
56
- # @return [nil]
57
- #
58
- # @see Dodopayments::Models::ProductCollections::GroupUpdateParams
59
- def update(group_id, params)
60
- parsed, options = Dodopayments::ProductCollections::GroupUpdateParams.dump_request(params)
61
- id =
62
- parsed.delete(:id) do
63
- raise ArgumentError.new("missing required path argument #{_1}")
64
- end
65
- @client.request(
66
- method: :patch,
67
- path: ["product-collections/%1$s/groups/%2$s", id, group_id],
68
- body: parsed,
69
- model: NilClass,
70
- options: options
71
- )
72
- end
73
-
74
- # @overload delete(group_id, id:, request_options: {})
75
- #
76
- # @param group_id [String] Product Collection Group Id
77
- #
78
- # @param id [String] Product Collection Id
79
- #
80
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
81
- #
82
- # @return [nil]
83
- #
84
- # @see Dodopayments::Models::ProductCollections::GroupDeleteParams
85
- def delete(group_id, params)
86
- parsed, options = Dodopayments::ProductCollections::GroupDeleteParams.dump_request(params)
87
- id =
88
- parsed.delete(:id) do
89
- raise ArgumentError.new("missing required path argument #{_1}")
90
- end
91
- @client.request(
92
- method: :delete,
93
- path: ["product-collections/%1$s/groups/%2$s", id, group_id],
94
- model: NilClass,
95
- options: options
96
- )
97
- end
98
-
99
- # @api private
100
- #
101
- # @param client [Dodopayments::Client]
102
- def initialize(client:)
103
- @client = client
104
- @items = Dodopayments::Resources::ProductCollections::Groups::Items.new(client: client)
105
- end
106
- end
107
- end
108
- end
109
- end
@@ -1,179 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Dodopayments
4
- module Resources
5
- class ProductCollections
6
- # @return [Dodopayments::Resources::ProductCollections::Groups]
7
- attr_reader :groups
8
-
9
- # @overload create(groups:, name:, brand_id: nil, description: nil, request_options: {})
10
- #
11
- # @param groups [Array<Dodopayments::Models::ProductCollectionCreateParams::Group>] Groups of products in this collection
12
- #
13
- # @param name [String] Name of the product collection
14
- #
15
- # @param brand_id [String, nil] Brand id for the collection, if not provided will default to primary brand
16
- #
17
- # @param description [String, nil] Optional description of the product collection
18
- #
19
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
20
- #
21
- # @return [Dodopayments::Models::ProductCollectionCreateResponse]
22
- #
23
- # @see Dodopayments::Models::ProductCollectionCreateParams
24
- def create(params)
25
- parsed, options = Dodopayments::ProductCollectionCreateParams.dump_request(params)
26
- @client.request(
27
- method: :post,
28
- path: "product-collections",
29
- body: parsed,
30
- model: Dodopayments::Models::ProductCollectionCreateResponse,
31
- options: options
32
- )
33
- end
34
-
35
- # @overload retrieve(id, request_options: {})
36
- #
37
- # @param id [String] Product Collection Id
38
- #
39
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
40
- #
41
- # @return [Dodopayments::Models::ProductCollectionRetrieveResponse]
42
- #
43
- # @see Dodopayments::Models::ProductCollectionRetrieveParams
44
- def retrieve(id, params = {})
45
- @client.request(
46
- method: :get,
47
- path: ["product-collections/%1$s", id],
48
- model: Dodopayments::Models::ProductCollectionRetrieveResponse,
49
- options: params[:request_options]
50
- )
51
- end
52
-
53
- # @overload update(id, brand_id: nil, description: nil, group_order: nil, image_id: nil, name: nil, request_options: {})
54
- #
55
- # @param id [String] Product Collection Id
56
- #
57
- # @param brand_id [String, nil] Optional brand_id update
58
- #
59
- # @param description [String, nil] Optional description update - pass null to remove, omit to keep unchanged
60
- #
61
- # @param group_order [Array<String>, nil] Optional new order for groups (array of group UUIDs in desired order)
62
- #
63
- # @param image_id [String, nil] Optional image update - pass null to remove, omit to keep unchanged
64
- #
65
- # @param name [String, nil] Optional new name for the collection
66
- #
67
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
68
- #
69
- # @return [nil]
70
- #
71
- # @see Dodopayments::Models::ProductCollectionUpdateParams
72
- def update(id, params = {})
73
- parsed, options = Dodopayments::ProductCollectionUpdateParams.dump_request(params)
74
- @client.request(
75
- method: :patch,
76
- path: ["product-collections/%1$s", id],
77
- body: parsed,
78
- model: NilClass,
79
- options: options
80
- )
81
- end
82
-
83
- # @overload list(archived: nil, brand_id: nil, page_number: nil, page_size: nil, request_options: {})
84
- #
85
- # @param archived [Boolean] List archived collections
86
- #
87
- # @param brand_id [String] Filter by Brand id
88
- #
89
- # @param page_number [Integer] Page number default is 0
90
- #
91
- # @param page_size [Integer] Page size default is 10 max is 100
92
- #
93
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
94
- #
95
- # @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::ProductCollectionListResponse>]
96
- #
97
- # @see Dodopayments::Models::ProductCollectionListParams
98
- def list(params = {})
99
- parsed, options = Dodopayments::ProductCollectionListParams.dump_request(params)
100
- query = Dodopayments::Internal::Util.encode_query_params(parsed)
101
- @client.request(
102
- method: :get,
103
- path: "product-collections",
104
- query: query,
105
- page: Dodopayments::Internal::DefaultPageNumberPagination,
106
- model: Dodopayments::Models::ProductCollectionListResponse,
107
- options: options
108
- )
109
- end
110
-
111
- # @overload delete(id, request_options: {})
112
- #
113
- # @param id [String] Product Collection Id
114
- #
115
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
116
- #
117
- # @return [nil]
118
- #
119
- # @see Dodopayments::Models::ProductCollectionDeleteParams
120
- def delete(id, params = {})
121
- @client.request(
122
- method: :delete,
123
- path: ["product-collections/%1$s", id],
124
- model: NilClass,
125
- options: params[:request_options]
126
- )
127
- end
128
-
129
- # @overload unarchive(id, request_options: {})
130
- #
131
- # @param id [String] Product Collection Id
132
- #
133
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
134
- #
135
- # @return [Dodopayments::Models::ProductCollectionUnarchiveResponse]
136
- #
137
- # @see Dodopayments::Models::ProductCollectionUnarchiveParams
138
- def unarchive(id, params = {})
139
- @client.request(
140
- method: :post,
141
- path: ["product-collections/%1$s/unarchive", id],
142
- model: Dodopayments::Models::ProductCollectionUnarchiveResponse,
143
- options: params[:request_options]
144
- )
145
- end
146
-
147
- # @overload update_images(id, force_update: nil, request_options: {})
148
- #
149
- # @param id [String] Product Collection Id
150
- #
151
- # @param force_update [Boolean, nil] If true, generates a new image ID to force cache invalidation
152
- #
153
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
154
- #
155
- # @return [Dodopayments::Models::ProductCollectionUpdateImagesResponse]
156
- #
157
- # @see Dodopayments::Models::ProductCollectionUpdateImagesParams
158
- def update_images(id, params = {})
159
- parsed, options = Dodopayments::ProductCollectionUpdateImagesParams.dump_request(params)
160
- query = Dodopayments::Internal::Util.encode_query_params(parsed)
161
- @client.request(
162
- method: :put,
163
- path: ["product-collections/%1$s/images", id],
164
- query: query,
165
- model: Dodopayments::Models::ProductCollectionUpdateImagesResponse,
166
- options: options
167
- )
168
- end
169
-
170
- # @api private
171
- #
172
- # @param client [Dodopayments::Client]
173
- def initialize(client:)
174
- @client = client
175
- @groups = Dodopayments::Resources::ProductCollections::Groups.new(client: client)
176
- end
177
- end
178
- end
179
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Dodopayments
4
- module Resources
5
- class YourWebhookURL
6
- # Some parameter documentations has been truncated, see
7
- # {Dodopayments::Models::YourWebhookURLCreateParams} for more details.
8
- #
9
- # @overload create(business_id:, data:, timestamp:, type:, webhook_id:, webhook_signature:, webhook_timestamp:, request_options: {})
10
- #
11
- # @param business_id [String] Body param
12
- #
13
- # @param data [Dodopayments::Models::WebhookPayload::Data::Payment, Dodopayments::Models::WebhookPayload::Data::Subscription, Dodopayments::Models::WebhookPayload::Data::Refund, Dodopayments::Models::WebhookPayload::Data::Dispute, Dodopayments::Models::WebhookPayload::Data::LicenseKey, Dodopayments::Models::WebhookPayload::Data::CreditLedgerEntry, Dodopayments::Models::WebhookPayload::Data::CreditBalanceLow] Body param: The latest data at the time of delivery attempt
14
- #
15
- # @param timestamp [Time] Body param: The timestamp of when the event occurred (not necessarily the same o
16
- #
17
- # @param type [Symbol, Dodopayments::Models::WebhookEventType] Body param: Event types for Dodo events
18
- #
19
- # @param webhook_id [String] Header param: Unique identifier for the webhook
20
- #
21
- # @param webhook_signature [String] Header param: Signature of the Webhook
22
- #
23
- # @param webhook_timestamp [String] Header param: Unix timestamp when the webhook was sent
24
- #
25
- # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
26
- #
27
- # @return [nil]
28
- #
29
- # @see Dodopayments::Models::YourWebhookURLCreateParams
30
- def create(params)
31
- parsed, options = Dodopayments::YourWebhookURLCreateParams.dump_request(params)
32
- header_params =
33
- {
34
- webhook_id: "webhook-id",
35
- webhook_signature: "webhook-signature",
36
- webhook_timestamp: "webhook-timestamp"
37
- }
38
- @client.request(
39
- method: :post,
40
- path: "your-webhook-url",
41
- headers: parsed.slice(*header_params.keys).transform_keys(header_params),
42
- body: parsed.except(*header_params.keys),
43
- model: NilClass,
44
- options: options
45
- )
46
- end
47
-
48
- # @api private
49
- #
50
- # @param client [Dodopayments::Client]
51
- def initialize(client:)
52
- @client = client
53
- end
54
- end
55
- end
56
- end
@@ -1,40 +0,0 @@
1
- # typed: strong
2
-
3
- module Dodopayments
4
- module Models
5
- module Invoices
6
- class PaymentRetrievePayoutParams < Dodopayments::Internal::Type::BaseModel
7
- extend Dodopayments::Internal::Type::RequestParameters::Converter
8
- include Dodopayments::Internal::Type::RequestParameters
9
-
10
- OrHash =
11
- T.type_alias do
12
- T.any(
13
- Dodopayments::Invoices::PaymentRetrievePayoutParams,
14
- Dodopayments::Internal::AnyHash
15
- )
16
- end
17
-
18
- sig { returns(String) }
19
- attr_accessor :payout_id
20
-
21
- sig do
22
- params(
23
- payout_id: String,
24
- request_options: Dodopayments::RequestOptions::OrHash
25
- ).returns(T.attached_class)
26
- end
27
- def self.new(payout_id:, request_options: {})
28
- end
29
-
30
- sig do
31
- override.returns(
32
- { payout_id: String, request_options: Dodopayments::RequestOptions }
33
- )
34
- end
35
- def to_hash
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,180 +0,0 @@
1
- # typed: strong
2
-
3
- module Dodopayments
4
- module Models
5
- class ProductCollectionCreateParams < Dodopayments::Internal::Type::BaseModel
6
- extend Dodopayments::Internal::Type::RequestParameters::Converter
7
- include Dodopayments::Internal::Type::RequestParameters
8
-
9
- OrHash =
10
- T.type_alias do
11
- T.any(
12
- Dodopayments::ProductCollectionCreateParams,
13
- Dodopayments::Internal::AnyHash
14
- )
15
- end
16
-
17
- # Groups of products in this collection
18
- sig do
19
- returns(T::Array[Dodopayments::ProductCollectionCreateParams::Group])
20
- end
21
- attr_accessor :groups
22
-
23
- # Name of the product collection
24
- sig { returns(String) }
25
- attr_accessor :name
26
-
27
- # Brand id for the collection, if not provided will default to primary brand
28
- sig { returns(T.nilable(String)) }
29
- attr_accessor :brand_id
30
-
31
- # Optional description of the product collection
32
- sig { returns(T.nilable(String)) }
33
- attr_accessor :description
34
-
35
- sig do
36
- params(
37
- groups:
38
- T::Array[
39
- Dodopayments::ProductCollectionCreateParams::Group::OrHash
40
- ],
41
- name: String,
42
- brand_id: T.nilable(String),
43
- description: T.nilable(String),
44
- request_options: Dodopayments::RequestOptions::OrHash
45
- ).returns(T.attached_class)
46
- end
47
- def self.new(
48
- # Groups of products in this collection
49
- groups:,
50
- # Name of the product collection
51
- name:,
52
- # Brand id for the collection, if not provided will default to primary brand
53
- brand_id: nil,
54
- # Optional description of the product collection
55
- description: nil,
56
- request_options: {}
57
- )
58
- end
59
-
60
- sig do
61
- override.returns(
62
- {
63
- groups:
64
- T::Array[Dodopayments::ProductCollectionCreateParams::Group],
65
- name: String,
66
- brand_id: T.nilable(String),
67
- description: T.nilable(String),
68
- request_options: Dodopayments::RequestOptions
69
- }
70
- )
71
- end
72
- def to_hash
73
- end
74
-
75
- class Group < Dodopayments::Internal::Type::BaseModel
76
- OrHash =
77
- T.type_alias do
78
- T.any(
79
- Dodopayments::ProductCollectionCreateParams::Group,
80
- Dodopayments::Internal::AnyHash
81
- )
82
- end
83
-
84
- # Products in this group
85
- sig do
86
- returns(
87
- T::Array[
88
- Dodopayments::ProductCollectionCreateParams::Group::Product
89
- ]
90
- )
91
- end
92
- attr_accessor :products
93
-
94
- # Optional group name. Multiple groups can have null names, but named groups must
95
- # be unique per collection
96
- sig { returns(T.nilable(String)) }
97
- attr_accessor :group_name
98
-
99
- # Status of the group (defaults to true if not provided)
100
- sig { returns(T.nilable(T::Boolean)) }
101
- attr_accessor :status
102
-
103
- sig do
104
- params(
105
- products:
106
- T::Array[
107
- Dodopayments::ProductCollectionCreateParams::Group::Product::OrHash
108
- ],
109
- group_name: T.nilable(String),
110
- status: T.nilable(T::Boolean)
111
- ).returns(T.attached_class)
112
- end
113
- def self.new(
114
- # Products in this group
115
- products:,
116
- # Optional group name. Multiple groups can have null names, but named groups must
117
- # be unique per collection
118
- group_name: nil,
119
- # Status of the group (defaults to true if not provided)
120
- status: nil
121
- )
122
- end
123
-
124
- sig do
125
- override.returns(
126
- {
127
- products:
128
- T::Array[
129
- Dodopayments::ProductCollectionCreateParams::Group::Product
130
- ],
131
- group_name: T.nilable(String),
132
- status: T.nilable(T::Boolean)
133
- }
134
- )
135
- end
136
- def to_hash
137
- end
138
-
139
- class Product < Dodopayments::Internal::Type::BaseModel
140
- OrHash =
141
- T.type_alias do
142
- T.any(
143
- Dodopayments::ProductCollectionCreateParams::Group::Product,
144
- Dodopayments::Internal::AnyHash
145
- )
146
- end
147
-
148
- # Product ID to include in the group
149
- sig { returns(String) }
150
- attr_accessor :product_id
151
-
152
- # Status of the product in this group (defaults to true if not provided)
153
- sig { returns(T.nilable(T::Boolean)) }
154
- attr_accessor :status
155
-
156
- sig do
157
- params(product_id: String, status: T.nilable(T::Boolean)).returns(
158
- T.attached_class
159
- )
160
- end
161
- def self.new(
162
- # Product ID to include in the group
163
- product_id:,
164
- # Status of the product in this group (defaults to true if not provided)
165
- status: nil
166
- )
167
- end
168
-
169
- sig do
170
- override.returns(
171
- { product_id: String, status: T.nilable(T::Boolean) }
172
- )
173
- end
174
- def to_hash
175
- end
176
- end
177
- end
178
- end
179
- end
180
- end