Class: Stigg::Resources::V1::Addons
- Inherits:
-
Object
- Object
- Stigg::Resources::V1::Addons
- Defined in:
- lib/stigg/resources/v1/addons.rb,
lib/stigg/resources/v1/addons/entitlements.rb
Overview
Operations related to addons
Defined Under Namespace
Classes: Entitlements
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#archive(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonArchiveParams for more details.
-
#create(id:, display_name:, product_id:, billing_id: nil, description: nil, max_quantity: nil, metadata: nil, pricing_type: nil, status: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonCreateParams for more details.
-
#create_draft(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonCreateDraftParams for more details.
-
#initialize(client:) ⇒ Addons
constructor
private
A new instance of Addons.
-
#list(after: nil, before: nil, created_at: nil, limit: nil, product_id: nil, status: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::AddonListResponse>
Some parameter documentations has been truncated, see Models::V1::AddonListParams for more details.
-
#list_charges(id, after: nil, before: nil, limit: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::AddonListChargesResponse>
Some parameter documentations has been truncated, see Models::V1::AddonListChargesParams for more details.
-
#publish(id, migration_type:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::AddonPublishResponse
Some parameter documentations has been truncated, see Models::V1::AddonPublishParams for more details.
-
#remove_draft(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::AddonRemoveDraftResponse
Some parameter documentations has been truncated, see Models::V1::AddonRemoveDraftParams for more details.
-
#retrieve(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonRetrieveParams for more details.
-
#update(id, billing_id: nil, charges: nil, dependencies: nil, description: nil, display_name: nil, max_quantity: nil, metadata: nil, status: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Addons
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 Addons.
359 360 361 362 |
# File 'lib/stigg/resources/v1/addons.rb', line 359 def initialize(client:) @client = client @entitlements = Stigg::Resources::V1::Addons::Entitlements.new(client: client) end |
Instance Attribute Details
#entitlements ⇒ Stigg::Resources::V1::Addons::Entitlements (readonly)
9 10 11 |
# File 'lib/stigg/resources/v1/addons.rb', line 9 def entitlements @entitlements end |
Instance Method Details
#archive(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonArchiveParams for more details.
Archives an addon, preventing it from being used in new subscriptions.
203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/stigg/resources/v1/addons.rb', line 203 def archive(id, params = {}) parsed, = Stigg::V1::AddonArchiveParams.dump_request(params) @client.request( method: :post, path: ["api/v1/addons/%1$s/archive", id], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::V1::Addon, options: ) end |
#create(id:, display_name:, product_id:, billing_id: nil, description: nil, max_quantity: nil, metadata: nil, pricing_type: nil, status: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonCreateParams for more details.
Creates a new addon in draft status, associated with a specific product.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/stigg/resources/v1/addons.rb', line 45 def create(params) parsed, = Stigg::V1::AddonCreateParams.dump_request(params) header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"} @client.request( method: :post, path: "api/v1/addons", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Stigg::V1::Addon, options: ) end |
#create_draft(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonCreateDraftParams for more details.
Creates a draft version of an existing addon for modification before publishing.
235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/stigg/resources/v1/addons.rb', line 235 def create_draft(id, params = {}) parsed, = Stigg::V1::AddonCreateDraftParams.dump_request(params) @client.request( method: :post, path: ["api/v1/addons/%1$s/draft", id], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::V1::Addon, options: ) end |
#list(after: nil, before: nil, created_at: nil, limit: nil, product_id: nil, status: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::AddonListResponse>
Some parameter documentations has been truncated, see Models::V1::AddonListParams for more details.
Retrieves a paginated list of addons in the environment.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/stigg/resources/v1/addons.rb', line 167 def list(params = {}) query_params = [:after, :before, :created_at, :limit, :product_id, :status] parsed, = Stigg::V1::AddonListParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "api/v1/addons", query: query.transform_keys(created_at: "createdAt", product_id: "productId"), 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::AddonListResponse, options: ) end |
#list_charges(id, after: nil, before: nil, limit: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Internal::MyCursorIDPage<Stigg::Models::V1::AddonListChargesResponse>
Some parameter documentations has been truncated, see Models::V1::AddonListChargesParams for more details.
Retrieves the list of charges configured on an addon.
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/stigg/resources/v1/addons.rb', line 273 def list_charges(id, params = {}) query_params = [:after, :before, :limit] parsed, = Stigg::V1::AddonListChargesParams.dump_request(params) query = Stigg::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["api/v1/addons/%1$s/charges", id], query: query, 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::AddonListChargesResponse, options: ) end |
#publish(id, migration_type:, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::AddonPublishResponse
Some parameter documentations has been truncated, see Models::V1::AddonPublishParams for more details.
Publishes a draft addon, making it available for use in subscriptions.
311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/stigg/resources/v1/addons.rb', line 311 def publish(id, params) parsed, = Stigg::V1::AddonPublishParams.dump_request(params) header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"} @client.request( method: :post, path: ["api/v1/addons/%1$s/publish", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Stigg::Models::V1::AddonPublishResponse, options: ) end |
#remove_draft(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::AddonRemoveDraftResponse
Some parameter documentations has been truncated, see Models::V1::AddonRemoveDraftParams for more details.
Removes a draft version of an addon.
342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/stigg/resources/v1/addons.rb', line 342 def remove_draft(id, params = {}) parsed, = Stigg::V1::AddonRemoveDraftParams.dump_request(params) @client.request( method: :delete, path: ["api/v1/addons/%1$s/draft", id], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::Models::V1::AddonRemoveDraftResponse, options: ) end |
#retrieve(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonRetrieveParams for more details.
Retrieves an addon by its unique identifier, including entitlements and pricing details.
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/stigg/resources/v1/addons.rb', line 77 def retrieve(id, params = {}) parsed, = Stigg::V1::AddonRetrieveParams.dump_request(params) @client.request( method: :get, path: ["api/v1/addons/%1$s", id], headers: parsed.transform_keys( x_account_id: "x-account-id", x_environment_id: "x-environment-id" ), model: Stigg::V1::Addon, options: ) end |
#update(id, billing_id: nil, charges: nil, dependencies: nil, description: nil, display_name: nil, max_quantity: nil, metadata: nil, status: nil, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Addon
Some parameter documentations has been truncated, see Models::V1::AddonUpdateParams for more details.
Updates an existing addon’s properties such as display name, description, and metadata.
126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/stigg/resources/v1/addons.rb', line 126 def update(id, params = {}) parsed, = Stigg::V1::AddonUpdateParams.dump_request(params) header_params = {x_account_id: "x-account-id", x_environment_id: "x-environment-id"} @client.request( method: :patch, path: ["api/v1/addons/%1$s", id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Stigg::V1::Addon, options: ) end |