Class: Stigg::Resources::V1::Features
- Inherits:
-
Object
- Object
- Stigg::Resources::V1::Features
- Defined in:
- lib/stigg/resources/v1/features.rb
Overview
Operations related to features
Instance Method Summary collapse
-
#archive_feature(id, request_options: {}) ⇒ Stigg::Models::V1::Feature
Archives a feature, preventing it from being used in new entitlements.
-
#create_feature(id:, display_name:, feature_type:, description: nil, enum_configuration: nil, feature_status: nil, feature_units: nil, feature_units_plural: nil, metadata: nil, meter_type: nil, unit_transformation: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Creates a new feature with the specified type, metering, and configuration.
-
#initialize(client:) ⇒ Features
constructor
private
A new instance of Features.
-
#list_features(id: nil, after: nil, before: nil, created_at: nil, feature_type: nil, limit: nil, meter_type: nil, status: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::FeatureListFeaturesResponse>
Retrieves a paginated list of features in the environment.
-
#retrieve_feature(id, request_options: {}) ⇒ Stigg::Models::V1::Feature
Retrieves a feature by its unique identifier.
-
#unarchive_feature(id, request_options: {}) ⇒ Stigg::Models::V1::Feature
Restores an archived feature, allowing it to be used in entitlements again.
-
#update_feature(id, description: nil, display_name: nil, enum_configuration: nil, feature_units: nil, feature_units_plural: nil, metadata: nil, meter: nil, unit_transformation: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Updates an existing feature’s properties such as display name, description, and configuration.
Constructor Details
#initialize(client:) ⇒ Features
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 Features.
194 195 196 |
# File 'lib/stigg/resources/v1/features.rb', line 194 def initialize(client:) @client = client end |
Instance Method Details
#archive_feature(id, request_options: {}) ⇒ Stigg::Models::V1::Feature
Archives a feature, preventing it from being used in new entitlements.
19 20 21 22 23 24 25 26 |
# File 'lib/stigg/resources/v1/features.rb', line 19 def archive_feature(id, params = {}) @client.request( method: :post, path: ["api/v1/features/%1$s/archive", id], model: Stigg::V1::Feature, options: params[:request_options] ) end |
#create_feature(id:, display_name:, feature_type:, description: nil, enum_configuration: nil, feature_status: nil, feature_units: nil, feature_units_plural: nil, metadata: nil, meter_type: nil, unit_transformation: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Creates a new feature with the specified type, metering, and configuration.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/stigg/resources/v1/features.rb', line 59 def create_feature(params) parsed, = Stigg::V1::FeatureCreateFeatureParams.dump_request(params) @client.request( method: :post, path: "api/v1/features", body: parsed, model: Stigg::V1::Feature, options: ) end |
#list_features(id: nil, after: nil, before: nil, created_at: nil, feature_type: nil, limit: nil, meter_type: nil, status: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::FeatureListFeaturesResponse>
Retrieves a paginated list of features in the environment.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/stigg/resources/v1/features.rb', line 95 def list_features(params = {}) parsed, = Stigg::V1::FeatureListFeaturesParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/v1/features", query: query.transform_keys( created_at: "createdAt", feature_type: "featureType", meter_type: "meterType" ), page: Stigg::Internal::MyCursorIDPage, model: Stigg::Models::V1::FeatureListFeaturesResponse, options: ) end |
#retrieve_feature(id, request_options: {}) ⇒ Stigg::Models::V1::Feature
Retrieves a feature by its unique identifier.
123 124 125 126 127 128 129 130 |
# File 'lib/stigg/resources/v1/features.rb', line 123 def retrieve_feature(id, params = {}) @client.request( method: :get, path: ["api/v1/features/%1$s", id], model: Stigg::V1::Feature, options: params[:request_options] ) end |
#unarchive_feature(id, request_options: {}) ⇒ Stigg::Models::V1::Feature
Restores an archived feature, allowing it to be used in entitlements again.
143 144 145 146 147 148 149 150 |
# File 'lib/stigg/resources/v1/features.rb', line 143 def unarchive_feature(id, params = {}) @client.request( method: :post, path: ["api/v1/features/%1$s/unarchive", id], model: Stigg::V1::Feature, options: params[:request_options] ) end |
#update_feature(id, description: nil, display_name: nil, enum_configuration: nil, feature_units: nil, feature_units_plural: nil, metadata: nil, meter: nil, unit_transformation: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Updates an existing feature’s properties such as display name, description, and configuration.
180 181 182 183 184 185 186 187 188 189 |
# File 'lib/stigg/resources/v1/features.rb', line 180 def update_feature(id, params = {}) parsed, = Stigg::V1::FeatureUpdateFeatureParams.dump_request(params) @client.request( method: :patch, path: ["api/v1/features/%1$s", id], body: parsed, model: Stigg::V1::Feature, options: ) end |