bridge_bankin 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeBankin
4
+ #
5
+ # Transaction resource
6
+ #
4
7
  class Transaction < BridgeObject
5
8
  RESOURCE_TYPE = "transaction"
6
9
 
7
10
  class << self
8
11
  include API::Resource
9
12
 
13
+ #
14
+ # List all logged in user transactions
15
+ #
16
+ # @param [String] access_token the access token provided during the user authentication
17
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
18
+ #
19
+ # @return [Array<Transaction>] the user transactions
20
+ #
10
21
  def list(access_token:, **params)
11
22
  protected_resource(access_token) do
12
23
  data = api_client.get("/v2/transactions", params)
@@ -14,6 +25,14 @@ module BridgeBankin
14
25
  end
15
26
  end
16
27
 
28
+ #
29
+ # List all logged in user updated transactions
30
+ #
31
+ # @param [String] access_token the access token provided during the user authentication
32
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
33
+ #
34
+ # @return [Array<Transaction>] the user accounts
35
+ #
17
36
  def list_updated(access_token:, **params)
18
37
  protected_resource(access_token) do
19
38
  data = api_client.get("/v2/transactions/updated", params)
@@ -21,6 +40,15 @@ module BridgeBankin
21
40
  end
22
41
  end
23
42
 
43
+ #
44
+ # Retrieve a single transaction for logged in user
45
+ #
46
+ # @param [Integer] id the id of the requested resource
47
+ # @param [String] access_token the access token provided during the user authentication
48
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
49
+ #
50
+ # @return [Transaction] the user accounts
51
+ #
24
52
  def find(id:, access_token:, **params)
25
53
  protected_resource(access_token) do
26
54
  data = api_client.get("/v2/transactions/#{id}", params)
@@ -28,6 +56,14 @@ module BridgeBankin
28
56
  end
29
57
  end
30
58
 
59
+ #
60
+ # List all logged in user transactions for a specific account
61
+ #
62
+ # @param [String] access_token the access token provided during the user authentication
63
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
64
+ #
65
+ # @return [Array<Transaction>] the user accounts
66
+ #
31
67
  def list_by_account(account_id:, access_token:, **params)
32
68
  protected_resource(access_token) do
33
69
  data = api_client.get("/v2/accounts/#{account_id}/transactions", params)
@@ -35,6 +71,14 @@ module BridgeBankin
35
71
  end
36
72
  end
37
73
 
74
+ #
75
+ # List all logged in user updated transactions for a specific account
76
+ #
77
+ # @param [String] access_token the access token provided during the user authentication
78
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
79
+ #
80
+ # @return [Array<Transaction>] the user accounts
81
+ #
38
82
  def list_updated_by_account(account_id:, access_token:, **params)
39
83
  protected_resource(access_token) do
40
84
  data = api_client.get("/v2/accounts/#{account_id}/transactions/updated", params)
@@ -42,6 +86,14 @@ module BridgeBankin
42
86
  end
43
87
  end
44
88
 
89
+ #
90
+ # List all logged in user transactions with a specific IBAN
91
+ #
92
+ # @param [String] access_token the access token provided during the user authentication
93
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
94
+ #
95
+ # @return [Array<Transaction>] the user accounts
96
+ #
45
97
  def list_by_iban(access_token:, **params)
46
98
  protected_resource(access_token) do
47
99
  data = api_client.post("/v2/transactions/search", params)
@@ -1,12 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeBankin
4
+ #
5
+ # Transfer resource
6
+ #
4
7
  class Transfer < BridgeObject
5
8
  RESOURCE_TYPE = "transfert"
6
9
 
7
10
  class << self
8
11
  include API::Resource
9
12
 
13
+ #
14
+ # Request the URL to Bridge's Pay funnel to make a transfer
15
+ #
16
+ # @param [String] access_token the access token provided during the user authentication
17
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
18
+ #
19
+ # @return [BridgeObject] the URL to Bridge's Pay funnel
20
+ #
10
21
  def send(access_token:, **params)
