Class: PhoneComClient::VoicemailApi

Inherits:
Object
  • Object
show all
Defined in:
lib/phone_com_client/api/voicemail_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VoicemailApi

Returns a new instance of VoicemailApi.



19
20
21
# File 'lib/phone_com_client/api/voicemail_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/phone_com_client/api/voicemail_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_account_voicemail(account_id, voicemail_id, opts = {}) ⇒ VoicemailFull

This service shows the details of an individual voicemail. This service shows the details of an individual voicemail. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Get Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id

Parameters:

  • account_id

    Account ID

  • voicemail_id

    Voicemail ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/phone_com_client/api/voicemail_api.rb', line 28

def (, voicemail_id, opts = {})
  data, _status_code, _headers = (, voicemail_id, opts)
  data
end

#get_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) ⇒ Array<(VoicemailFull, Fixnum, Hash)>

This service shows the details of an individual voicemail. This service shows the details of an individual voicemail. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Get Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id

Parameters:

  • account_id

    Account ID

  • voicemail_id

    Voicemail ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VoicemailFull, Fixnum, Hash)>)

    VoicemailFull data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/phone_com_client/api/voicemail_api.rb', line 39

def (, voicemail_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoicemailApi.get_account_voicemail ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.get_account_voicemail"
  end
  # verify the required parameter 'voicemail_id' is set
  if @api_client.config.client_side_validation && voicemail_id.nil?
    fail ArgumentError, "Missing the required parameter 'voicemail_id' when calling VoicemailApi.get_account_voicemail"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/voicemail/{voicemail_id}'.sub('{' + 'account_id' + '}', .to_s).sub('{' + 'voicemail_id' + '}', voicemail_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['apiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'VoicemailFull')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VoicemailApi#get_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_account_voicemail(account_id, opts = {}) ⇒ ListVoicemail

Get a list of voicemail messages for an account. Get a list of voicemail messages for an account. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the List Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail

Parameters:

  • account_id

    Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filters_id (Array<String>)

    ID filter

  • :filters_from (String)

    Caller ID filter

  • :filters_to (String)

    Callee ID filter, the E.164 phone number to send the SMS TO. Note you must encode the + as %2B

  • :filters_is_new (BOOLEAN)
  • :filters_created_at (String)

    Date string representing the UTC time that sms was created

  • :filters_extension (Array<String>)

    Extension filter

  • :sort_id (String)

    ID sorting

  • :sort_created_at (String)

    Sort by the UTC time that voicemail was created

  • :limit (Integer)

    Max results

  • :offset (Integer)

    Results to skip

  • :fields (String)

    Field set

Returns:



98
99
100
101
# File 'lib/phone_com_client/api/voicemail_api.rb', line 98

def (, opts = {})
  data, _status_code, _headers = (, opts)
  data
end

#list_account_voicemail_with_http_info(account_id, opts = {}) ⇒ Array<(ListVoicemail, Fixnum, Hash)>

Get a list of voicemail messages for an account. Get a list of voicemail messages for an account. See Intro to Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the List Voicemail API with the following definition: GET api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail

Parameters:

  • account_id

    Account ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :filters_id (Array<String>)

    ID filter

  • :filters_from (String)

    Caller ID filter

  • :filters_to (String)

    Callee ID filter, the E.164 phone number to send the SMS TO. Note you must encode the + as %2B

  • :filters_is_new (BOOLEAN)
  • :filters_created_at (String)

    Date string representing the UTC time that sms was created

  • :filters_extension (Array<String>)

    Extension filter

  • :sort_id (String)

    ID sorting

  • :sort_created_at (String)

    Sort by the UTC time that voicemail was created

  • :limit (Integer)

    Max results

  • :offset (Integer)

    Results to skip

  • :fields (String)

    Field set

