Class: Twilio::REST::Routes::V3::IsoCountryCodeInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/routes/v3/iso_country_code.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, iso_country_code: nil, short_code: nil) ⇒ IsoCountryCodeInstance

Initialize the IsoCountryCodeInstance

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 IsoCountryCode resource.

  • sid (String) —

    The SID of the Call resource to fetch.



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 279

def initialize(version, payload , iso_country_code: nil, short_code: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'iso_country_code' => payload['iso_country_code'],
        'short_code' => payload['short_code'],
        'url' => payload['url'],
        'account_sid' => payload['account_sid'],
        'friendly_name' => payload['friendly_name'],
        'messaging_region' => payload['messaging_region'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
    }

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

Instance Method Details

#account_sid ⇒ String

Returns The unique SID identifier of the Account.

Returns:

  • (String) —

    The unique SID identifier of the Account.



332
333
334
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 332

def 
    @properties['account_sid']
end

#context ⇒ IsoCountryCodeContext

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

Returns:



305
306
307
308
309
310
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 305

def context
    unless @instance_context
        @instance_context = IsoCountryCodeContext.new(@version , @params['iso_country_code'], @params['short_code'])
    end
    @instance_context
end

#date_created ⇒ Time

Returns The date that this short code was assigned an Inbound Processing Region, given in ISO 8601 format.

Returns:

  • (Time) —

    The date that this short code was assigned an Inbound Processing Region, given in ISO 8601 format.



350
351
352
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 350

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date that the Inbound Processing Region was updated for this short code, given in ISO 8601 format.

Returns:

  • (Time) —

    The date that the Inbound Processing Region was updated for this short code, given in ISO 8601 format.



356
357
358
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 356

def date_updated
    @properties['date_updated']
end

#fetch ⇒ IsoCountryCodeInstance

Fetch the IsoCountryCodeInstance

Returns:



363
364
365
366
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 363

def fetch

    context.fetch
end

#friendly_name ⇒ String

Returns A human readable description of the Inbound Processing Region assignment for this short code, up to 64 characters.

Returns:

  • (String) —

    A human readable description of the Inbound Processing Region assignment for this short code, up to 64 characters.



338
339
340
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 338

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



393
394
395
396
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 393

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

#iso_country_code ⇒ String

Returns The ISO country code of the short code.

Returns:

  • (String) —

    The ISO country code of the short code



314
315
316
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 314

def iso_country_code
    @properties['iso_country_code']
end

#messaging_region ⇒ String

Returns The Inbound Processing Region used for this short code for messaging.

Returns:

  • (String) —

    The Inbound Processing Region used for this short code for messaging.



344
345
346
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 344

def messaging_region
    @properties['messaging_region']
end

#short_code ⇒ String

Returns The short code.

Returns:

  • (String) —

    The short code



320
321
322
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 320

def short_code
    @properties['short_code']
end

#to_s ⇒ Object

Provide a user friendly representation



386
387
388
389
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 386

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

#update(messaging_region: :unset, friendly_name: :unset) ⇒ IsoCountryCodeInstance

Update the IsoCountryCodeInstance

Parameters:

  • messaging_region (String) (defaults to: :unset) —

    The Processing Region used for this short code for messaging

  • friendly_name (String) (defaults to: :unset) —

    A human readable description of this resource, up to 64 characters.

Returns:



373
374
375
376
377
378
379
380
381
382
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 373

def update(
  messaging_region: :unset, 
  friendly_name: :unset
)

    context.update(
        messaging_region: messaging_region, 
        friendly_name: friendly_name, 
    )
end

#url ⇒ String

Returns The absolute URL of the resource.

Returns:

  • (String) —

    The absolute URL of the resource.



326
327
328
# File 'lib/twilio-ruby/rest/routes/v3/iso_country_code.rb', line 326

def url
    @properties['url']
end