Class: Telnyx::Resources::ManagedAccounts::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/managed_accounts/actions.rb

Overview

Managed Accounts operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Actions

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

Parameters:



61
62
63
# File 'lib/telnyx/resources/managed_accounts/actions.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

#disable(id, request_options: {}) ⇒ Telnyx::Models::ManagedAccounts::ActionDisableResponse

Disables a managed account, forbidding it to use Telnyx services, including sending or receiving phone calls and SMS messages. Ongoing phone calls will not be affected. The managed account and its sub-users will no longer be able to log in via the mission control portal.

Parameters:

Returns:

See Also:



22
23
24
25
26
27
28
29
# File 'lib/telnyx/resources/managed_accounts/actions.rb', line 22

def disable(id, params = {})
  @client.request(
    method: :post,
    path: ["managed_accounts/%1$s/actions/disable", id],
    model: Telnyx::Models::ManagedAccounts::ActionDisableResponse,
    options: params[:request_options]
  )
end

#enable(id, reenable_all_connections: nil, request_options: {}) ⇒ Telnyx::Models::ManagedAccounts::ActionEnableResponse

Some parameter documentations has been truncated, see Models::ManagedAccounts::ActionEnableParams for more details.

Enables a managed account and its sub-users to use Telnyx services.

Parameters:

  • id (String)

    Managed Account User ID

  • reenable_all_connections (Boolean)

    When true, all connections owned by this managed account will automatically be r

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

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
# File 'lib/telnyx/resources/managed_accounts/actions.rb', line 47

def enable(id, params = {})
  parsed, options = Telnyx::ManagedAccounts::ActionEnableParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["managed_accounts/%1$s/actions/enable", id],
    body: parsed,
    model: Telnyx::Models::ManagedAccounts::ActionEnableResponse,
    options: options
  )
end