Class: Stigg::Resources::V1::Customers::PromotionalEntitlements
- Inherits:
-
Object
- Object
- Stigg::Resources::V1::Customers::PromotionalEntitlements
- Defined in:
- lib/stigg/resources/v1/customers/promotional_entitlements.rb
Overview
Operations related to promotional entitlements
Instance Method Summary collapse
-
#create(id, promotional_entitlements:, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementCreateResponse
Grants promotional entitlements to a customer, providing feature access outside their subscription.
-
#initialize(client:) ⇒ PromotionalEntitlements
constructor
private
A new instance of PromotionalEntitlements.
-
#list(id, after: nil, before: nil, created_at: nil, limit: nil, status: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::Customers::PromotionalEntitlementListResponse>
Some parameter documentations has been truncated, see Models::V1::Customers::PromotionalEntitlementListParams for more details.
-
#revoke(feature_id, id:, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse
Revokes a previously granted promotional entitlement from a customer for a specific feature.
Constructor Details
#initialize(client:) ⇒ PromotionalEntitlements
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 PromotionalEntitlements.
103 104 105 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 103 def initialize(client:) @client = client end |
Instance Method Details
#create(id, promotional_entitlements:, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementCreateResponse
Grants promotional entitlements to a customer, providing feature access outside their subscription. Entitlements can be time-limited or permanent.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 23 def create(id, params) parsed, = Stigg::V1::Customers::PromotionalEntitlementCreateParams.dump_request(params) @client.request( method: :post, path: ["api/v1/customers/%1$s/promotional-entitlements", id], body: parsed, model: Stigg::Models::V1::Customers::PromotionalEntitlementCreateResponse, options: ) end |
#list(id, after: nil, before: nil, created_at: nil, limit: nil, status: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::Customers::PromotionalEntitlementListResponse>
Some parameter documentations has been truncated, see Models::V1::Customers::PromotionalEntitlementListParams for more details.
Retrieves a paginated list of a customer’s promotional entitlements.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 59 def list(id, params = {}) parsed, = Stigg::V1::Customers::PromotionalEntitlementListParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/v1/customers/%1$s/promotional-entitlements", id], query: query.transform_keys(created_at: "createdAt"), page: Stigg::Internal::MyCursorIDPage, model: Stigg::Models::V1::Customers::PromotionalEntitlementListResponse, options: ) end |
#revoke(feature_id, id:, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse
Revokes a previously granted promotional entitlement from a customer for a specific feature.
86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 86 def revoke(feature_id, params) parsed, = Stigg::V1::Customers::PromotionalEntitlementRevokeParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["api/v1/customers/%1$s/promotional-entitlements/%2$s", id, feature_id], model: Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse, options: ) end |