Class: Twilio::REST::Iam::V1::OAuthAppInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/iam/v1/o_auth_app.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the OAuthAppInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 494

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'type' => payload['type'],
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'description' => payload['description'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'created_by' => payload['created_by'],
        'secret' => payload['secret'],
        'status' => payload['status'],
        'policy' => payload['policy'],
        'access_token_ttl' => payload['access_token_ttl'] == nil ? payload['access_token_ttl'] : payload['access_token_ttl'].to_i,
        'code' => payload['code'],
        'message' => payload['message'],
        'more_info' => payload['more_info'],
    }

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

Instance Method Details

#access_token_ttlString

Returns:

  • (String)


587
588
589
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 587

def access_token_ttl
    @properties['access_token_ttl']
end

#codeString

Returns Twilio-specific error code.

Returns:

  • (String)

    Twilio-specific error code



593
594
595
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 593

def code
    @properties['code']
end

#contextOAuthAppContext

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

Returns:



524
525
526
527
528
529
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 524

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

#created_byString

Returns:

  • (String)


563
564
565
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 563

def created_by
    @properties['created_by']
end

#date_createdTime

Returns:

  • (Time)


557
558
559
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 557

def date_created
    @properties['date_created']
end

#deleteBoolean

Delete the OAuthAppInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



612
613
614
615
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 612

def delete

    context.delete
end

#descriptionString

Returns:

  • (String)


551
552
553
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 551

def description
    @properties['description']
end

#friendly_nameString

Returns:

  • (String)


545
546
547
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 545

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



637
638
639
640
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 637

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

#messageString

Returns Error message.

Returns:

  • (String)

    Error message



599
600
601
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 599

def message
    @properties['message']
end

#more_infoString

Returns Link to Error Code References.

Returns:

  • (String)

    Link to Error Code References



605
606
607
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 605

def more_info
    @properties['more_info']
end

#policyIamV1OrganizationVendoroauthappPolicy

Returns:

  • (IamV1OrganizationVendoroauthappPolicy)


581
582
583
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 581

def policy
    @properties['policy']
end

#secretString

Returns:

  • (String)


569
570
571
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 569

def secret
    @properties['secret']
end

#sidString

Returns:

  • (String)


539
540
541
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 539

def sid
    @properties['sid']
end

#statusString

Returns:

  • (String)


575
576
577
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 575

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



630
631
632
633
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 630

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

#typeString

Returns:

  • (String)


533
534
535
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 533

def type
    @properties['type']
end

#update(iam_v1_account_vendor_oauth_app_update_request: nil) ⇒ OAuthAppInstance

Update the OAuthAppInstance

Parameters:

  • iam_v1_account_vendor_oauth_app_update_request (IamV1AccountVendorOauthAppUpdateRequest) (defaults to: nil)

Returns:



621
622
623
624
625
626
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 621

def update(iam_v1_account_vendor_oauth_app_update_request: nil
)

    context.update(
    )
end