Class: Telnyx::Resources::PhoneNumbers::Voicemail

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/phone_numbers/voicemail.rb,
sig/telnyx/resources/phone_numbers/voicemail.rbs

Overview

Voicemail API

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Voicemail

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 Voicemail.

Parameters:



99
100
101
# File 'lib/telnyx/resources/phone_numbers/voicemail.rb', line 99

def initialize(client:)
  @client = client
end

Instance Method Details

#create(phone_number_id, enabled: nil, greeting: nil, pin: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailCreateResponse

Some parameter documentations has been truncated, see Models::PhoneNumbers::VoicemailCreateParams for more details.

Create voicemail settings for a phone number. You can also configure a custom greeting by setting the greeting object: use mode custom_greeting together with a media_name that points to an audio file uploaded through the Media Storage API, or mode default to use the standard system greeting.

Parameters:

Returns:

See Also:



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

def create(phone_number_id, params = {})
  parsed, options = Telnyx::PhoneNumbers::VoicemailCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["phone_numbers/%1$s/voicemail", phone_number_id],
    body: parsed,
    model: Telnyx::Models::PhoneNumbers::VoicemailCreateResponse,
    options: options
  )
end

#retrieve(phone_number_id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailRetrieveResponse

Returns the voicemail settings for a phone number

Parameters:

  • phone_number_id (String)

    The ID of the phone number.

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

Returns:

See Also:



53
54
55
56
57
58
59
60
# File 'lib/telnyx/resources/phone_numbers/voicemail.rb', line 53

def retrieve(phone_number_id, params = {})
  @client.request(
    method: :get,
    path: ["phone_numbers/%1$s/voicemail", phone_number_id],
    model: Telnyx::Models::PhoneNumbers::VoicemailRetrieveResponse,
    options: params[:request_options]
  )
end

#update(phone_number_id, enabled: nil, greeting: nil, pin: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailUpdateResponse

Some parameter documentations has been truncated, see Models::PhoneNumbers::VoicemailUpdateParams for more details.

Update voicemail settings for a phone number. You can also configure a custom greeting by setting the greeting object: use mode custom_greeting together with a media_name that points to an audio file uploaded through the Media Storage API, or mode default to use the standard system greeting.

Parameters:

Returns:

See Also:



85
86
87
88
89
90
91
92
93
94
# File 'lib/telnyx/resources/phone_numbers/voicemail.rb', line 85

def update(phone_number_id, params = {})
  parsed, options = Telnyx::PhoneNumbers::VoicemailUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["phone_numbers/%1$s/voicemail", phone_number_id],
    body: parsed,
    model: Telnyx::Models::PhoneNumbers::VoicemailUpdateResponse,
    options: options
  )
end