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

Inherits:
InstanceResource
  • 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, payload) ⇒ SettingsInstance

Initialize the SettingsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio


126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 126

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:


144
145
146
147
148
149
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 144

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`


153
154
155
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 153

def dialing_permissions_inheritance
  @properties['dialing_permissions_inheritance']
end

#fetchSettingsInstance

Fetch the SettingsInstance

Returns:


166
167
168
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 166

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#to_sObject

Provide a user friendly representation


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

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:


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

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


159
160
161
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb', line 159

def url
  @properties['url']
end