Class: Stigg::Resources::V1::Subscriptions::FutureUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/stigg/resources/v1/subscriptions/future_update.rb

Overview

Operations related to subscriptions

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ FutureUpdate

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 FutureUpdate.

Parameters:



79
80
81
# File 'lib/stigg/resources/v1/subscriptions/future_update.rb', line 79

def initialize(client:)
  @client = client
end

Instance Method Details

#cancel_pending_payment(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Subscriptions::CancelSubscription

Some parameter documentations has been truncated, see Models::V1::Subscriptions::FutureUpdateCancelPendingPaymentParams for more details.

Cancels a subscription update that is pending payment completion.

Parameters:

  • id (String)

    The unique identifier of the entity

  • x_account_id (String)

    Account ID — optional when authenticating with a user JWT (Bearer token); falls

  • x_environment_id (String)

    Environment ID — required when authenticating with a user JWT (Bearer token) on

  • request_options (Stigg::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/stigg/resources/v1/subscriptions/future_update.rb', line 28

def cancel_pending_payment(id, params = {})
  parsed, options = Stigg::V1::Subscriptions::FutureUpdateCancelPendingPaymentParams.dump_request(params)
  @client.request(
    method: :delete,
    path: ["api/v1/subscriptions/%1$s/future-update/pending-payment", id],
    headers: parsed.transform_keys(
      x_account_id: "x-account-id",
      x_environment_id: "x-environment-id"
    ),
    model: Stigg::V1::Subscriptions::CancelSubscription,
    options: options
  )
end

#cancel_schedule(id, x_account_id: nil, x_environment_id: nil, request_options: {}) ⇒ Stigg::Models::V1::Subscriptions::CancelSubscription

Some parameter documentations has been truncated, see Models::V1::Subscriptions::FutureUpdateCancelScheduleParams for more details.

Cancels a scheduled subscription update, such as a future downgrade or plan change.

Parameters:

  • id (String)

    The unique identifier of the entity

  • x_account_id (String)

    Account ID — optional when authenticating with a user JWT (Bearer token); falls

  • x_environment_id (String)

    Environment ID — required when authenticating with a user JWT (Bearer token) on

  • request_options (Stigg::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/stigg/resources/v1/subscriptions/future_update.rb', line 62

def cancel_schedule(id, params = {})
  parsed, options = Stigg::V1::Subscriptions::FutureUpdateCancelScheduleParams.dump_request(params)
  @client.request(
    method: :delete,
    path: ["api/v1/subscriptions/%1$s/future-update/schedule", id],
    headers: parsed.transform_keys(
      x_account_id: "x-account-id",
      x_environment_id: "x-environment-id"
    ),
    model: Stigg::V1::Subscriptions::CancelSubscription,
    options: options
  )
end