Class: Dodopayments::Resources::ProductCollections
- Inherits:
-
Object
- Object
- Dodopayments::Resources::ProductCollections
- Defined in:
- lib/dodopayments/resources/product_collections.rb,
lib/dodopayments/resources/product_collections/groups.rb,
lib/dodopayments/resources/product_collections/groups/items.rb
Defined Under Namespace
Classes: Groups
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(groups:, name:, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {}) ⇒ Dodopayments::Models::ProductCollection
Some parameter documentations has been truncated, see Models::ProductCollectionCreateParams for more details.
- #delete(id, request_options: {}) ⇒ nil
-
#initialize(client:) ⇒ ProductCollections
constructor
private
A new instance of ProductCollections.
- #list(archived: nil, brand_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::ProductCollectionListResponse>
- #retrieve(id, request_options: {}) ⇒ Dodopayments::Models::ProductCollection
- #unarchive(id, request_options: {}) ⇒ Dodopayments::Models::ProductCollectionUnarchiveResponse
-
#update(id, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, group_order: nil, image_id: nil, name: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ProductCollectionUpdateParams for more details.
- #update_images(id, force_update: nil, request_options: {}) ⇒ Dodopayments::Models::ProductCollectionUpdateImagesResponse
Constructor Details
#initialize(client:) ⇒ ProductCollections
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ProductCollections.
199 200 201 202 |
# File 'lib/dodopayments/resources/product_collections.rb', line 199 def initialize(client:) @client = client @groups = Dodopayments::Resources::ProductCollections::Groups.new(client: client) end |
Instance Attribute Details
#groups ⇒ Dodopayments::Resources::ProductCollections::Groups (readonly)
7 8 9 |
# File 'lib/dodopayments/resources/product_collections.rb', line 7 def groups @groups end |
Instance Method Details
#create(groups:, name:, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {}) ⇒ Dodopayments::Models::ProductCollection
Some parameter documentations has been truncated, see Models::ProductCollectionCreateParams for more details.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/dodopayments/resources/product_collections.rb', line 37 def create(params) parsed, = Dodopayments::ProductCollectionCreateParams.dump_request(params) @client.request( method: :post, path: "product-collections", body: parsed, model: Dodopayments::ProductCollection, options: ) end |
#delete(id, request_options: {}) ⇒ nil
146 147 148 149 150 151 152 153 |
# File 'lib/dodopayments/resources/product_collections.rb', line 146 def delete(id, params = {}) @client.request( method: :delete, path: ["product-collections/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#list(archived: nil, brand_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::ProductCollectionListResponse>
124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/dodopayments/resources/product_collections.rb', line 124 def list(params = {}) parsed, = Dodopayments::ProductCollectionListParams.dump_request(params) query = Dodopayments::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "product-collections", query: query, page: Dodopayments::Internal::DefaultPageNumberPagination, model: Dodopayments::Models::ProductCollectionListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Dodopayments::Models::ProductCollection
57 58 59 60 61 62 63 64 |
# File 'lib/dodopayments/resources/product_collections.rb', line 57 def retrieve(id, params = {}) @client.request( method: :get, path: ["product-collections/%1$s", id], model: Dodopayments::ProductCollection, options: params[:request_options] ) end |
#unarchive(id, request_options: {}) ⇒ Dodopayments::Models::ProductCollectionUnarchiveResponse
164 165 166 167 168 169 170 171 |
# File 'lib/dodopayments/resources/product_collections.rb', line 164 def unarchive(id, params = {}) @client.request( method: :post, path: ["product-collections/%1$s/unarchive", id], model: Dodopayments::Models::ProductCollectionUnarchiveResponse, options: params[:request_options] ) end |
#update(id, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, group_order: nil, image_id: nil, name: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ProductCollectionUpdateParams for more details.
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/dodopayments/resources/product_collections.rb', line 98 def update(id, params = {}) parsed, = Dodopayments::ProductCollectionUpdateParams.dump_request(params) @client.request( method: :patch, path: ["product-collections/%1$s", id], body: parsed, model: NilClass, options: ) end |
#update_images(id, force_update: nil, request_options: {}) ⇒ Dodopayments::Models::ProductCollectionUpdateImagesResponse
184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/dodopayments/resources/product_collections.rb', line 184 def update_images(id, params = {}) parsed, = Dodopayments::ProductCollectionUpdateImagesParams.dump_request(params) query = Dodopayments::Internal::Util.encode_query_params(parsed) @client.request( method: :put, path: ["product-collections/%1$s/images", id], query: query, model: Dodopayments::Models::ProductCollectionUpdateImagesResponse, options: ) end |