-
Notifications
You must be signed in to change notification settings - Fork 31
ENG-2608 - New APIs/method overloads #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9d41cbc
capture current cli state
wied03 c31f969
test on all PRs
wied03 fe87b80
go generic String->string issue
wied03 0a5d569
Test this code path
wied03 a8cb63f
add report method
wied03 b6277a9
make go format fail explicitly (was hiding an error)
wied03 ab2d96e
now that this overload does not have opt params, remove defaults
wied03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,6 @@ on: | |
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
command: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7008,6 +7008,36 @@ func (c *FusionAuthClient) RetrieveUserByLoginIdWithContext(ctx context.Context, | |
return &resp, &errors, err | ||
} | ||
|
||
// RetrieveUserByLoginIdWithLoginIdTypes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. go doesn't support function overloading or optional params, so letting it create a separate function here. |
||
// Retrieves the user for the loginId, using specific loginIdTypes. | ||
// | ||
// string loginId The email or username of the user. | ||
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to. | ||
func (c *FusionAuthClient) RetrieveUserByLoginIdWithLoginIdTypes(loginId string, loginIdTypes []string) (*UserResponse, *Errors, error) { | ||
return c.RetrieveUserByLoginIdWithLoginIdTypesWithContext(context.TODO(), loginId, loginIdTypes) | ||
} | ||
|
||
// RetrieveUserByLoginIdWithLoginIdTypesWithContext | ||
// Retrieves the user for the loginId, using specific loginIdTypes. | ||
// | ||
// string loginId The email or username of the user. | ||
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to. | ||
func (c *FusionAuthClient) RetrieveUserByLoginIdWithLoginIdTypesWithContext(ctx context.Context, loginId string, loginIdTypes []string) (*UserResponse, *Errors, error) { | ||
var resp UserResponse | ||
var errors Errors | ||
|
||
restClient := c.Start(&resp, &errors) | ||
err := restClient.WithUri("/api/user"). | ||
WithParameter("loginId", loginId). | ||
WithParameter("loginIdTypes", loginIdTypes). | ||
WithMethod(http.MethodGet). | ||
Do(ctx) | ||
if restClient.ErrorRef == nil { | ||
return &resp, nil, err | ||
} | ||
return &resp, &errors, err | ||
} | ||
|
||
// RetrieveUserByUsername | ||
// Retrieves the user for the given username. | ||
// | ||
|
@@ -7344,6 +7374,47 @@ func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdWithContext(ctx conte | |
return &resp, &errors, err | ||
} | ||
|
||
// RetrieveUserLoginReportByLoginIdAndLoginIdTypes | ||
// 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 | ||
// login counts for that application. | ||
// | ||
// string applicationId (Optional) The application id. | ||
// string loginId The userId id. | ||
// int64 start The start instant as UTC milliseconds since Epoch. | ||
// int64 end The end instant as UTC milliseconds since Epoch. | ||
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to. | ||
func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdAndLoginIdTypes(applicationId string, loginId string, start int64, end int64, loginIdTypes []string) (*LoginReportResponse, *Errors, error) { | ||
return c.RetrieveUserLoginReportByLoginIdAndLoginIdTypesWithContext(context.TODO(), applicationId, loginId, start, end, loginIdTypes) | ||
} | ||
|
||
// RetrieveUserLoginReportByLoginIdAndLoginIdTypesWithContext | ||
// 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 | ||
// login counts for that application. | ||
// | ||
// string applicationId (Optional) The application id. | ||
// string loginId The userId id. | ||
// int64 start The start instant as UTC milliseconds since Epoch. | ||
// int64 end The end instant as UTC milliseconds since Epoch. | ||
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to. | ||
func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdAndLoginIdTypesWithContext(ctx context.Context, applicationId string, loginId string, start int64, end int64, loginIdTypes []string) (*LoginReportResponse, *Errors, error) { | ||
var resp LoginReportResponse | ||
var errors Errors | ||
|
||
restClient := c.Start(&resp, &errors) | ||
err := restClient.WithUri("/api/report/login"). | ||
WithParameter("applicationId", applicationId). | ||
WithParameter("loginId", loginId). | ||
WithParameter("start", strconv.FormatInt(start, 10)). | ||
WithParameter("end", strconv.FormatInt(end, 10)). | ||
WithParameter("loginIdTypes", loginIdTypes). | ||
WithMethod(http.MethodGet). | ||
Do(ctx) | ||
if restClient.ErrorRef == nil { | ||
return &resp, nil, err | ||
} | ||
return &resp, &errors, err | ||
} | ||
|
||
// RetrieveUserRecentLogins | ||
// Retrieves the last number of login records for a user. | ||
// | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should run the tests on every PR, not just to main.