Class: Dodopayments::Resources::ProductCollections::Groups
- Inherits:
-
Object
- Object
- Dodopayments::Resources::ProductCollections::Groups
- Defined in:
- lib/dodopayments/resources/product_collections/groups.rb,
lib/dodopayments/resources/product_collections/groups/items.rb
Defined Under Namespace
Classes: Items
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(id, products:, group_name: nil, status: nil, request_options: {}) ⇒ Dodopayments::Models::ProductCollections::ProductCollectionGroupResponse
Some parameter documentations has been truncated, see Models::ProductCollections::GroupCreateParams for more details.
- #delete(group_id, id:, request_options: {}) ⇒ nil
-
#initialize(client:) ⇒ Groups
constructor
private
A new instance of Groups.
-
#update(group_id, id:, group_name: nil, product_order: nil, status: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ProductCollections::GroupUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Groups
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 Groups.
102 103 104 105 |
# File 'lib/dodopayments/resources/product_collections/groups.rb', line 102 def initialize(client:) @client = client @items = Dodopayments::Resources::ProductCollections::Groups::Items.new(client: client) end |
Instance Attribute Details
#items ⇒ Dodopayments::Resources::ProductCollections::Groups::Items (readonly)
8 9 10 |
# File 'lib/dodopayments/resources/product_collections/groups.rb', line 8 def items @items end |
Instance Method Details
#create(id, products:, group_name: nil, status: nil, request_options: {}) ⇒ Dodopayments::Models::ProductCollections::ProductCollectionGroupResponse
Some parameter documentations has been truncated, see Models::ProductCollections::GroupCreateParams for more details.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/dodopayments/resources/product_collections/groups.rb', line 28 def create(id, params) parsed, = Dodopayments::ProductCollections::GroupCreateParams.dump_request(params) @client.request( method: :post, path: ["product-collections/%1$s/groups", id], body: parsed, model: Dodopayments::ProductCollections::ProductCollectionGroupResponse, options: ) end |
#delete(group_id, id:, request_options: {}) ⇒ nil
85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/dodopayments/resources/product_collections/groups.rb', line 85 def delete(group_id, params) parsed, = Dodopayments::ProductCollections::GroupDeleteParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["product-collections/%1$s/groups/%2$s", id, group_id], model: NilClass, options: ) end |
#update(group_id, id:, group_name: nil, product_order: nil, status: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::ProductCollections::GroupUpdateParams for more details.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/dodopayments/resources/product_collections/groups.rb', line 59 def update(group_id, params) parsed, = Dodopayments::ProductCollections::GroupUpdateParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["product-collections/%1$s/groups/%2$s", id, group_id], body: parsed, model: NilClass, options: ) end |