11
22
  protected_resource(access_token) do
12
23
  data = api_client.post("/v2/pay/transfer/url", params)
@@ -14,6 +25,14 @@ module BridgeBankin
14
25
  end
15
26
  end
16
27
 
28
+ #
29
+ # List all logged in user transfers
30
+ #
31
+ # @param [String] access_token the access token provided during the user authentication
32
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
33
+ #
34
+ # @return [Array<Transfer>] the user's transfers
35
+ #
17
36
  def list(access_token:, **params)
18
37
  protected_resource(access_token) do
19
38
  data = api_client.get("/v2/transfers", params)
@@ -21,6 +40,15 @@ module BridgeBankin
21
40
  end
22
41
  end
23
42
 
43
+ #
44
+ # Retrieve a single transfer for the logged in user
45
+ #
46
+ # @param [UUID] uuid the uuid of the requested resource
47
+ # @param [String] access_token the access token provided during the user authentication
48
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
49
+ #
50
+ # @return [Transfer] the requested transfer
51
+ #
24
52
  def find(uuid:, access_token:, **params)
25
53
  protected_resource(access_token) do
26
54
  data = api_client.get("/v2/transfers/#{uuid}", params)
@@ -28,6 +56,14 @@ module BridgeBankin
28
56
  end
29
57
  end
30
58
 
59
+ #
60
+ # List all sender transfer accounts
61
+ #
62
+ # @param [String] access_token the access token provided during the user authentication
63
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
64
+ #
65
+ # @return [Array<BridgeObject>] the user accounts
66
+ #
31
67
  def list_all_sender_accounts(access_token:, **params)
32
68
  protected_resource(access_token) do
33
69
  data = api_client.get("/v2/transfers/accounts/senders", params)
@@ -35,6 +71,14 @@ module BridgeBankin
35
71
  end
36
72
  end
37
73
 
74
+ #
75
+ # List all receiver transfer accounts
76
+ #
77
+ # @param [String] access_token the access token provided during the user authentication
78
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
79
+ #
80
+ # @return [Array<BridgeObject>] the user accounts
81
+ #
38
82
  def list_all_receiver_accounts(access_token:, **params)
39
83
  protected_resource(access_token) do
40
84
  data = api_client.get("/v2/transfers/accounts/receivers", params)
@@ -42,6 +86,15 @@ module BridgeBankin
42
86
  end
43
87
  end
44
88
 
89
+ #
90
+ # List all receiver transfer accounts for a specific sender account
91
+ #
92
+ # @param [Integer] sender_account_id the sender_account_id of the requested resource
93
+ # @param [String] access_token the access token provided during the user authentication
94
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
95
+ #
96
+ # @return [Array<BridgeObject>] the user accounts
97
+ #
45
98
  def list_receiver_accounts_for_sender(sender_account_id:, access_token:, **params)
46
99
  protected_resource(access_token) do
47
100
  data = api_client.get("/v2/transfers/accounts/#{sender_account_id}/receivers", params)
@@ -1,47 +1,111 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeBankin
4
+ #
5
+ # User resource
6
+ #
4
7
  class User < BridgeObject
5
8
  RESOURCE_TYPE = "user"
6
9
 
7
10
  class << self
8
11
  include API::Resource
9
12
 
13
+ #
14
+ # List all registered users
15
+ #
16
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
17
+ #
18
+ # @return [Array<User>] the registered users list
19
+ #
10
20
  def list(**params)
11
21
  data = api_client.get("/v2/users", params)
12
22
  convert_to_bridge_object(data)
13
23
  end
14
24
 
25
+ #
26
+ # Retrieve a specific user
27
+ #
28
+ # @param [UUID] uuid the uuid of the requested resource
29
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
30
+ #
31
+ # @return [User] the requested user
32
+ #
15
33
  def find(uuid:, **params)
16
34
  data = api_client.get("/v2/users/#{uuid}", params)
17
35
  convert_to_bridge_object(data)
18
36
  end
