class Twilio::REST::Api::V2010::AccountContext::ConnectAppContext

Public Class Methods

new(version, account_sid, sid) click to toggle source

Initialize the ConnectAppContext @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the
ConnectApp resource to fetch.

@param [String] sid The Twilio-provided string that uniquely identifies the

ConnectApp resource to fetch.

@return [ConnectAppContext] ConnectAppContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/api/v2010/account/connect_app.rb
156 def initialize(version, account_sid, sid)
157   super(version)
158 
159   # Path Solution
160   @solution = {account_sid: account_sid, sid: sid, }
161   @uri = "/Accounts/#{@solution[:account_sid]}/ConnectApps/#{@solution[:sid]}.json"
162 end

Public Instance Methods

delete() click to toggle source

Delete the ConnectAppInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/connect_app.rb
221 def delete
222    @version.delete('DELETE', @uri)
223 end
fetch() click to toggle source

Fetch the ConnectAppInstance @return [ConnectAppInstance] Fetched ConnectAppInstance

    # File lib/twilio-ruby/rest/api/v2010/account/connect_app.rb
167 def fetch
168   payload = @version.fetch('GET', @uri)
169 
170   ConnectAppInstance.new(
171       @version,
172       payload,
173       account_sid: @solution[:account_sid],
174       sid: @solution[:sid],
175   )
176 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/connect_app.rb
234 def inspect
235   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
236   "#<Twilio.Api.V2010.ConnectAppContext #{context}>"
237 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/connect_app.rb
227 def to_s
228   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
229   "#<Twilio.Api.V2010.ConnectAppContext #{context}>"
230 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) click to toggle source

Update the ConnectAppInstance @param [String] authorize_redirect_url The URL to redirect the user to after we

authenticate the user and obtain authorization to access the Connect App.

@param [String] company_name The company name to set for the Connect App. @param [String] deauthorize_callback_method The HTTP method to use when calling

`deauthorize_callback_url`.

@param [String] deauthorize_callback_url The URL to call using the

`deauthorize_callback_method` to de-authorize the Connect App.

@param [String] description A description of the Connect App. @param [String] friendly_name A descriptive string that you create to describe

the resource. It can be up to 64 characters long.

@param [String] homepage_url A public URL where users can obtain more

information about this Connect App.

@param [Array] permissions A comma-separated list of the

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

@return [ConnectAppInstance] Updated ConnectAppInstance

    # File lib/twilio-ruby/rest/api/v2010/account/connect_app.rb
196 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)
197   data = Twilio::Values.of({
198       'AuthorizeRedirectUrl' => authorize_redirect_url,
199       'CompanyName' => company_name,
200       'DeauthorizeCallbackMethod' => deauthorize_callback_method,
201       'DeauthorizeCallbackUrl' => deauthorize_callback_url,
202       'Description' => description,
203       'FriendlyName' => friendly_name,
204       'HomepageUrl' => homepage_url,
205       'Permissions' => Twilio.serialize_list(permissions) { |e| e },
206   })
207 
208   payload = @version.update('POST', @uri, data: data)
209 
210   ConnectAppInstance.new(
211       @version,
212       payload,
213       account_sid: @solution[:account_sid],
214       sid: @solution[:sid],
215   )
216 end