Class: Telnyx::Resources::ManagedAccounts

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

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:



175
176
177
178
# File 'lib/telnyx/resources/managed_accounts.rb', line 175

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

Instance Attribute Details

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



7
8
9
# File 'lib/telnyx/resources/managed_accounts.rb', line 7

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:



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

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.



135
136
137
138
139
140
141
142
# File 'lib/telnyx/resources/managed_accounts.rb', line 135

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:



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

def list(params = {})
  parsed, options = Telnyx::ManagedAccountListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "managed_accounts",
    query: parsed.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:



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

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:



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

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:



161
162
163
164
165
166
167
168
169
170
# File 'lib/telnyx/resources/managed_accounts.rb', line 161

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