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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureArchiveFeatureParams for more details.
-
#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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureCreateFeatureParams for more details.
-
#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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::FeatureListFeaturesResponse>
Some parameter documentations has been truncated, see Models::V1::FeatureListFeaturesParams for more details.
-
#retrieve_feature(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureRetrieveFeatureParams for more details.
-
#unarchive_feature(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureUnarchiveFeatureParams for more details.
-
#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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureUpdateFeatureParams for more details.
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.
260 261 262 |
# File 'lib/stigg/resources/v1/features.rb', line 260 def initialize(client:) @client = client end |
Instance Method Details
#archive_feature(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureArchiveFeatureParams for more details.
Archives a feature, preventing it from being used in new entitlements.
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/stigg/resources/v1/features.rb', line 26 def archive_feature(id, params = {}) parsed, = Stigg::V1::FeatureArchiveFeatureParams.dump_request(params) @client.request( method: :post, path: ["api/v1/features/%1$s/archive", id], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::V1::Feature, 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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureCreateFeatureParams for more details.
Creates a new feature with the specified type, metering, and configuration.
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/stigg/resources/v1/features.rb', line 78 def create_feature(params) parsed, = Stigg::V1::FeatureCreateFeatureParams.dump_request(params) header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"} @client.request( method: :post, path: "api/v1/features", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), 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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::FeatureListFeaturesResponse>
Some parameter documentations has been truncated, see Models::V1::FeatureListFeaturesParams for more details.
Retrieves a paginated list of features in the environment.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/stigg/resources/v1/features.rb', line 123 def list_features(params = {}) query_params = [:id, :after, :before, :created_at, :feature_type, :limit, :meter_type, :status] parsed, = Stigg::V1::FeatureListFeaturesParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "api/v1/features", query: query.transform_keys( created_at: "createdAt", feature_type: "featureType", meter_type: "meterType" ), 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::FeatureListFeaturesResponse, options: ) end |
#retrieve_feature(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureRetrieveFeatureParams for more details.
Retrieves a feature by its unique identifier.
163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/stigg/resources/v1/features.rb', line 163 def retrieve_feature(id, params = {}) parsed, = Stigg::V1::FeatureRetrieveFeatureParams.dump_request(params) @client.request( method: :get, path: ["api/v1/features/%1$s", id], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::V1::Feature, options: ) end |
#unarchive_feature(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureUnarchiveFeatureParams for more details.
Restores an archived feature, allowing it to be used in entitlements again.
195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/stigg/resources/v1/features.rb', line 195 def unarchive_feature(id, params = {}) parsed, = Stigg::V1::FeatureUnarchiveFeatureParams.dump_request(params) @client.request( method: :post, path: ["api/v1/features/%1$s/unarchive", id], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::V1::Feature, 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, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Feature
Some parameter documentations has been truncated, see Models::V1::FeatureUpdateFeatureParams for more details.
Updates an existing feature’s properties such as display name, description, and configuration.
244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/stigg/resources/v1/features.rb', line 244 def update_feature(id, params = {}) parsed, = Stigg::V1::FeatureUpdateFeatureParams.dump_request(params) header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"} @client.request( method: :patch, path: ["api/v1/features/%1$s", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Stigg::V1::Feature, options: ) end |