dodopayments 2.2.0 → 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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +3 -3
  4. data/lib/dodopayments/client.rb +8 -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/your_webhook_url.rb +56 -0
  46. data/lib/dodopayments/version.rb +1 -1
  47. data/lib/dodopayments.rb +30 -3
  48. data/rbi/dodopayments/client.rbi +6 -0
  49. data/rbi/dodopayments/models/checkout_session_customization.rbi +12 -13
  50. data/rbi/dodopayments/models/checkout_session_request.rbi +10 -0
  51. data/rbi/dodopayments/models/credit_entitlement_cart_response.rbi +4 -4
  52. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +2 -2
  53. data/rbi/dodopayments/models/customer_retrieve_payment_methods_response.rbi +6 -0
  54. data/rbi/dodopayments/models/customers/customer_portal_create_params.rbi +13 -0
  55. data/rbi/dodopayments/models/dispute.rbi +4 -4
  56. data/rbi/dodopayments/models/get_dispute.rbi +4 -4
  57. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
  58. data/rbi/dodopayments/models/license_key.rbi +2 -2
  59. data/rbi/dodopayments/models/meter_cart_response_item.rbi +2 -2
  60. data/rbi/dodopayments/models/payment.rbi +10 -12
  61. data/rbi/dodopayments/models/payment_method_types.rbi +3 -0
  62. data/rbi/dodopayments/models/product_collection_create_params.rbi +180 -0
  63. data/rbi/dodopayments/models/product_collection_create_response.rbi +303 -0
  64. data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
  65. data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
  66. data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
  67. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
  68. data/rbi/dodopayments/models/product_collection_retrieve_response.rbi +305 -0
  69. data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
  70. data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
  71. data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
  72. data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
  73. data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
  74. data/rbi/dodopayments/models/product_collections/group_create_params.rbi +123 -0
  75. data/rbi/dodopayments/models/product_collections/group_create_response.rbi +204 -0
  76. data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
  77. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
  78. data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +113 -0
  79. data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +156 -0
  80. data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
  81. data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
  82. data/rbi/dodopayments/models/refund.rbi +4 -4
  83. data/rbi/dodopayments/models/refund_list_item.rbi +4 -4
  84. data/rbi/dodopayments/models/subscription.rbi +169 -10
  85. data/rbi/dodopayments/models/subscription_cancel_change_plan_params.rbi +41 -0
  86. data/rbi/dodopayments/models/subscription_list_response.rbi +179 -0
  87. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +12 -1
  88. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +70 -0
  89. data/rbi/dodopayments/models/your_webhook_url_create_params.rbi +56 -0
  90. data/rbi/dodopayments/models.rbi +28 -0
  91. data/rbi/dodopayments/resources/checkout_sessions.rbi +8 -0
  92. data/rbi/dodopayments/resources/customers/customer_portal.rbi +4 -0
  93. data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
  94. data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
  95. data/rbi/dodopayments/resources/product_collections/groups.rbi +90 -0
  96. data/rbi/dodopayments/resources/product_collections.rbi +149 -0
  97. data/rbi/dodopayments/resources/subscriptions.rbi +27 -0
  98. data/rbi/dodopayments/resources/your_webhook_url.rbi +53 -0
  99. data/sig/dodopayments/client.rbs +4 -0
  100. data/sig/dodopayments/models/checkout_session_customization.rbs +4 -8
  101. data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
  102. data/sig/dodopayments/models/customers/customer_portal_create_params.rbs +7 -1
  103. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
  104. data/sig/dodopayments/models/product_collection_create_params.rbs +80 -0
  105. data/sig/dodopayments/models/product_collection_create_response.rbs +179 -0
  106. data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
  107. data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
  108. data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
  109. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
  110. data/sig/dodopayments/models/product_collection_retrieve_response.rbs +179 -0
  111. data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
  112. data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
  113. data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
  114. data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
  115. data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
  116. data/sig/dodopayments/models/product_collections/group_create_params.rbs +55 -0
  117. data/sig/dodopayments/models/product_collections/group_create_response.rbs +129 -0
  118. data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
  119. data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
  120. data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +52 -0
  121. data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +104 -0
  122. data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
  123. data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
  124. data/sig/dodopayments/models/subscription.rbs +75 -0
  125. data/sig/dodopayments/models/subscription_cancel_change_plan_params.rbs +24 -0
  126. data/sig/dodopayments/models/subscription_list_response.rbs +75 -0
  127. data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +5 -0
  128. data/sig/dodopayments/models/update_subscription_plan_req.rbs +25 -1
  129. data/sig/dodopayments/models/your_webhook_url_create_params.rbs +42 -0
  130. data/sig/dodopayments/models.rbs +20 -0
  131. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
  132. data/sig/dodopayments/resources/customers/customer_portal.rbs +1 -0
  133. data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
  134. data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
  135. data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
  136. data/sig/dodopayments/resources/product_collections.rbs +56 -0
  137. data/sig/dodopayments/resources/subscriptions.rbs +7 -0
  138. data/sig/dodopayments/resources/your_webhook_url.rbs +18 -0
  139. metadata +83 -2
