Class: Telnyx::Resources::ManagedAccounts

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

Overview

Managed Accounts operations

Defined Under Namespace

Classes: Actions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ManagedAccounts

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

Parameters:



178
179
180
181
# File 'lib/telnyx/resources/managed_accounts.rb', line 178

def initialize(client:)
  @client = client
  @actions = Telnyx::Resources::ManagedAccounts::Actions.new(client: client)
end

Instance Attribute Details

#actionsTelnyx::Resources::ManagedAccounts::Actions (readonly)

Managed Accounts operations



9
10
11
# File 'lib/telnyx/resources/managed_accounts.rb', line 9

def actions
  @actions
end

Instance Method Details

#create(business_name:, email: nil, managed_account_allow_custom_pricing: nil, password: nil, rollup_billing: nil, request_options: {}) ⇒ Telnyx::Models::ManagedAccountCreateResponse

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

Create a new managed account owned by the authenticated user. You need to be explictly approved by Telnyx in order to become a manager account.

Parameters:

  • business_name (String)

    The name of the business for which the new managed account is being created, tha

  • email (String)

    The email address for the managed account. If not provided, the email address wi

  • managed_account_allow_custom_pricing (Boolean)

    Boolean value that indicates if the managed account is able to have custom prici

  • password (String)

    Password for the managed account. If a password is not supplied, the account wil

  • rollup_billing (Boolean)

    Boolean value that indicates if the billing information and charges to the manag

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

Returns:

See Also:



34
35
36
37
38
39
40
41
42
43
# File 'lib/telnyx/resources/managed_accounts.rb', line 34

def create(params)
  parsed, options = Telnyx::ManagedAccountCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "managed_accounts",
    body: parsed,
    model: Telnyx::Models::ManagedAccountCreateResponse,
    options: options
  )
end

#get_allocatable_global_outbound_channels(request_options: {}) ⇒ Telnyx::Models::ManagedAccountGetAllocatableGlobalOutboundChannelsResponse

Display information about allocatable global outbound channels for the current user. Only usable by account managers.



138
139
140
141
142
143
144
145
# File 'lib/telnyx/resources/managed_accounts.rb', line 138

def get_allocatable_global_outbound_channels(params = {})
  @client.request(
    method: :get,
    path: "managed_accounts/allocatable_global_outbound_channels",
    model: Telnyx::Models::ManagedAccountGetAllocatableGlobalOutboundChannelsResponse,
    options: params[:request_options]
  )
end

#list(filter: nil, include_cancelled_accounts: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ManagedAccountListResponse>

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

Lists the accounts managed by the current user. Users need to be explictly approved by Telnyx in order to become manager accounts.

Parameters:

Returns:

See Also:



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/telnyx/resources/managed_accounts.rb', line 115

def list(params = {})
  parsed, options = Telnyx::ManagedAccountListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "managed_accounts",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::ManagedAccountListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::ManagedAccountRetrieveResponse

Retrieves the details of a single managed account.

Parameters:

Returns:

See Also:



56
57
58
59
60
61
62
63
# File 'lib/telnyx/resources/managed_accounts.rb', line 56

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["managed_accounts/%1$s", id],
    model: Telnyx::Models::ManagedAccountRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, managed_account_allow_custom_pricing: nil, request_options: {}) ⇒ Telnyx::Models::ManagedAccountUpdateResponse

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

Update a single managed account.

Parameters:

  • id (String)

    Managed Account User ID

  • managed_account_allow_custom_pricing (Boolean)

    Boolean value that indicates if the managed account is able to have custom prici

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

Returns:

See Also:



81
82
83
84
85
86
87
88
89
90
# File 'lib/telnyx/resources/managed_accounts.rb', line 81

def update(id, params = {})
  parsed, options = Telnyx::ManagedAccountUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["managed_accounts/%1$s", id],
    body: parsed,
    model: Telnyx::Models::ManagedAccountUpdateResponse,
    options: options
  )
end

#update_global_channel_limit(id, channel_limit: nil, request_options: {}) ⇒ Telnyx::Models::ManagedAccountUpdateGlobalChannelLimitResponse

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

Update the amount of allocatable global outbound channels allocated to a specific managed account.

Parameters:

  • id (String)

    Managed Account User ID

  • channel_limit (Integer)

    Integer value that indicates the number of allocatable global outbound channels

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

Returns:

See Also:



164
165
166
167
168
169
170
171
172
173
# File 'lib/telnyx/resources/managed_accounts.rb', line 164

def update_global_channel_limit(id, params = {})
  parsed, options = Telnyx::ManagedAccountUpdateGlobalChannelLimitParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["managed_accounts/%1$s/update_global_channel_limit", id],
    body: parsed,
    model: Telnyx::Models::ManagedAccountUpdateGlobalChannelLimitResponse,
    options: options
  )
end