Class: Privy::Resources::Apps::Allowlist
- Inherits:
-
Object
- Object
- Privy::Resources::Apps::Allowlist
- Defined in:
- lib/privy/resources/apps/allowlist.rb
Overview
Operations related to app settings and allowlist management
Instance Method Summary collapse
-
#create(app_id, user_invite_input:, request_options: {}) ⇒ Privy::Models::AllowlistEntry
Add a new entry to the allowlist for an app.
-
#delete(app_id, user_invite_input:, request_options: {}) ⇒ Privy::Models::AllowlistDeletionResponse
Remove an entry from the allowlist for an app.
-
#initialize(client:) ⇒ Allowlist
constructor
private
A new instance of Allowlist.
-
#list(app_id, request_options: {}) ⇒ Array<Privy::Models::AllowlistEntry>
Get all allowlist entries for an app.
Constructor Details
#initialize(client:) ⇒ Allowlist
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 Allowlist.
80 81 82 |
# File 'lib/privy/resources/apps/allowlist.rb', line 80 def initialize(client:) @client = client end |
Instance Method Details
#create(app_id, user_invite_input:, request_options: {}) ⇒ Privy::Models::AllowlistEntry
Add a new entry to the allowlist for an app. The allowlist must be enabled.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/privy/resources/apps/allowlist.rb', line 21 def create(app_id, params) parsed, = Privy::Apps::AllowlistCreateParams.dump_request(params) @client.request( method: :post, path: ["v1/apps/%1$s/allowlist", app_id], body: parsed[:user_invite_input], model: Privy::AllowlistEntry, options: ) end |
#delete(app_id, user_invite_input:, request_options: {}) ⇒ Privy::Models::AllowlistDeletionResponse
Remove an entry from the allowlist for an app. The allowlist must be enabled.
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/privy/resources/apps/allowlist.rb', line 66 def delete(app_id, params) parsed, = Privy::Apps::AllowlistDeleteParams.dump_request(params) @client.request( method: :delete, path: ["v1/apps/%1$s/allowlist", app_id], body: parsed[:user_invite_input], model: Privy::AllowlistDeletionResponse, options: ) end |
#list(app_id, request_options: {}) ⇒ Array<Privy::Models::AllowlistEntry>
Get all allowlist entries for an app. Returns the list of users allowed to access the app when the allowlist is enabled.
44 45 46 47 48 49 50 51 |
# File 'lib/privy/resources/apps/allowlist.rb', line 44 def list(app_id, params = {}) @client.request( method: :get, path: ["v1/apps/%1$s/allowlist", app_id], model: Privy::Internal::Type::ArrayOf[Privy::AllowlistEntry], options: params[:request_options] ) end |