Class: Telnyx::Resources::OAuthGrants
- Inherits:
-
Object
- Object
- Telnyx::Resources::OAuthGrants
- Defined in:
- lib/telnyx/resources/oauth_grants.rb
Instance Method Summary collapse
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::OAuthGrantDeleteResponse
Revoke an OAuth grant.
-
#initialize(client:) ⇒ OAuthGrants
constructor
private
A new instance of OAuthGrants.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::OAuthGrant>
Retrieve a paginated list of OAuth grants for the authenticated user.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::OAuthGrantRetrieveResponse
Retrieve a single OAuth grant by ID.
Constructor Details
#initialize(client:) ⇒ OAuthGrants
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of OAuthGrants.
75 76 77 |
# File 'lib/telnyx/resources/oauth_grants.rb', line 75 def initialize(client:) @client = client end |
Instance Method Details
#delete(id, request_options: {}) ⇒ Telnyx::Models::OAuthGrantDeleteResponse
Revoke an OAuth grant
63 64 65 66 67 68 69 70 |
# File 'lib/telnyx/resources/oauth_grants.rb', line 63 def delete(id, params = {}) @client.request( method: :delete, path: ["oauth_grants/%1$s", id], model: Telnyx::Models::OAuthGrantDeleteResponse, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::OAuthGrant>
Retrieve a paginated list of OAuth grants for the authenticated user
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/telnyx/resources/oauth_grants.rb', line 39 def list(params = {}) parsed, = Telnyx::OAuthGrantListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "oauth_grants", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::OAuthGrant, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::OAuthGrantRetrieveResponse
Retrieve a single OAuth grant by ID
17 18 19 20 21 22 23 24 |
# File 'lib/telnyx/resources/oauth_grants.rb', line 17 def retrieve(id, params = {}) @client.request( method: :get, path: ["oauth_grants/%1$s", id], model: Telnyx::Models::OAuthGrantRetrieveResponse, options: params[:request_options] ) end |