Class: Telnyx::Resources::PhoneNumbers::Voicemail
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumbers::Voicemail
- Defined in:
- lib/telnyx/resources/phone_numbers/voicemail.rb
Overview
Voicemail API
Instance Method Summary collapse
-
#create(phone_number_id, enabled: nil, pin: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailCreateResponse
Create voicemail settings for a phone number.
-
#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, pin: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailUpdateResponse
Update voicemail settings for a phone number.
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.
83 84 85 |
# File 'lib/telnyx/resources/phone_numbers/voicemail.rb', line 83 def initialize(client:) @client = client end |
Instance Method Details
#create(phone_number_id, enabled: nil, pin: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailCreateResponse
Create voicemail settings for a phone number
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/telnyx/resources/phone_numbers/voicemail.rb', line 23 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
45 46 47 48 49 50 51 52 |
# File 'lib/telnyx/resources/phone_numbers/voicemail.rb', line 45 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, pin: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoicemailUpdateResponse
Update voicemail settings for a phone number
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/telnyx/resources/phone_numbers/voicemail.rb', line 69 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 |