Skip to content
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

added generic get/set metadata methods on UserBase #646

Merged

Conversation

MichaelPruefer
Copy link
Contributor

Changes

Added generic methods to get/set user metadata, e.g.:
userInstance.getAppMetadata<MyAppMetadata>();
userInstance.getUserMetadata<MyUserMetadata>();
userInstance.setAppMetadata(myAppMetadata);
userInstance.setUserMetadata(myUserMetadata);

As for now Newtonsoft.Json.Linq.JObject is used as this type seems to be deserialized when reading users.

Auth0.ManagementApi.Models.UserBase

  • added new generic get/set methods for AppMetadata and UserMetadata

Auth0.ManagementApi.IntegrationTests.UsersTests:

  • added test for read/write user metadata with new generic get/set methods

References

#645

Testing

Retrieve a user with AppMetadata, call getAppMetadata with a matching type and see the filled properties

  • This change adds unit test coverage

  • This change adds integration test coverage

  • This change has been tested on the latest version of the platform/language or why not
    I'm unable to run the tests as configuration seems missing

Checklist

@MichaelPruefer MichaelPruefer requested a review from a team as a code owner August 17, 2023 11:44
Copy link
Member

@frederikprijck frederikprijck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, left some comments

@MichaelPruefer
Copy link
Contributor Author

I removed the incorrect exception documentation

@frederikprijck frederikprijck force-pushed the feat/generic-get-user-metadata branch from 47e6121 to 94921fc Compare August 23, 2023 08:27
@frederikprijck frederikprijck force-pushed the feat/generic-get-user-metadata branch from 94921fc to bbd9cf3 Compare August 23, 2023 08:28
Copy link
Member

@frederikprijck frederikprijck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I pushed a commit to fix the tests.

@frederikprijck frederikprijck merged commit 369ab1f into auth0:master Aug 23, 2023
@frederikprijck frederikprijck mentioned this pull request Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants