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

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

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ SettingsContext

Initialize the SettingsContext

Parameters:

  • version (Version)

    Version that contains the resource



50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 50

def initialize(version)
    super(version)

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

    
end

Instance Method Details

#fetchSettingsInstance

Fetch the SettingsInstance

Returns:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 62

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    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:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 81

def update(
    dialing_permissions_inheritance: :unset
)

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

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    SettingsInstance.new(
        @version,
        payload,
    )
end