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:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementCreateResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PromotionalEntitlementCreateParams for more details.
-
#initialize(client:) ⇒ PromotionalEntitlements
constructor
private
A new instance of PromotionalEntitlements.
-
#list(id, after: nil, before: nil, created_at: nil, limit: nil, status: nil, x_account_id: nil, x_environment_id: 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:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PromotionalEntitlementRevokeParams for more details.
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.
134 135 136 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 134 def initialize(client:) @client = client end |
Instance Method Details
#create(id, promotional_entitlements:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementCreateResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PromotionalEntitlementCreateParams for more details.
Grants promotional entitlements to a customer, providing feature access outside their subscription. Entitlements can be time-limited or permanent.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 31 def create(id, params) parsed, = Stigg::V1::Customers::PromotionalEntitlementCreateParams.dump_request(params) header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"} @client.request( method: :post, path: ["api/v1/customers/%1$s/promotional-entitlements", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Stigg::Models::V1::Customers::PromotionalEntitlementCreateResponse, options: ) end |
#list(id, after: nil, before: nil, created_at: nil, limit: nil, status: nil, x_account_id: nil, x_environment_id: 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.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 73 def list(id, params = {}) query_params = [:after, :before, :created_at, :limit, :status] parsed, = Stigg::V1::Customers::PromotionalEntitlementListParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["api/v1/customers/%1$s/promotional-entitlements", id], query: query.transform_keys(created_at: "createdAt"), headers: parsed.except(*query_params).transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), page: Stigg::Internal::MyCursorIDPage, model: Stigg::Models::V1::Customers::PromotionalEntitlementListResponse, options: ) end |
#revoke(feature_id, id:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse
Some parameter documentations has been truncated, see Models::V1::Customers::PromotionalEntitlementRevokeParams for more details.
Revokes a previously granted promotional entitlement from a customer for a specific feature.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/stigg/resources/v1/customers/promotional_entitlements.rb', line 113 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], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::Models::V1::Customers::PromotionalEntitlementRevokeResponse, options: ) end |