Class: Telnyx::Resources::Texml::Accounts::Queues

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/texml/accounts/queues.rb

Overview

TeXML REST Commands

Instance Method Summary collapse

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.

Parameters:



167
168
169
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 167

def initialize(client:)
  @client = client
end

Instance Method Details

#create(account_sid, friendly_name: nil, max_size: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueCreateResponse

Creates a new queue resource.

Parameters:

  • account_sid (String)

    The id of the account the resource belongs to.

  • friendly_name (String)

    A human readable name for the queue.

  • max_size (Integer)

    The maximum size of the queue.

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

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 24

def create(, params = {})
  parsed, options = Telnyx::Texml::Accounts::QueueCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["texml/Accounts/%1$s/Queues", ],
    headers: {"content-type" => "application/x-www-form-urlencoded"},
    body: parsed,
    model: Telnyx::Models::Texml::Accounts::QueueCreateResponse,
    options: options
  )
end

#delete(queue_sid, account_sid:, request_options: {}) ⇒ nil

Delete a queue resource.

Parameters:

  • queue_sid (String)

    The QueueSid that identifies the call queue.

  • account_sid (String)

    The id of the account the resource belongs to.

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

Returns:

  • (nil)

See Also:



150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 150

def delete(queue_sid, params)
  parsed, options = Telnyx::Texml::Accounts::QueueDeleteParams.dump_request(params)
   =
    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", , queue_sid],
    model: NilClass,
    options: 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::QueueListResponse>

Some parameter documentations has been truncated, see Models::Texml::Accounts::QueueListParams for more details.

Lists queue resources.

Parameters:

  • account_sid (String)

    The id of the account the resource belongs to.

  • date_created (String)

    Filters conferences by the creation date. Expected format is YYYY-MM-DD. Also ac

  • date_updated (String)

    Filters conferences by the time they were last updated. Expected format is YYYY-

  • page (Integer)

    The number of the page to be displayed, zero-indexed, should be used in conjucti

  • page_size (Integer)

    The number of records to be displayed on a page

  • page_token (String)

    Used to request the next page of results.

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

Returns:

See Also:



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 118

def list(, params = {})
  parsed, options = 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", ],
    query: query.transform_keys(
      date_created: "DateCreated",
      date_updated: "DateUpdated",
      page: "Page",
      page_size: "PageSize",
      page_token: "PageToken"
    ),
    page: Telnyx::Internal::DefaultPaginationForQueues,
    model: Telnyx::Models::Texml::Accounts::QueueListResponse,
    options: options
  )
end

#retrieve(queue_sid, account_sid:, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueRetrieveResponse

Returns a queue resource.

Parameters:

  • queue_sid (String)

    The QueueSid that identifies the call queue.

  • account_sid (String)

    The id of the account the resource belongs to.

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

Returns:

See Also:



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 49

def retrieve(queue_sid, params)
  parsed, options = Telnyx::Texml::Accounts::QueueRetrieveParams.dump_request(params)
   =
    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", , queue_sid],
    model: Telnyx::Models::Texml::Accounts::QueueRetrieveResponse,
    options: options
  )
end

#update(queue_sid, account_sid:, max_size: nil, request_options: {}) ⇒ Telnyx::Models::Texml::Accounts::QueueUpdateResponse

Updates a queue resource.

Parameters:

  • queue_sid (String)

    Path param: The QueueSid that identifies the call queue.

  • account_sid (String)

    Path param: The id of the account the resource belongs to.

  • max_size (Integer)

    Body param: The maximum size of the queue.

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

Returns:

See Also:



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/telnyx/resources/texml/accounts/queues.rb', line 78

def update(queue_sid, params)
  parsed, options = Telnyx::Texml::Accounts::QueueUpdateParams.dump_request(params)
   =
    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", , queue_sid],
    headers: {"content-type" => "application/x-www-form-urlencoded"},
    body: parsed,
    model: Telnyx::Models::Texml::Accounts::QueueUpdateResponse,
    options: options
  )
end