Class: Twilio::REST::Api::V2010::AccountContext::ConnectAppInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/connect_app.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, sid: nil) ⇒ ConnectAppInstance

Initialize the ConnectAppInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this ConnectApp resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 263

def initialize(version, payload , account_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'authorize_redirect_url' => payload['authorize_redirect_url'],
        'company_name' => payload['company_name'],
        'deauthorize_callback_method' => payload['deauthorize_callback_method'],
        'deauthorize_callback_url' => payload['deauthorize_callback_url'],
        'description' => payload['description'],
        'friendly_name' => payload['friendly_name'],
        'homepage_url' => payload['homepage_url'],
        'permissions' => payload['permissions'],
        'sid' => payload['sid'],
        'uri' => payload['uri'],
    }

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the ConnectApp resource.

Returns:



299
300
301
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 299

def 
    @properties['account_sid']
end

#authorize_redirect_urlString

Returns The URL we redirect the user to after we authenticate the user and obtain authorization to access the Connect App.

Returns:

  • (String)

    The URL we redirect the user to after we authenticate the user and obtain authorization to access the Connect App.



305
306
307
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 305

def authorize_redirect_url
    @properties['authorize_redirect_url']
end

#company_nameString

Returns The company name set for the Connect App.

Returns:

  • (String)

    The company name set for the Connect App.



311
312
313
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 311

def company_name
    @properties['company_name']
end

#contextConnectAppContext

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

Returns:



290
291
292
293
294
295
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 290

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

#deauthorize_callback_methodString

Returns The HTTP method we use to call ‘deauthorize_callback_url`.

Returns:

  • (String)

    The HTTP method we use to call ‘deauthorize_callback_url`.



317
318
319
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 317

def deauthorize_callback_method
    @properties['deauthorize_callback_method']
end

#deauthorize_callback_urlString

Returns The URL we call using the ‘deauthorize_callback_method` to de-authorize the Connect App.

Returns:

  • (String)

    The URL we call using the ‘deauthorize_callback_method` to de-authorize the Connect App.



323
324
325
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 323

def deauthorize_callback_url
    @properties['deauthorize_callback_url']
end

#deleteBoolean

Delete the ConnectAppInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



366
367
368
369
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 366

def delete

    context.delete
end

#descriptionString

Returns The description of the Connect App.

Returns:

  • (String)

    The description of the Connect App.



329
330
331
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 329

def description
    @properties['description']
end

#fetchConnectAppInstance

Fetch the ConnectAppInstance

Returns:



374
375
376
377
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 374

def fetch

    context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource.



335
336
337
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 335

def friendly_name
    @properties['friendly_name']
end

#homepage_urlString

Returns The public URL where users can obtain more information about this Connect App.

Returns:

  • (String)

    The public URL where users can obtain more information about this Connect App.



341
342
343
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 341

def homepage_url
    @properties['homepage_url']
end

#inspectObject

Provide a detailed, user friendly representation



422
423
424
425
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 422

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

#permissionsArray<Permission>

Returns The set of permissions that your ConnectApp requests.

Returns:

  • (Array<Permission>)

    The set of permissions that your ConnectApp requests.



347
348
349
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 347

def permissions
    @properties['permissions']
end

#sidString

Returns The unique string that that we created to identify the ConnectApp resource.

Returns:

  • (String)

    The unique string that that we created to identify the ConnectApp resource.



353
354
355
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 353

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



415
416
417
418
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 415

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

#update(authorize_redirect_url: :unset, company_name: :unset, deauthorize_callback_method: :unset, deauthorize_callback_url: :unset, description: :unset, friendly_name: :unset, homepage_url: :unset, permissions: :unset) ⇒ ConnectAppInstance

Update the ConnectAppInstance

Parameters:

  • authorize_redirect_url (String) (defaults to: :unset)

    The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App.

  • company_name (String) (defaults to: :unset)

    The company name to set for the Connect App.

  • deauthorize_callback_method (String) (defaults to: :unset)

    The HTTP method to use when calling ‘deauthorize_callback_url`.

  • deauthorize_callback_url (String) (defaults to: :unset)

    The URL to call using the ‘deauthorize_callback_method` to de-authorize the Connect App.

  • description (String) (defaults to: :unset)

    A description of the Connect App.

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

    A descriptive string that you create to describe the resource. It can be up to 64 characters long.

  • homepage_url (String) (defaults to: :unset)

    A public URL where users can obtain more information about this Connect App.

  • permissions (Array[Permission]) (defaults to: :unset)

    A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: ‘get-all` and `post-all`.

Returns:



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 390

def update(
    authorize_redirect_url: :unset, 
    company_name: :unset, 
    deauthorize_callback_method: :unset, 
    deauthorize_callback_url: :unset, 
    description: :unset, 
    friendly_name: :unset, 
    homepage_url: :unset, 
    permissions: :unset
)

    context.update(
        authorize_redirect_url: authorize_redirect_url, 
        company_name: company_name, 
        deauthorize_callback_method: deauthorize_callback_method, 
        deauthorize_callback_url: deauthorize_callback_url, 
        description: description, 
        friendly_name: friendly_name, 
        homepage_url: homepage_url, 
        permissions: permissions, 
    )
end

#uriString

Returns The URI of the resource, relative to ‘api.twilio.com`.

Returns:

  • (String)

    The URI of the resource, relative to ‘api.twilio.com`.



359
360
361
# File 'lib/twilio-ruby/rest/api/v2010/account/connect_app.rb', line 359

def uri
    @properties['uri']
end