Class: Telnyx::Resources::PhoneNumbers::Voicemail
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumbers::Voicemail
- Defined in:
- lib/telnyx/resources/phone_numbers/voicemail.rb,
sig/telnyx/resources/phone_numbers/voicemail.rbs
Overview
Voicemail API
Instance Method Summary collapse
-
#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.
-
#initialize(client:) ⇒ Voicemail
constructor
private
A new instance of Voicemail.
-
#retrieve(phone_number_id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailRetrieveResponse
Returns the voicemail settings for a phone number.
-
#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.
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.
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.
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, = 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: ) end |
#retrieve(phone_number_id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailRetrieveResponse
Returns the voicemail settings for a phone number
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.
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, = 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: ) end |