Class: Dodopayments::Resources::Entitlements
- Inherits:
-
Object
- Object
- Dodopayments::Resources::Entitlements
- Defined in:
- lib/dodopayments/resources/entitlements.rb,
lib/dodopayments/resources/entitlements/files.rb,
lib/dodopayments/resources/entitlements/grants.rb
Defined Under Namespace
Instance Attribute Summary collapse
- #files ⇒ Dodopayments::Resources::Entitlements::Files readonly
- #grants ⇒ Dodopayments::Resources::Entitlements::Grants readonly
Instance Method Summary collapse
-
#create(integration_config:, integration_type:, name:, description: nil, metadata: nil, request_options: {}) ⇒ Dodopayments::Models::Entitlement
POST /entitlements.
-
#delete(id, request_options: {}) ⇒ nil
DELETE /entitlements/id (soft-delete).
-
#initialize(client:) ⇒ Entitlements
constructor
private
A new instance of Entitlements.
-
#list(integration_type: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Entitlement>
GET /entitlements.
-
#retrieve(id, request_options: {}) ⇒ Dodopayments::Models::Entitlement
GET /entitlements/id.
-
#update(id, description: nil, integration_config: nil, metadata: nil, name: nil, request_options: {}) ⇒ Dodopayments::Models::Entitlement
Some parameter documentations has been truncated, see Models::EntitlementUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Entitlements
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 Entitlements.
146 147 148 149 150 |
# File 'lib/dodopayments/resources/entitlements.rb', line 146 def initialize(client:) @client = client @files = Dodopayments::Resources::Entitlements::Files.new(client: client) @grants = Dodopayments::Resources::Entitlements::Grants.new(client: client) end |
Instance Attribute Details
#files ⇒ Dodopayments::Resources::Entitlements::Files (readonly)
7 8 9 |
# File 'lib/dodopayments/resources/entitlements.rb', line 7 def files @files end |
#grants ⇒ Dodopayments::Resources::Entitlements::Grants (readonly)
10 11 12 |
# File 'lib/dodopayments/resources/entitlements.rb', line 10 def grants @grants end |
Instance Method Details
#create(integration_config:, integration_type:, name:, description: nil, metadata: nil, request_options: {}) ⇒ Dodopayments::Models::Entitlement
POST /entitlements
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dodopayments/resources/entitlements.rb', line 31 def create(params) parsed, = Dodopayments::EntitlementCreateParams.dump_request(params) @client.request( method: :post, path: "entitlements", body: parsed, model: Dodopayments::Entitlement, options: ) end |
#delete(id, request_options: {}) ⇒ nil
DELETE /entitlements/id (soft-delete)
134 135 136 137 138 139 140 141 |
# File 'lib/dodopayments/resources/entitlements.rb', line 134 def delete(id, params = {}) @client.request( method: :delete, path: ["entitlements/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#list(integration_type: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Entitlement>
GET /entitlements
110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/dodopayments/resources/entitlements.rb', line 110 def list(params = {}) parsed, = Dodopayments::EntitlementListParams.dump_request(params) query = Dodopayments::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "entitlements", query: query, page: Dodopayments::Internal::DefaultPageNumberPagination, model: Dodopayments::Entitlement, options: ) end |
#retrieve(id, request_options: {}) ⇒ Dodopayments::Models::Entitlement
GET /entitlements/id
53 54 55 56 57 58 59 60 |
# File 'lib/dodopayments/resources/entitlements.rb', line 53 def retrieve(id, params = {}) @client.request( method: :get, path: ["entitlements/%1$s", id], model: Dodopayments::Entitlement, options: params[:request_options] ) end |
#update(id, description: nil, integration_config: nil, metadata: nil, name: nil, request_options: {}) ⇒ Dodopayments::Models::Entitlement
Some parameter documentations has been truncated, see Models::EntitlementUpdateParams for more details.
PATCH /entitlements/id
84 85 86 87 88 89 90 91 92 93 |
# File 'lib/dodopayments/resources/entitlements.rb', line 84 def update(id, params = {}) parsed, = Dodopayments::EntitlementUpdateParams.dump_request(params) @client.request( method: :patch, path: ["entitlements/%1$s", id], body: parsed, model: Dodopayments::Entitlement, options: ) end |