Class: NgrokAPI::Services::ApplicationUsersClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::ApplicationUsersClient
- Defined in:
- lib/ngrokapi/services/application_users_client.rb
Overview
Constant Summary collapse
- PATH =
The API path for the requests
'/app/users/%{id}'
- LIST_PROPERTY =
The List Property from the resulting API for list calls
'application_users'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an application user by ID.
-
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an application user by ID.
-
#get(id: "") ⇒ NgrokAPI::Models::ApplicationUser
Get an application user by ID.
-
#get!(id: "") ⇒ NgrokAPI::Models::ApplicationUser
Get an application user by ID.
-
#initialize(client:) ⇒ ApplicationUsersClient
constructor
A new instance of ApplicationUsersClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all application users for this account.
-
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all application users for this account.
Constructor Details
#initialize(client:) ⇒ ApplicationUsersClient
Returns a new instance of ApplicationUsersClient.
17 18 19 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 17 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
15 16 17 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 15 def client @client end |
Instance Method Details
#delete(id: "") ⇒ NgrokAPI::Models::Empty
Delete an application user by ID.
63 64 65 66 67 68 69 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 63 def delete(id: "") path = '/app/users/%{id}' replacements = { id: id, } @client.delete(path % replacements) end |
#delete!(id: "") ⇒ NgrokAPI::Models::Empty
Delete an application user by ID. Throws an exception if API error.
79 80 81 82 83 84 85 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 79 def delete!(id: "") path = '/app/users/%{id}' replacements = { id: id, } @client.delete(path % replacements, danger: true) end |
#get(id: "") ⇒ NgrokAPI::Models::ApplicationUser
Get an application user by ID.
28 29 30 31 32 33 34 35 36 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 28 def get(id: "") path = '/app/users/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data) NgrokAPI::Models::ApplicationUser.new(client: self, attrs: result) end |
#get!(id: "") ⇒ NgrokAPI::Models::ApplicationUser
Get an application user by ID. Throws an exception if API error.
46 47 48 49 50 51 52 53 54 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 46 def get!(id: "") path = '/app/users/%{id}' replacements = { id: id, } data = {} result = @client.get(path % replacements, data: data, danger: true) NgrokAPI::Models::ApplicationUser.new(client: self, attrs: result) end |
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all application users for this account.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 96 def list( before_id: nil, limit: nil, url: nil ) result = @client.list( before_id: before_id, limit: limit, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::ApplicationUser ) end |
#list!(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all application users for this account. Throws an exception if API error.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/ngrokapi/services/application_users_client.rb', line 126 def list!( before_id: nil, limit: nil, url: nil ) result = @client.list( before_id: before_id, limit: limit, danger: true, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, attrs: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::ApplicationUser, danger: true ) end |