Class: Twilio::REST::Oauth::V1::AuthorizeList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/oauth/v1/authorize.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ AuthorizeList

Initialize the AuthorizeList

Parameters:

  • Version that contains the resource



26
27
28
29
30
31
32
33
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 26

def initialize(version)
    super(version)
    
    # Path Solution
    @solution = {  }
    @uri = "/authorize"
    
end

Instance Method Details

#fetch(response_type: :unset, client_id: :unset, redirect_uri: :unset, scope: :unset, state: :unset) ⇒ AuthorizeInstance

Fetch the AuthorizeInstance

Parameters:

  • (defaults to: :unset)

    Response Type

  • (defaults to: :unset)

    The Client Identifier

  • (defaults to: :unset)

    The url to which response will be redirected to

  • (defaults to: :unset)

    The scope of the access request

  • (defaults to: :unset)

    An opaque value which can be used to maintain state between the request and callback

Returns:

  • Fetched AuthorizeInstance



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 42

def fetch(
    response_type: :unset, 
    client_id: :unset, 
    redirect_uri: :unset, 
    scope: :unset, 
    state: :unset
)

    params = Twilio::Values.of({
        'ResponseType' => response_type,
        'ClientId' => client_id,
        'RedirectUri' => redirect_uri,
        'Scope' => scope,
        'State' => state,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, params: params, headers: headers)
    AuthorizeInstance.new(
        @version,
        payload,
    )
end

#fetch_with_metadata(response_type: :unset, client_id: :unset, redirect_uri: :unset, scope: :unset, state: :unset) ⇒ AuthorizeInstance

Fetch the AuthorizeInstanceMetadata

Parameters:

  • (defaults to: :unset)

    Response Type

  • (defaults to: :unset)

    The Client Identifier

  • (defaults to: :unset)

    The url to which response will be redirected to

  • (defaults to: :unset)

    The scope of the access request

  • (defaults to: :unset)

    An opaque value which can be used to maintain state between the request and callback

Returns:

  • Fetched AuthorizeInstance



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 78

def (
  response_type: :unset, 
  client_id: :unset, 
  redirect_uri: :unset, 
  scope: :unset, 
  state: :unset
)

    params = Twilio::Values.of({
        'ResponseType' => response_type,
        'ClientId' => client_id,
        'RedirectUri' => redirect_uri,
        'Scope' => scope,
        'State' => state,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    authorize_instance = AuthorizeInstance.new(
        @version,
        response.body,
    )
    .new(
        @version,
        authorize_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



116
117
118
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 116

def to_s
    '#<Twilio.Oauth.V1.AuthorizeList>'
end