Class: Auth0::TokenExchangeProfiles::Client
- Inherits:
-
Object
- Object
- Auth0::TokenExchangeProfiles::Client
- Defined in:
- lib/auth0/token_exchange_profiles/client.rb
Instance Method Summary collapse
-
#create(request_options: {}, **params) ⇒ Auth0::Types::CreateTokenExchangeProfileResponseContent
Create a new Token Exchange Profile within your tenant.
-
#delete(request_options: {}, **params) ⇒ untyped
Delete a Token Exchange Profile within your tenant.
-
#get(request_options: {}, **params) ⇒ Auth0::Types::GetTokenExchangeProfileResponseContent
Retrieve details about a single Token Exchange Profile specified by ID.
- #initialize(client:) ⇒ void constructor
-
#list(request_options: {}, **params) ⇒ Auth0::Types::ListTokenExchangeProfileResponseContent
Retrieve a list of all Token Exchange Profiles available in your tenant.
-
#update(request_options: {}, **params) ⇒ untyped
Update a Token Exchange Profile within your tenant.
Constructor Details
#initialize(client:) ⇒ void
9 10 11 |
# File 'lib/auth0/token_exchange_profiles/client.rb', line 9 def initialize(client:) @client = client end |
Instance Method Details
#create(request_options: {}, **params) ⇒ Auth0::Types::CreateTokenExchangeProfileResponseContent
Create a new Token Exchange Profile within your tenant.
By using this feature, you agree to the applicable Free Trial terms in <a href=“www.okta.com/legal/”>Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href=“auth0.com/docs/authenticate/custom-token-exchange”>User Guide</a> for more details.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/auth0/token_exchange_profiles/client.rb', line 94 def create(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "token-exchange-profiles", body: Auth0::TokenExchangeProfiles::Types::CreateTokenExchangeProfileRequestContent.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Auth0::Types::CreateTokenExchangeProfileResponseContent.load(response.body) else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete(request_options: {}, **params) ⇒ untyped
Delete a Token Exchange Profile within your tenant.
By using this feature, you agree to the applicable Free Trial terms in <a href=“www.okta.com/legal/”>Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href=“auth0.com/docs/authenticate/custom-token-exchange”>User Guide</a> for more details.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/auth0/token_exchange_profiles/client.rb', line 174 def delete(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "token-exchange-profiles/#{URI.encode_uri_component(params[:id].to_s)}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |
#get(request_options: {}, **params) ⇒ Auth0::Types::GetTokenExchangeProfileResponseContent
Retrieve details about a single Token Exchange Profile specified by ID.
By using this feature, you agree to the applicable Free Trial terms in <a href=“www.okta.com/legal/”>Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href=“auth0.com/docs/authenticate/custom-token-exchange”>User Guide</a> for more details.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/auth0/token_exchange_profiles/client.rb', line 134 def get(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "token-exchange-profiles/#{URI.encode_uri_component(params[:id].to_s)}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Auth0::Types::GetTokenExchangeProfileResponseContent.load(response.body) else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list(request_options: {}, **params) ⇒ Auth0::Types::ListTokenExchangeProfileResponseContent
Retrieve a list of all Token Exchange Profiles available in your tenant.
By using this feature, you agree to the applicable Free Trial terms in <a href=“www.okta.com/legal/”>Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href=“auth0.com/docs/authenticate/custom-token-exchange”>User Guide</a> for more details.
This endpoint supports Checkpoint pagination. To search by checkpoint, use the following parameters: <ul> <li>from: Optional id from which to start selection.</li> <li>take: The total amount of entries to retrieve when using the from parameter. Defaults to 50.</li> </ul>
Note: The first time you call this endpoint using checkpoint pagination, omit the from parameter. If there are more results, a next value is included in the response. You can use this for subsequent API calls. When next is no longer included in the response, no pages are remaining.
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 69 70 71 72 73 74 75 76 |
# File 'lib/auth0/token_exchange_profiles/client.rb', line 42 def list(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[from take] query_params = {} query_params["from"] = params[:from] if params.key?(:from) query_params["take"] = params.fetch(:take, 50) params.except(*query_param_names) Auth0::Internal::CursorItemIterator.new( cursor_field: :next_, item_field: :token_exchange_profiles, initial_cursor: query_params["from"] ) do |next_cursor| query_params["from"] = next_cursor request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "token-exchange-profiles", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Auth0::Types::ListTokenExchangeProfileResponseContent.load(response.body) else error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end end |
#update(request_options: {}, **params) ⇒ untyped
Update a Token Exchange Profile within your tenant.
By using this feature, you agree to the applicable Free Trial terms in <a href=“www.okta.com/legal/”>Okta’s Master Subscription Agreement</a>. It is your responsibility to securely validate the user’s subject_token. See <a href=“auth0.com/docs/authenticate/custom-token-exchange”>User Guide</a> for more details.
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/auth0/token_exchange_profiles/client.rb', line 212 def update(request_options: {}, **params) params = Auth0::Internal::Types::Utils.normalize_keys(params) request_data = Auth0::TokenExchangeProfiles::Types::UpdateTokenExchangeProfileRequestContent.new(params).to_h non_body_param_names = ["id"] body = request_data.except(*non_body_param_names) request = Auth0::Internal::JSON::Request.new( base_url: [:base_url], method: "PATCH", path: "token-exchange-profiles/#{URI.encode_uri_component(params[:id].to_s)}", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Auth0::Errors::TimeoutError end code = response.code.to_i return if code.between?(200, 299) error_class = Auth0::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end |