class PhoneComClient::VoicemailApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/phone_com_client/api/voicemail_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_account_voicemail(account_id, voicemail_id, opts = {}) click to toggle source

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 @param account_id Account ID @param voicemail_id Voicemail ID @param [Hash] opts the optional parameters @return [VoicemailFull]

# File lib/phone_com_client/api/voicemail_api.rb, line 28
def get_account_voicemail(account_id, voicemail_id, opts = {})
  data, _status_code, _headers = get_account_voicemail_with_http_info(account_id, voicemail_id, opts)
  data
end
get_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) click to toggle source

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 @param account_id Account ID @param voicemail_id Voicemail ID @param [Hash] opts the optional parameters @return [Array<(VoicemailFull, Fixnum, Hash)>] VoicemailFull data, response status code and response headers

# File lib/phone_com_client/api/voicemail_api.rb, line 39
def get_account_voicemail_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

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 @param account_id Account ID @param [Hash] opts the optional parameters @option opts [Array<String>] :filters_id ID filter @option opts [String] :filters_from Caller ID filter @option opts [String] :filters_to Callee ID filter, the E.164 phone number to send the SMS TO. Note you must encode the + as %2B @option opts [BOOLEAN] :filters_is_new @option opts [String] :filters_created_at Date string representing the UTC time that sms was created @option opts [Array<String>] :filters_extension Extension filter @option opts [String] :sort_id ID sorting @option opts [String] :sort_created_at Sort by the UTC time that voicemail was created @option opts [Integer] :limit Max results @option opts [Integer] :offset Results to skip @option opts [String] :fields Field set @return [ListVoicemail]

# File lib/phone_com_client/api/voicemail_api.rb, line 98
def list_account_voicemail(account_id, opts = {})
  data, _status_code, _headers = list_account_voicemail_with_http_info(account_id, opts)
  data
end
list_account_voicemail_with_http_info(account_id, opts = {}) click to toggle source

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 @param account_id Account ID @param [Hash] opts the optional parameters @option opts [Array<String>] :filters_id ID filter @option opts [String] :filters_from Caller ID filter @option opts [String] :filters_to Callee ID filter, the E.164 phone number to send the SMS TO. Note you must encode the + as %2B @option opts [BOOLEAN] :filters_is_new @option opts [String] :filters_created_at Date string representing the UTC time that sms was created @option opts [Array<String>] :filters_extension Extension filter @option opts [String] :sort_id ID sorting @option opts [String] :sort_created_at Sort by the UTC time that voicemail was created @option opts [Integer] :limit Max results @option opts [Integer] :offset Results to skip @option opts [String] :fields Field set @return [Array<(ListVoicemail, Fixnum, Hash)>] ListVoicemail data, response status code and response headers

# File lib/phone_com_client/api/voicemail_api.rb, line 119
def list_account_voicemail_with_http_info(account_id, 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 && account_id.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' + '}', 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 = {}) click to toggle source

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 @param account_id Account ID @param voicemail_id Voicemail ID @param [Hash] opts the optional parameters @option opts [PatchVoicemailParams] :data Payment data @return [VoicemailFull]

# File lib/phone_com_client/api/voicemail_api.rb, line 196
def patch_account_voicemail(account_id, voicemail_id, opts = {})
  data, _status_code, _headers = patch_account_voicemail_with_http_info(account_id, voicemail_id, opts)
  data
end
patch_account_voicemail_with_http_info(account_id, voicemail_id, opts = {}) click to toggle source

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 @param account_id Account ID @param voicemail_id Voicemail ID @param [Hash] opts the optional parameters @option opts [PatchVoicemailParams] :data Payment data @return [Array<(VoicemailFull, Fixnum, Hash)>] VoicemailFull data, response status code and response headers

# File lib/phone_com_client/api/voicemail_api.rb, line 208
def patch_account_voicemail_with_http_info(account_id, 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 && account_id.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' + '}', 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