Class: Twilio::REST::Voice::V1::DialingPermissionsList::SettingsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ SettingsContext

Initialize the SettingsContext

Parameters:

  • version (Version)

    Version that contains the resource


73
74
75
76
77
78
79
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 73

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}
  @uri = "/Settings"
end

Instance Method Details

#fetchSettingsInstance

Fetch the SettingsInstance

Returns:


84
85
86
87
88
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 84

def fetch
  payload = @version.fetch('GET', @uri)

  SettingsInstance.new(@version, payload, )
end

#inspectObject

Provide a detailed, user friendly representation


112
113
114
115
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 112

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Voice.V1.SettingsContext #{context}>"
end

#to_sObject

Provide a user friendly representation


105
106
107
108
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 105

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Voice.V1.SettingsContext #{context}>"
end

#update(dialing_permissions_inheritance: :unset) ⇒ SettingsInstance

Update the SettingsInstance

Parameters:

  • dialing_permissions_inheritance (Boolean) (defaults to: :unset)

    `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`.

Returns:


95
96
97
98
99
100
101
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 95

def update(dialing_permissions_inheritance: :unset)
  data = Twilio::Values.of({'DialingPermissionsInheritance' => dialing_permissions_inheritance, })

  payload = @version.update('POST', @uri, data: data)

  SettingsInstance.new(@version, payload, )
end