-
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
Changes from 5 commits
9d41cbc
c31f969
fe87b80
0a5d569
a8cb63f
b6277a9
ab2d96e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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: | ||
|
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. Defaults to [email, username] | ||
|
||
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. Defaults to [email, username] | ||
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. Defaults to [email, username] | ||
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. Defaults to [email, username] | ||
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. | ||
// | ||
|
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.