@@ -0,0 +1,160 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ # @see Dodopayments::Resources::ProductCollections::Groups#create
7
+ class GroupCreateResponse < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute group_id
9
+ #
10
+ # @return [String]
11
+ required :group_id, String
12
+
13
+ # @!attribute products
14
+ #
15
+ # @return [Array<Dodopayments::Models::ProductCollections::GroupCreateResponse::Product>]
16
+ required :products,
17
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::ProductCollections::GroupCreateResponse::Product] }
18
+
19
+ # @!attribute status
20
+ #
21
+ # @return [Boolean]
22
+ required :status, Dodopayments::Internal::Type::Boolean
23
+
24
+ # @!attribute group_name
25
+ #
26
+ # @return [String, nil]
27
+ optional :group_name, String, nil?: true
28
+
29
+ # @!method initialize(group_id:, products:, status:, group_name: nil)
30
+ # @param group_id [String]
31
+ # @param products [Array<Dodopayments::Models::ProductCollections::GroupCreateResponse::Product>]
32
+ # @param status [Boolean]
33
+ # @param group_name [String, nil]
34
+
35
+ class Product < Dodopayments::Internal::Type::BaseModel
36
+ # @!attribute id
37
+ #
38
+ # @return [String]
39
+ required :id, String
40
+
41
+ # @!attribute addons_count
42
+ #
43
+ # @return [Integer]
44
+ required :addons_count, Integer
45
+
46
+ # @!attribute files_count
47
+ #
48
+ # @return [Integer]
49
+ required :files_count, Integer
50
+
51
+ # @!attribute has_credit_entitlements
52
+ # Whether this product has any credit entitlements attached
53
+ #
54
+ # @return [Boolean]
55
+ required :has_credit_entitlements, Dodopayments::Internal::Type::Boolean
56
+
57
+ # @!attribute is_recurring
58
+ #
59
+ # @return [Boolean]
60
+ required :is_recurring, Dodopayments::Internal::Type::Boolean
61
+
62
+ # @!attribute license_key_enabled
63
+ #
64
+ # @return [Boolean]
65
+ required :license_key_enabled, Dodopayments::Internal::Type::Boolean
66
+
67
+ # @!attribute meters_count
68
+ #
69
+ # @return [Integer]
70
+ required :meters_count, Integer
71
+
72
+ # @!attribute product_id
73
+ #
74
+ # @return [String]
75
+ required :product_id, String
76
+
77
+ # @!attribute status
78
+ #
79
+ # @return [Boolean]
80
+ required :status, Dodopayments::Internal::Type::Boolean
81
+
82
+ # @!attribute currency
83
+ #
84
+ # @return [Symbol, Dodopayments::Models::Currency, nil]
85
+ optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
86
+
87
+ # @!attribute description
88
+ #
89
+ # @return [String, nil]
90
+ optional :description, String, nil?: true
91
+
92
+ # @!attribute name
93
+ #
94
+ # @return [String, nil]
95
+ optional :name, String, nil?: true
96
+
97
+ # @!attribute price
98
+ #
99
+ # @return [Integer, nil]
100
+ optional :price, Integer, nil?: true
101
+
102
+ # @!attribute price_detail
103
+ # One-time price details.
104
+ #
105
+ # @return [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil]
106
+ optional :price_detail, union: -> { Dodopayments::Price }, nil?: true
107
+
108
+ # @!attribute tax_category
109
+ # Represents the different categories of taxation applicable to various products
110
+ # and services.
111
+ #
112
+ # @return [Symbol, Dodopayments::Models::TaxCategory, nil]
113
+ optional :tax_category, enum: -> { Dodopayments::TaxCategory }, nil?: true
114
+
115
+ # @!attribute tax_inclusive
116
+ #
117
+ # @return [Boolean, nil]
118
+ optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
119
+
120
+ # @!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)
121
+ # Some parameter documentations has been truncated, see
122
+ # {Dodopayments::Models::ProductCollections::GroupCreateResponse::Product} for
123
+ # more details.
124
+ #
125
+ # @param id [String]
126
+ #
127
+ # @param addons_count [Integer]
128
+ #
129
+ # @param files_count [Integer]
130
+ #
131
+ # @param has_credit_entitlements [Boolean] Whether this product has any credit entitlements attached
132
+ #
133
+ # @param is_recurring [Boolean]
134
+ #
135
+ # @param license_key_enabled [Boolean]
136
+ #
137
+ # @param meters_count [Integer]
138
+ #
139
+ # @param product_id [String]
140
+ #
141
+ # @param status [Boolean]
142
+ #
143
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil]
144
+ #
145
+ # @param description [String, nil]
146
+ #
147
+ # @param name [String, nil]
148
+ #
149
+ # @param price [Integer, nil]
150
+ #
151
+ # @param price_detail [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] One-time price details.
152
+ #
153
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
154
+ #
155
+ # @param tax_inclusive [Boolean, nil]
156
+ end
157
+ end
158
+ end
159
+ end
160
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ # @see Dodopayments::Resources::ProductCollections::Groups#delete
7
+ class GroupDeleteParams < 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 group_id
17
+ #
18
+ # @return [String]
19
+ required :group_id, String
20
+
21
+ # @!method initialize(id:, group_id:, request_options: {})
22
+ # @param id [String]
23
+ # @param group_id [String]
24
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ # @see Dodopayments::Resources::ProductCollections::Groups#update
7
+ class GroupUpdateParams < 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 group_id
17
+ #
18
+ # @return [String]
19
+ required :group_id, String
20
+
21
+ # @!attribute group_name
22
+ # Optional group name update: Some(Some(name)) = set name, Some(None) = clear
23
+ # name, None = no change
24
+ #
25
+ # @return [String, nil]
26
+ optional :group_name, String, nil?: true
27
+
28
+ # @!attribute product_order
29
+ # Optional new order for products in this group (array of
30
+ # product_collection_group_pdts UUIDs)
31
+ #
32
+ # @return [Array<String>, nil]
33
+ optional :product_order, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
34
+
35
+ # @!attribute status
36
+ # Optional status update
37
+ #
38
+ # @return [Boolean, nil]
39
+ optional :status, Dodopayments::Internal::Type::Boolean, nil?: true
40
+
41
+ # @!method initialize(id:, group_id:, group_name: nil, product_order: nil, status: nil, request_options: {})
42
+ # Some parameter documentations has been truncated, see
43
+ # {Dodopayments::Models::ProductCollections::GroupUpdateParams} for more details.
44
+ #
45
+ # @param id [String]
46
+ #
47
+ # @param group_id [String]
48
+ #
49
+ # @param group_name [String, nil] Optional group name update: Some(Some(name)) = set name, Some(None) = clear name
50
+ #
51
+ # @param product_order [Array<String>, nil] Optional new order for products in this group (array of product_collection_group
52
+ #
53
+ # @param status [Boolean, nil] Optional status update
54
+ #
55
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ module Groups
7
+ # @see Dodopayments::Resources::ProductCollections::Groups::Items#create
8
+ class ItemCreateParams < Dodopayments::Internal::Type::BaseModel
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ # @!attribute id
13
+ #
14
+ # @return [String]
15
+ required :id, String
16
+
17
+ # @!attribute group_id
18
+ #
19
+ # @return [String]
20
+ required :group_id, String
21
+
22
+ # @!attribute products
23
+ # Products to add to the group
24
+ #
25
+ # @return [Array<Dodopayments::Models::ProductCollections::Groups::ItemCreateParams::Product>]
26
+ required :products,
27
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::Groups::ItemCreateParams::Product] }
28
+
29
+ # @!method initialize(id:, group_id:, products:, request_options: {})
30
+ # @param id [String]
31
+ #
32
+ # @param group_id [String]
33
+ #
34
+ # @param products [Array<Dodopayments::Models::ProductCollections::Groups::ItemCreateParams::Product>] Products to add to the group
35
+ #
36
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
37
+
38
+ class Product < Dodopayments::Internal::Type::BaseModel
39
+ # @!attribute product_id
40
+ # Product ID to include in the group
41
+ #
42
+ # @return [String]
43
+ required :product_id, String
44
+
45
+ # @!attribute status
46
+ # Status of the product in this group (defaults to true if not provided)
47
+ #
48
+ # @return [Boolean, nil]
49
+ optional :status, Dodopayments::Internal::Type::Boolean, nil?: true
50
+
51
+ # @!method initialize(product_id:, status: nil)
52
+ # @param product_id [String] Product ID to include in the group
53
+ #
54
+ # @param status [Boolean, nil] Status of the product in this group (defaults to true if not provided)
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,136 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ module Groups
7
+ class ItemCreateResponseItem < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute id
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute addons_count
14
+ #
15
+ # @return [Integer]
16
+ required :addons_count, Integer
17
+
18
+ # @!attribute files_count
19
+ #
20
+ # @return [Integer]
21
+ required :files_count, Integer
22
+
23
+ # @!attribute has_credit_entitlements
24
+ # Whether this product has any credit entitlements attached
25
+ #
26
+ # @return [Boolean]
27
+ required :has_credit_entitlements, Dodopayments::Internal::Type::Boolean
28
+
29
+ # @!attribute is_recurring
30
+ #
31
+ # @return [Boolean]
32
+ required :is_recurring, Dodopayments::Internal::Type::Boolean
33
+
34
+ # @!attribute license_key_enabled
35
+ #
36
+ # @return [Boolean]
37
+ required :license_key_enabled, Dodopayments::Internal::Type::Boolean
38
+
39
+ # @!attribute meters_count
40
+ #
41
+ # @return [Integer]
42
+ required :meters_count, Integer
43
+
44
+ # @!attribute product_id
45
+ #
46
+ # @return [String]
47
+ required :product_id, String
48
+
49
+ # @!attribute status
50
+ #
51
+ # @return [Boolean]
52
+ required :status, Dodopayments::Internal::Type::Boolean
53
+
54
+ # @!attribute currency
55
+ #
56
+ # @return [Symbol, Dodopayments::Models::Currency, nil]
57
+ optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
58
+
59
+ # @!attribute description
60
+ #
61
+ # @return [String, nil]
62
+ optional :description, String, nil?: true
63
+
64
+ # @!attribute name
65
+ #
66
+ # @return [String, nil]
67
+ optional :name, String, nil?: true
68
+
69
+ # @!attribute price
70
+ #
71
+ # @return [Integer, nil]
72
+ optional :price, Integer, nil?: true
73
+
74
+ # @!attribute price_detail
75
+ # One-time price details.
76
+ #
77
+ # @return [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil]
78
+ optional :price_detail, union: -> { Dodopayments::Price }, nil?: true
79
+
80
+ # @!attribute tax_category
81
+ # Represents the different categories of taxation applicable to various products
82
+ # and services.
83
+ #
84
+ # @return [Symbol, Dodopayments::Models::TaxCategory, nil]
85
+ optional :tax_category, enum: -> { Dodopayments::TaxCategory }, nil?: true
86
+
87
+ # @!attribute tax_inclusive
88
+ #
89
+ # @return [Boolean, nil]
90
+ optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
91
+
92
+ # @!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)
93
+ # Some parameter documentations has been truncated, see
94
+ # {Dodopayments::Models::ProductCollections::Groups::ItemCreateResponseItem} for
95
+ # more details.
96
+ #
97
+ # @param id [String]
98
+ #
99
+ # @param addons_count [Integer]
100
+ #
101
+ # @param files_count [Integer]
102
+ #
103
+ # @param has_credit_entitlements [Boolean] Whether this product has any credit entitlements attached
104
+ #
105
+ # @param is_recurring [Boolean]
106
+ #
107
+ # @param license_key_enabled [Boolean]
108
+ #
109
+ # @param meters_count [Integer]
110
+ #
111
+ # @param product_id [String]
112
+ #
113
+ # @param status [Boolean]
114
+ #
115
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil]
116
+ #
117
+ # @param description [String, nil]
118
+ #
119
+ # @param name [String, nil]
120
+ #
121
+ # @param price [Integer, nil]
122
+ #
123
+ # @param price_detail [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] One-time price details.
124
+ #
125
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
126
+ #
127
+ # @param tax_inclusive [Boolean, nil]
128
+ end
129
+
130
+ # @type [Dodopayments::Internal::Type::Converter]
131
+ ItemCreateResponse =
132
+ Dodopayments::Internal::Type::ArrayOf[-> { Dodopayments::Models::ProductCollections::Groups::ItemCreateResponseItem }]
133
+ end
134
+ end
135
+ end
136
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ module Groups
7
+ # @see Dodopayments::Resources::ProductCollections::Groups::Items#delete
8
+ class ItemDeleteParams < Dodopayments::Internal::Type::BaseModel
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ # @!attribute id
13
+ #
14
+ # @return [String]
15
+ required :id, String
16
+
17
+ # @!attribute group_id
18
+ #
19
+ # @return [String]
20
+ required :group_id, String
21
+
22
+ # @!attribute item_id
23
+ #
24
+ # @return [String]
25
+ required :item_id, String
26
+
27
+ # @!method initialize(id:, group_id:, item_id:, request_options: {})
28
+ # @param id [String]
29
+ # @param group_id [String]
30
+ # @param item_id [String]
31
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ module Groups
7
+ # @see Dodopayments::Resources::ProductCollections::Groups::Items#update
8
+ class ItemUpdateParams < Dodopayments::Internal::Type::BaseModel
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ # @!attribute id
13
+ #
14
+ # @return [String]
15
+ required :id, String
16
+
17
+ # @!attribute group_id
18
+ #
19
+ # @return [String]
20
+ required :group_id, String
21
+
22
+ # @!attribute item_id
23
+ #
24
+ # @return [String]
25
+ required :item_id, String
26
+
27
+ # @!attribute status
28
+ # Status of the product in the group
29
+ #
30
+ # @return [Boolean]
31
+ required :status, Dodopayments::Internal::Type::Boolean
32
+
33
+ # @!method initialize(id:, group_id:, item_id:, status:, request_options: {})
34
+ # @param id [String]
35
+ #
36
+ # @param group_id [String]
37
+ #
38
+ # @param item_id [String]
39
+ #
40
+ # @param status [Boolean] Status of the product in the group
41
+ #
42
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -190,13 +190,19 @@ module Dodopayments
190
190
  # @return [String, nil]