19
37
 
38
+ #
39
+ # Create a new user
40
+ #
41
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
42
+ #
43
+ # @return [User] the newly created user
44
+ #
20
45
  def create(**params)
21
46
  data = api_client.post("/v2/users", params)
22
47
  convert_to_bridge_object(data)
23
48
  end
24
49
 
50
+ #
51
+ # Update user email
52
+ #
53
+ # @param [UUID] uuid the uuid of the requested resource
54
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
55
+ #
56
+ # @return [User] the updated user
57
+ #
25
58
  def update_email(uuid:, **params)
26
59
  data = api_client.put("/v2/users/#{uuid}/email", params)
27
60
  convert_to_bridge_object(data)
28
61
  end
29
62
 
63
+ #
64
+ # Update user password
65
+ #
66
+ # @param [UUID] uuid the uuid of the requested resource
67
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
68
+ #
69
+ # @return [User] the updated user
70
+ #
30
71
  def update_password(uuid:, **params)
31
72
  data = api_client.put("/v2/users/#{uuid}/password", params)
32
73
  convert_to_bridge_object(data)
33
74
  end
34
75
 
76
+ #
77
+ # Delete a specific user
78
+ #
79
+ # @param [UUID] uuid the uuid of the requested resource
80
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
81
+ #
82
+ # @return [Boolean] the request success status
83
+ #
35
84
  def delete_user(uuid:, **params)
36
- data = api_client.delete("/v2/users/#{uuid}", params)
37
- convert_to_bridge_object(data)
85
+ api_client.delete("/v2/users/#{uuid}", params)
86
+ true
38
87
  end
39
88
 
89
+ #
90
+ # Delete all registered users
91
+ #
92
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
93
+ #
94
+ # @return [Boolean] the request success status
95
+ #
40
96
  def delete_all_users(**params)
41
- data = api_client.delete("/v2/users", params)
42
- convert_to_bridge_object(data)
97
+ api_client.delete("/v2/users", params)
98
+ true
43
99
  end
44
100
 
101
+ #
102
+ # Check the logged in user email confirmation status
103
+ #
104
+ # @param [String] access_token the access token provided during the user authentication
105
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
106
+ #
107
+ # @return [BridgeObject] the user email confirmation status
108
+ #
45
109
  def check_email_confirmation(access_token:, **params)
46
110
  protected_resource(access_token) do
47
111
  data = api_client.get("/v2/users/me/email/confirmation", params)
@@ -49,6 +113,14 @@ module BridgeBankin
49
113
  end
50
114
  end
51
115
 
116
+ #
117
+ # Request the URL to access to an interface to manage the logged in user accounts' IBAN
118
+ #
119
+ # @param [String] access_token the access token provided during the user authentication
120
+ # @param [Hash] params any params that might be required (or optional) to communicate with the API
121
+ #
122
+ # @return [BridgeObject] an URL to access to the interface to manage accounts' IBAN
123
+ #
52
124
  def manage_accounts(access_token:, **params)
53
125
  protected_resource(access_token) do
54
126
  data = api_client.get("/v2/users/manage/accounts/iban", params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeBankin
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_bankin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Buffon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-12-28 00:00:00.000000000 Z
11
+ date: 2020-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -159,7 +159,8 @@ executables: []
159
159
  extensions: []
160
160
  extra_rdoc_files: []
161
161
  files:
162
- - ".github/workflows/main.yml"
162
+ - ".github/workflows/ci-analysis.yml"
163
+ - ".github/workflows/rubocop-analysis.yml"
163
164
  - ".gitignore"
164
165
  - ".rspec"
165
166
  - ".rubocop.yml"
@@ -216,5 +217,5 @@ requirements: []
216
217
  rubygems_version: 3.1.4
217
218
  signing_key:
218
219
  specification_version: 4
219
- summary: Unofficial client to consume Bridge by Bankin’ API
220
+ summary: Unofficial Ruby client to consume Bridge by Bankin’ API
220
221
  test_files: []