Returns:

  • (Array<(ListVoicemail, Fixnum, Hash)>)

    ListVoicemail data, response status code and response headers



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/phone_com_client/api/voicemail_api.rb', line 119

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoicemailApi.list_account_voicemail ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.list_account_voicemail"
  end
  if @api_client.config.client_side_validation && !opts[:'filters_from'].nil? && opts[:'filters_from'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/)
    fail ArgumentError, "invalid value for 'opts[:\"filters_from\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/."
  end

  if @api_client.config.client_side_validation && !opts[:'filters_to'].nil? && opts[:'filters_to'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/)
    fail ArgumentError, "invalid value for 'opts[:\"filters_to\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/."
  end

  if @api_client.config.client_side_validation && !opts[:'filters_created_at'].nil? && opts[:'filters_created_at'] !~ Regexp.new(/^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/)
    fail ArgumentError, "invalid value for 'opts[:\"filters_created_at\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /^eq:.*|^ne:.*|^lt:.*|^gt:.*|^lte:.*|^gte:.*|^starts-with:.*|^ends-with:.*|^contains:.*|^not-starts-with:.*|^not-ends-with:.*|^not-contains:.*|^between:.*,.*|^not-between:.*,.*/."
  end

  if @api_client.config.client_side_validation && !opts[:'sort_id'].nil? && opts[:'sort_id'] !~ Regexp.new(/asc|desc/)
    fail ArgumentError, "invalid value for 'opts[:\"sort_id\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /asc|desc/."
  end

  if @api_client.config.client_side_validation && !opts[:'sort_created_at'].nil? && opts[:'sort_created_at'] !~ Regexp.new(/asc|desc/)
    fail ArgumentError, "invalid value for 'opts[:\"sort_created_at\"]' when calling VoicemailApi.list_account_voicemail, must conform to the pattern /asc|desc/."
  end

  # resource path
  local_var_path = '/accounts/{account_id}/voicemail'.sub('{' + 'account_id' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'filters[id]'] = @api_client.build_collection_param(opts[:'filters_id'], :multi) if !opts[:'filters_id'].nil?
  query_params[:'filters[from]'] = opts[:'filters_from'] if !opts[:'filters_from'].nil?
  query_params[:'filters[to]'] = opts[:'filters_to'] if !opts[:'filters_to'].nil?
  query_params[:'filters[is_new]'] = opts[:'filters_is_new'] if !opts[:'filters_is_new'].nil?
  query_params[:'filters[created_at]'] = opts[:'filters_created_at'] if !opts[:'filters_created_at'].nil?
  query_params[:'filters[extension]'] = @api_client.build_collection_param(opts[:'filters_extension'], :multi) if !opts[:'filters_extension'].nil?
  query_params[:'sort[id]'] = opts[:'sort_id'] if !opts[:'sort_id'].nil?
  query_params[:'sort[created_at]'] = opts[:'sort_created_at'] if !opts[:'sort_created_at'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['apiKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListVoicemail')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VoicemailApi#list_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_account_voicemail(account_id, voicemail_id, opts = {}) ⇒ VoicemailFull

Update the is_new parameter in a voicemail record. Update the is_new parameter in a voicemail record. See Account Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Patch Voicemail API with the following definition: PATCH api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id

Parameters:

  • account_id

    Account ID

  • voicemail_id

    Voicemail ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



196
197
198
199
# File 'lib/phone_com_client/api/voicemail_api.rb', line 196

def (, voicemail_id, opts = {})
  data, _status_code, _headers = (, voicemail_id, opts)
  data
end

#patch_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) ⇒ Array<(VoicemailFull, Fixnum, Hash)>

Update the is_new parameter in a voicemail record. Update the is_new parameter in a voicemail record. See Account Voicemail for more info on the properties. Note: This API is for users with Account Owner scope access token. Users with Extension User scope token should invoke the Patch Voicemail API with the following definition: PATCH api.phone.com/v4/accounts/:account_id/extensions/:extension_id/voicemail/:voicemail_id

Parameters:

  • account_id

    Account ID

  • voicemail_id

    Voicemail ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(VoicemailFull, Fixnum, Hash)>)

    VoicemailFull data, response status code and response headers



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/phone_com_client/api/voicemail_api.rb', line 208

def (, voicemail_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VoicemailApi.patch_account_voicemail ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling VoicemailApi.patch_account_voicemail"
  end
  # verify the required parameter 'voicemail_id' is set
  if @api_client.config.client_side_validation && voicemail_id.nil?
    fail ArgumentError, "Missing the required parameter 'voicemail_id' when calling VoicemailApi.patch_account_voicemail"
  end
  # resource path
  local_var_path = '/accounts/{account_id}/voicemail/{voicemail_id}'.sub('{' + 'account_id' + '}', .to_s).sub('{' + 'voicemail_id' + '}', voicemail_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'data'])
  auth_names = ['apiKey']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'VoicemailFull')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VoicemailApi#patch_account_voicemail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end