Class: Telnyx::Resources::Texml::Accounts::Queues
- Inherits:
-
Object
- Object
- Telnyx::Resources::Texml::Accounts::Queues
- Defined in:
- lib/telnyx/resources/texml/accounts/queues.rb,
sig/telnyx/resources/texml/accounts/queues.rbs
Overview
TeXML REST Commands
Instance Method Summary collapse
-
#create(account_sid, friendly_name: nil, max_size: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueResource
Creates a new queue resource for the account with the provided settings and returns it.
-
#delete(queue_sid, account_sid:, request_options: {}) ⇒ nil
Permanently deletes the specified queue resource from the account.
-
#initialize(client:) ⇒ Queues
constructor
private
A new instance of Queues.
-
#list(account_sid, date_created: nil, date_updated: nil, page: nil, page_size: nil, page_token: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultPaginationForQueues<Telnyx::Models::Texml::Accounts::QueueResource>
Some parameter documentations has been truncated, see Models::Texml::Accounts::QueueListParams for more details.
-
#retrieve(queue_sid, account_sid:, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueResource
Returns a single queue resource for the account by its QueueSid.
-
#update(queue_sid, account_sid:, max_size: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueResource
Updates the specified queue resource's settings and returns the updated queue.
Constructor Details
#initialize(client:) ⇒ Queues
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 Queues.
169 170 171 |
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 169 def initialize(client:) @client = client end |
Instance Method Details
#create(account_sid, friendly_name: nil, max_size: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueResource
Creates a new queue resource for the account with the provided settings and returns it.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 25 def create(account_sid, params = {}) parsed, = Telnyx::Texml::Accounts::QueueCreateParams.dump_request(params) @client.request( method: :post, path: ["texml/Accounts/%1$s/Queues", account_sid], headers: {"content-type" => "application/x-www-form-urlencoded"}, body: parsed, model: Telnyx::Texml::Accounts::QueueResource, options: ) end |
#delete(queue_sid, account_sid:, request_options: {}) ⇒ nil
Permanently deletes the specified queue resource from the account.
152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 152 def delete(queue_sid, params) parsed, = Telnyx::Texml::Accounts::QueueDeleteParams.dump_request(params) account_sid = parsed.delete(:account_sid) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["texml/Accounts/%1$s/Queues/%2$s", account_sid, queue_sid], model: NilClass, options: ) end |
#list(account_sid, date_created: nil, date_updated: nil, page: nil, page_size: nil, page_token: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultPaginationForQueues<Telnyx::Models::Texml::Accounts::QueueResource>
Some parameter documentations has been truncated, see Models::Texml::Accounts::QueueListParams for more details.
Returns a paginated list of queue resources for the account, with support for filtering by creation or update dates.
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 120 def list(account_sid, params = {}) parsed, = Telnyx::Texml::Accounts::QueueListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["texml/Accounts/%1$s/Queues", account_sid], query: query.transform_keys( date_created: "DateCreated", date_updated: "DateUpdated", page: "Page", page_size: "PageSize", page_token: "PageToken" ), page: Telnyx::Internal::DefaultPaginationForQueues, model: Telnyx::Texml::Accounts::QueueResource, options: ) end |
#retrieve(queue_sid, account_sid:, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueResource
Returns a single queue resource for the account by its QueueSid.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 50 def retrieve(queue_sid, params) parsed, = Telnyx::Texml::Accounts::QueueRetrieveParams.dump_request(params) account_sid = parsed.delete(:account_sid) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["texml/Accounts/%1$s/Queues/%2$s", account_sid, queue_sid], model: Telnyx::Texml::Accounts::QueueResource, options: ) end |
#update(queue_sid, account_sid:, max_size: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueResource
Updates the specified queue resource's settings and returns the updated queue.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 79 def update(queue_sid, params) parsed, = Telnyx::Texml::Accounts::QueueUpdateParams.dump_request(params) account_sid = parsed.delete(:account_sid) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["texml/Accounts/%1$s/Queues/%2$s", account_sid, queue_sid], headers: {"content-type" => "application/x-www-form-urlencoded"}, body: parsed, model: Telnyx::Texml::Accounts::QueueResource, options: ) end |