191
191
  optional :payment_method_id, String, nil?: true
192
192
 
193
+ # @!attribute scheduled_change
194
+ # Scheduled plan change details, if any
195
+ #
196
+ # @return [Dodopayments::Models::Subscription::ScheduledChange, nil]
197
+ optional :scheduled_change, -> { Dodopayments::Subscription::ScheduledChange }, nil?: true
198
+
193
199
  # @!attribute tax_id
194
200
  # Tax identifier provided for this subscription (if applicable)
195
201
  #
196
202
  # @return [String, nil]
197
203
  optional :tax_id, String, nil?: true
198
204
 
199
- # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, custom_field_responses: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, payment_method_id: nil, tax_id: nil)
205
+ # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, custom_field_responses: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
200
206
  # Some parameter documentations has been truncated, see
201
207
  # {Dodopayments::Models::Subscription} for more details.
202
208
  #
@@ -262,7 +268,107 @@ module Dodopayments
262
268
  #
263
269
  # @param payment_method_id [String, nil] Saved payment method id used for recurring charges
264
270
  #
271
+ # @param scheduled_change [Dodopayments::Models::Subscription::ScheduledChange, nil] Scheduled plan change details, if any
272
+ #
265
273
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
274
+
275
+ # @see Dodopayments::Models::Subscription#scheduled_change
276
+ class ScheduledChange < Dodopayments::Internal::Type::BaseModel
277
+ # @!attribute id
278
+ # The scheduled plan change ID
279
+ #
280
+ # @return [String]
281
+ required :id, String
282
+
283
+ # @!attribute addons
284
+ # Addons included in the scheduled change
285
+ #
286
+ # @return [Array<Dodopayments::Models::Subscription::ScheduledChange::Addon>]
287
+ required :addons,
288
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Subscription::ScheduledChange::Addon] }
289
+
290
+ # @!attribute created_at
291
+ # When this scheduled change was created
292
+ #
293
+ # @return [Time]
294
+ required :created_at, Time
295
+
296
+ # @!attribute effective_at
297
+ # When the change will be applied
298
+ #
299
+ # @return [Time]
300
+ required :effective_at, Time
301
+
302
+ # @!attribute product_id
303
+ # The product ID the subscription will change to
304
+ #
305
+ # @return [String]
306
+ required :product_id, String
307
+
308
+ # @!attribute quantity
309
+ # Quantity for the new plan
310
+ #
311
+ # @return [Integer]
312
+ required :quantity, Integer
313
+
314
+ # @!attribute product_description
315
+ # Description of the product being changed to
316
+ #
317
+ # @return [String, nil]
318
+ optional :product_description, String, nil?: true
319
+
320
+ # @!attribute product_name
321
+ # Name of the product being changed to
322
+ #
323
+ # @return [String, nil]
324
+ optional :product_name, String, nil?: true
325
+
326
+ # @!method initialize(id:, addons:, created_at:, effective_at:, product_id:, quantity:, product_description: nil, product_name: nil)
327
+ # Scheduled plan change details, if any
328
+ #
329
+ # @param id [String] The scheduled plan change ID
330
+ #
331
+ # @param addons [Array<Dodopayments::Models::Subscription::ScheduledChange::Addon>] Addons included in the scheduled change
332
+ #
333
+ # @param created_at [Time] When this scheduled change was created
334
+ #
335
+ # @param effective_at [Time] When the change will be applied
336
+ #
337
+ # @param product_id [String] The product ID the subscription will change to
338
+ #
339
+ # @param quantity [Integer] Quantity for the new plan
340
+ #
341
+ # @param product_description [String, nil] Description of the product being changed to
342
+ #
343
+ # @param product_name [String, nil] Name of the product being changed to
344
+
345
+ class Addon < Dodopayments::Internal::Type::BaseModel
346
+ # @!attribute addon_id
347
+ # The addon ID
348
+ #
349
+ # @return [String]
350
+ required :addon_id, String
351
+
352
+ # @!attribute name
353
+ # Name of the addon
354
+ #
355
+ # @return [String]
356
+ required :name, String
357
+
358
+ # @!attribute quantity
359
+ # Quantity of the addon
360
+ #
361
+ # @return [Integer]
362
+ required :quantity, Integer
363
+
364
+ # @!method initialize(addon_id:, name:, quantity:)
365
+ # @param addon_id [String] The addon ID
366
+ #
367
+ # @param name [String] Name of the addon
368
+ #
369
+ # @param quantity [Integer] Quantity of the addon
370
+ end
371
+ end
266
372
  end
267
373
  end
268
374
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Subscriptions#cancel_change_plan
6
+ class SubscriptionCancelChangePlanParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute subscription_id
11
+ #
12
+ # @return [String]
13
+ required :subscription_id, String
14
+
15
+ # @!method initialize(subscription_id:, request_options: {})
16
+ # @param subscription_id [String]
17
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end