Class: Telnyx::Resources::OAuthClients
- Inherits:
-
Object
- Object
- Telnyx::Resources::OAuthClients
- Defined in:
- lib/telnyx/resources/oauth_clients.rb
Instance Method Summary collapse
-
#create(allowed_grant_types:, allowed_scopes:, client_type:, name:, logo_uri: nil, policy_uri: nil, redirect_uris: nil, require_pkce: nil, tos_uri: nil, request_options: {}) ⇒ Telnyx::Models::OAuthClientCreateResponse
Create a new OAuth client.
-
#delete(id, request_options: {}) ⇒ nil
Delete an OAuth client.
-
#initialize(client:) ⇒ OAuthClients
constructor
private
A new instance of OAuthClients.
-
#list(filter_allowed_grant_types_contains: nil, filter_client_id: nil, filter_client_type: nil, filter_name: nil, filter_name_contains: nil, filter_verified: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::OAuthClient>
Retrieve a paginated list of OAuth clients for the authenticated user.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::OAuthClientRetrieveResponse
Retrieve a single OAuth client by ID.
-
#update(id, allowed_grant_types: nil, allowed_scopes: nil, logo_uri: nil, name: nil, policy_uri: nil, redirect_uris: nil, require_pkce: nil, tos_uri: nil, request_options: {}) ⇒ Telnyx::Models::OAuthClientUpdateResponse
Update an existing OAuth client.
Constructor Details
#initialize(client:) ⇒ OAuthClients
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 OAuthClients.
172 173 174 |
# File 'lib/telnyx/resources/oauth_clients.rb', line 172 def initialize(client:) @client = client end |
Instance Method Details
#create(allowed_grant_types:, allowed_scopes:, client_type:, name:, logo_uri: nil, policy_uri: nil, redirect_uris: nil, require_pkce: nil, tos_uri: nil, request_options: {}) ⇒ Telnyx::Models::OAuthClientCreateResponse
Create a new OAuth client
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/telnyx/resources/oauth_clients.rb', line 33 def create(params) parsed, = Telnyx::OAuthClientCreateParams.dump_request(params) @client.request( method: :post, path: "oauth_clients", body: parsed, model: Telnyx::Models::OAuthClientCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Delete an OAuth client
160 161 162 163 164 165 166 167 |
# File 'lib/telnyx/resources/oauth_clients.rb', line 160 def delete(id, params = {}) @client.request( method: :delete, path: ["oauth_clients/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#list(filter_allowed_grant_types_contains: nil, filter_client_id: nil, filter_client_type: nil, filter_name: nil, filter_name_contains: nil, filter_verified: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::OAuthClient>
Retrieve a paginated list of OAuth clients for the authenticated user
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/telnyx/resources/oauth_clients.rb', line 127 def list(params = {}) parsed, = Telnyx::OAuthClientListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "oauth_clients", query: query.transform_keys( filter_allowed_grant_types_contains: "filter[allowed_grant_types][contains]", filter_client_id: "filter[client_id]", filter_client_type: "filter[client_type]", filter_name: "filter[name]", filter_name_contains: "filter[name][contains]", filter_verified: "filter[verified]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::OAuthClient, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::OAuthClientRetrieveResponse
Retrieve a single OAuth client by ID
55 56 57 58 59 60 61 62 |
# File 'lib/telnyx/resources/oauth_clients.rb', line 55 def retrieve(id, params = {}) @client.request( method: :get, path: ["oauth_clients/%1$s", id], model: Telnyx::Models::OAuthClientRetrieveResponse, options: params[:request_options] ) end |
#update(id, allowed_grant_types: nil, allowed_scopes: nil, logo_uri: nil, name: nil, policy_uri: nil, redirect_uris: nil, require_pkce: nil, tos_uri: nil, request_options: {}) ⇒ Telnyx::Models::OAuthClientUpdateResponse
Update an existing OAuth client
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/telnyx/resources/oauth_clients.rb', line 91 def update(id, params = {}) parsed, = Telnyx::OAuthClientUpdateParams.dump_request(params) @client.request( method: :put, path: ["oauth_clients/%1$s", id], body: parsed, model: Telnyx::Models::OAuthClientUpdateResponse, options: ) end |