Skip to content

Commit 5a9c95a

Browse files
authored
ENG-2608 - New APIs/method overloads (#35)
* Updates * Let's test on all PRs * Add loginId tests * Cleanup properly (and can't test without dev image) * fix this * add report method * revert overloads * test fixes * client correct/optional * now that this overload does not have opt params, remove defaults
1 parent 48a123e commit 5a9c95a

4 files changed

Lines changed: 177 additions & 123 deletions

File tree

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- develop
77
- main
88
pull_request:
9-
branches:
10-
- develop
11-
- main
129
workflow_dispatch:
1310

1411
permissions:

fusionauth-ruby-client.iml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
<orderEntry type="jdk" jdkName="rbenv: 3.4.2" jdkType="RUBY_SDK" />
1010
<orderEntry type="sourceFolder" forTests="false" />
1111
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.6.2, rbenv: 3.4.2) [gem]" level="application" />
12-
<orderEntry type="library" scope="PROVIDED" name="cgi (v0.4.2, rbenv: 3.4.2) [gem]" level="application" />
13-
<orderEntry type="library" scope="PROVIDED" name="psych (v5.2.3, rbenv: 3.4.2) [gem]" level="application" />
12+
<orderEntry type="library" scope="PROVIDED" name="racc (v1.8.1, rbenv: 3.4.2) [gem]" level="application" />
1413
<orderEntry type="library" scope="PROVIDED" name="rake (v13.2.1, rbenv: 3.4.2) [gem]" level="application" />
1514
</component>
16-
</module>
15+
</module>

lib/fusionauth/fusionauth_client.rb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,6 +3382,20 @@ def retrieve_user_by_login_id(login_id)
33823382
.go
33833383
end
33843384

3385+
#
3386+
# Retrieves the user for the loginId, using specific loginIdTypes.
3387+
#
3388+
# @param login_id [string] The email or username of the user.
3389+
# @param login_id_types [Array] the identity types that FusionAuth will compare the loginId to.
3390+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
3391+
def retrieve_user_by_login_id_with_login_id_types(login_id, login_id_types)
3392+
start.uri('/api/user')
3393+
.url_parameter('loginId', login_id)
3394+
.url_parameter('loginIdTypes', login_id_types)
3395+
.get
3396+
.go
3397+
end
3398+
33853399
#
33863400
# Retrieves the user for the given username.
33873401
#
@@ -3563,6 +3577,27 @@ def retrieve_user_login_report_by_login_id(application_id, login_id, start, _end
35633577
.go
35643578
end
35653579

3580+
#
3581+
# Retrieves the login report between the two instants for a particular user by login Id, using specific loginIdTypes. If you specify an application id, it will only return the
3582+
# login counts for that application.
3583+
#
3584+
# @param application_id [string] (Optional) The application id.
3585+
# @param login_id [string] The userId id.
3586+
# @param start [OpenStruct, Hash] The start instant as UTC milliseconds since Epoch.
3587+
# @param _end [OpenStruct, Hash] The end instant as UTC milliseconds since Epoch.
3588+
# @param login_id_types [Array] the identity types that FusionAuth will compare the loginId to.
3589+
# @return [FusionAuth::ClientResponse] The ClientResponse object.
3590+
def retrieve_user_login_report_by_login_id_and_login_id_types(application_id, login_id, start, _end, login_id_types)
3591+
start.uri('/api/report/login')
3592+
.url_parameter('applicationId', application_id)
3593+
.url_parameter('loginId', login_id)
3594+
.url_parameter('start', start)
3595+
.url_parameter('end', _end)
3596+
.url_parameter('loginIdTypes', login_id_types)
3597+
.get
3598+
.go
3599+
end
3600+
35663601
#
35673602
# Retrieves the last number of login records for a user.
35683603
#

0 commit comments

Comments
 (0)