class Twilio::REST::Numbers::V2::RegulatoryComplianceList::RegulationInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the RegulationInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The unique string that identifies the Regulation resource. @return [RegulationInstance] RegulationInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
217 def initialize(version, payload, sid: nil)
218   super(version)
219 
220   # Marshaled Properties
221   @properties = {
222       'sid' => payload['sid'],
223       'friendly_name' => payload['friendly_name'],
224       'iso_country' => payload['iso_country'],
225       'number_type' => payload['number_type'],
226       'end_user_type' => payload['end_user_type'],
227       'requirements' => payload['requirements'],
228       'url' => payload['url'],
229   }
230 
231   # Context
232   @instance_context = nil
233   @params = {'sid' => sid || @properties['sid'], }
234 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [RegulationContext] RegulationContext for this RegulationInstance

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
240 def context
241   unless @instance_context
242     @instance_context = RegulationContext.new(@version, @params['sid'], )
243   end
244   @instance_context
245 end
end_user_type() click to toggle source

@return [regulation.EndUserType] The type of End User of the Regulation resource

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
273 def end_user_type
274   @properties['end_user_type']
275 end
fetch() click to toggle source

Fetch the RegulationInstance @return [RegulationInstance] Fetched RegulationInstance

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
292 def fetch
293   context.fetch
294 end
friendly_name() click to toggle source

@return [String] A human-readable description of the Regulation resource

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
255 def friendly_name
256   @properties['friendly_name']
257 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
305 def inspect
306   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
307   "<Twilio.Numbers.V2.RegulationInstance #{values}>"
308 end
iso_country() click to toggle source

@return [String] The ISO country code of the phone number's country

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
261 def iso_country
262   @properties['iso_country']
263 end
number_type() click to toggle source

@return [String] The type of phone number restricted by the regulatory requirement

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
267 def number_type
268   @properties['number_type']
269 end
requirements() click to toggle source

@return [Hash] The sid of a regulation object that dictates requirements

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
279 def requirements
280   @properties['requirements']
281 end
sid() click to toggle source

@return [String] The unique string that identifies the Regulation resource

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
249 def sid
250   @properties['sid']
251 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
298 def to_s
299   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
300   "<Twilio.Numbers.V2.RegulationInstance #{values}>"
301 end
url() click to toggle source

@return [String] The absolute URL of the Regulation resource

    # File lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb
285 def url
286   @properties['url']
287 end