Class: Twilio::REST::Voice::V1::DialingPermissionsList::SettingsInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ SettingsInstance

Initialize the SettingsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Settings resource.

  • sid (String)

    The SID of the Call resource to fetch.



156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 156

def initialize(version, payload )
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'dialing_permissions_inheritance' => payload['dialing_permissions_inheritance'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = {  }
end

Instance Method Details

#contextSettingsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



174
175
176
177
178
179
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 174

def context
    unless @instance_context
        @instance_context = SettingsContext.new(@version )
    end
    @instance_context
end

#dialing_permissions_inheritanceBoolean

Returns ‘true` if the sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`.

Returns:

  • (Boolean)

    ‘true` if the sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`.



183
184
185
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 183

def dialing_permissions_inheritance
    @properties['dialing_permissions_inheritance']
end

#fetchSettingsInstance

Fetch the SettingsInstance

Returns:



196
197
198
199
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 196

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



223
224
225
226
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 223

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Voice.V1.SettingsInstance #{values}>"
end

#to_sObject

Provide a user friendly representation



216
217
218
219
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 216

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Voice.V1.SettingsInstance #{values}>"
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:



205
206
207
208
209
210
211
212
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 205

def update(
    dialing_permissions_inheritance: :unset
)

    context.update(
        dialing_permissions_inheritance: dialing_permissions_inheritance, 
    )
end

#urlString

Returns The absolute URL of this resource.

Returns:

  • (String)

    The absolute URL of this resource.



189
190
191
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 189

def url
    @properties['url']
end