Module: Auth0::Api::V2::ClientGrants
- Included in:
- Auth0::Api::V2
- Defined in:
- lib/auth0/api/v2/client_grants.rb
Overview
Methods to use the client grants endpoints
Instance Method Summary collapse
-
#client_grants(client_id: nil, audience: nil, page: nil, per_page: nil) ⇒ json
(also: #get_all_client_grants)
Retrieves a list of all client grants.
-
#create_client_grant(options = {}) ⇒ json
Creates a new client grant.
-
#delete_client_grant(client_grant_id) ⇒ Object
Deletes a client grant given its id.
-
#patch_client_grant(client_grant_id, options) ⇒ Object
(also: #update_client_grant)
Updates a client grant.
Instance Method Details
#client_grants(client_id: nil, audience: nil, page: nil, per_page: nil) ⇒ json Also known as: get_all_client_grants
Retrieves a list of all client grants.
15 16 17 18 19 20 21 22 23 |
# File 'lib/auth0/api/v2/client_grants.rb', line 15 def client_grants (client_id: nil, audience: nil, page: nil, per_page: nil) request_params = { client_id: client_id, audience: audience, page: page, per_page: per_page } get(client_grants_path, request_params) end |
#create_client_grant(options = {}) ⇒ json
Creates a new client grant.
31 32 33 34 |
# File 'lib/auth0/api/v2/client_grants.rb', line 31 def create_client_grant( = {}) request_params = Hash[.map { |(k, v)| [k.to_sym, v] }] post(client_grants_path, request_params) end |
#delete_client_grant(client_grant_id) ⇒ Object
Deletes a client grant given its id.
39 40 41 42 43 |
# File 'lib/auth0/api/v2/client_grants.rb', line 39 def delete_client_grant(client_grant_id) raise Auth0::InvalidParameter, 'Must specify a client grant id' if client_grant_id.to_s.empty? path = "#{client_grants_path}/#{client_grant_id}" delete(path) end |
#patch_client_grant(client_grant_id, options) ⇒ Object Also known as: update_client_grant
Updates a client grant.
49 50 51 52 53 54 |
# File 'lib/auth0/api/v2/client_grants.rb', line 49 def patch_client_grant(client_grant_id, ) raise Auth0::InvalidParameter, 'Must specify a client grant id' if client_grant_id.to_s.empty? raise Auth0::InvalidParameter, 'Must specify a valid body' if .to_s.empty? path = "#{client_grants_path}/#{client_grant_id}" patch(path, ) end |