Class: BridgeBankin::User
- Inherits:
-
BridgeObject
- Object
- BridgeObject
- BridgeBankin::User
- Extended by:
- API::Resource
- Defined in:
- lib/bridge_bankin/user.rb
Overview
User resource
Constant Summary collapse
- RESOURCE_TYPE =
"user"
Constants inherited from BridgeObject
BridgeObject::HIDDEN_ATTRIBUTES
Class Method Summary collapse
-
.check_email_confirmation(access_token:, **params) ⇒ BridgeObject
Check the logged in user email confirmation status.
-
.create(**params) ⇒ User
Create a new user.
-
.delete_all_users(**params) ⇒ Boolean
Delete all registered users.
-
.delete_user(uuid:, **params) ⇒ Boolean
Delete a specific user.
-
.find(uuid:, **params) ⇒ User
Retrieve a specific user.
-
.list(**params) ⇒ Array<User>
List all registered users.
-
.manage_accounts(access_token:, **params) ⇒ BridgeObject
Request the URL to access to an interface to manage the logged in user accounts’ IBAN.
-
.update_email(uuid:, **params) ⇒ User
Update user email.
-
.update_password(uuid:, **params) ⇒ User
Update user password.
Methods inherited from BridgeObject
#==, convert_to_bridge_object, #initialize, #to_hash, #to_json
Constructor Details
This class inherits a constructor from BridgeBankin::BridgeObject
Class Method Details
.check_email_confirmation(access_token:, **params) ⇒ BridgeObject
Check the logged in user email confirmation status
109 110 111 112 113 114 |
# File 'lib/bridge_bankin/user.rb', line 109 def check_email_confirmation(access_token:, **params) protected_resource(access_token) do data = api_client.get("/v2/users/me/email/confirmation", **params) convert_to_bridge_object(**data) end end |
.create(**params) ⇒ User
Create a new user
45 46 47 48 |
# File 'lib/bridge_bankin/user.rb', line 45 def create(**params) data = api_client.post("/v2/users", **params) convert_to_bridge_object(**data) end |
.delete_all_users(**params) ⇒ Boolean
Delete all registered users
96 97 98 99 |
# File 'lib/bridge_bankin/user.rb', line 96 def delete_all_users(**params) api_client.delete("/v2/users", **params) true end |
.delete_user(uuid:, **params) ⇒ Boolean
Delete a specific user
84 85 86 87 |
# File 'lib/bridge_bankin/user.rb', line 84 def delete_user(uuid:, **params) api_client.delete("/v2/users/#{uuid}", **params) true end |
.find(uuid:, **params) ⇒ User
Retrieve a specific user
33 34 35 36 |
# File 'lib/bridge_bankin/user.rb', line 33 def find(uuid:, **params) data = api_client.get("/v2/users/#{uuid}", **params) convert_to_bridge_object(**data) end |
.list(**params) ⇒ Array<User>
List all registered users
20 21 22 23 |
# File 'lib/bridge_bankin/user.rb', line 20 def list(**params) data = api_client.get("/v2/users", **params) convert_to_bridge_object(**data) end |
.manage_accounts(access_token:, **params) ⇒ BridgeObject
Request the URL to access to an interface to manage the logged in user accounts’ IBAN
124 125 126 127 128 129 |
# File 'lib/bridge_bankin/user.rb', line 124 def manage_accounts(access_token:, **params) protected_resource(access_token) do data = api_client.get("/v2/users/manage/accounts/iban", **params) convert_to_bridge_object(**data) end end |
.update_email(uuid:, **params) ⇒ User
Update user email
58 59 60 61 |
# File 'lib/bridge_bankin/user.rb', line 58 def update_email(uuid:, **params) data = api_client.put("/v2/users/#{uuid}/email", **params) convert_to_bridge_object(**data) end |
.update_password(uuid:, **params) ⇒ User
Update user password
71 72 73 74 |
# File 'lib/bridge_bankin/user.rb', line 71 def update_password(uuid:, **params) data = api_client.put("/v2/users/#{uuid}/password", **params) convert_to_bridge_object(**data) end |