Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::RegulationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ RegulationInstance

Initialize the RegulationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The unique string that identifies the Regulation resource.


217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 217

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'friendly_name' => payload['friendly_name'],
      'iso_country' => payload['iso_country'],
      'number_type' => payload['number_type'],
      'end_user_type' => payload['end_user_type'],
      'requirements' => payload['requirements'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'sid' => sid || @properties['sid'], }
end

Instance Method Details

#contextRegulationContext

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

Returns:


240
241
242
243
244
245
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 240

def context
  unless @instance_context
    @instance_context = RegulationContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#end_user_typeregulation.EndUserType

Returns The type of End User of the Regulation resource.

Returns:

  • (regulation.EndUserType)

    The type of End User of the Regulation resource


273
274
275
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 273

def end_user_type
  @properties['end_user_type']
end

#fetchRegulationInstance

Fetch the RegulationInstance

Returns:


292
293
294
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 292

def fetch
  context.fetch
end

#friendly_nameString

Returns A human-readable description of the Regulation resource.

Returns:

  • (String)

    A human-readable description of the Regulation resource


255
256
257
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 255

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation


305
306
307
308
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 305

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

#iso_countryString

Returns The ISO country code of the phone number's country.

Returns:

  • (String)

    The ISO country code of the phone number's country


261
262
263
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 261

def iso_country
  @properties['iso_country']
end

#number_typeString

Returns The type of phone number restricted by the regulatory requirement.

Returns:

  • (String)

    The type of phone number restricted by the regulatory requirement


267
268
269
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 267

def number_type
  @properties['number_type']
end

#requirementsHash

Returns The sid of a regulation object that dictates requirements.

Returns:

  • (Hash)

    The sid of a regulation object that dictates requirements


279
280
281
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 279

def requirements
  @properties['requirements']
end

#sidString

Returns The unique string that identifies the Regulation resource.

Returns:

  • (String)

    The unique string that identifies the Regulation resource


249
250
251
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 249

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


298
299
300
301
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 298

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Numbers.V2.RegulationInstance #{values}>"
end

#urlString

Returns The absolute URL of the Regulation resource.

Returns:

  • (String)

    The absolute URL of the Regulation resource


285
286
287
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 285

def url
  @properties['url']
end