Repository navigation
Adding IsEmailConfirmed, WhoCanShareContactCard and IsWorkflowBot to User, and DisplayNameNormalized, Image1024 and IsCustomImage to UserProfile - #266
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Six fields that Slack documents on its user object have no property in SlackNet 0.19.0. I ran into the first one building an app on SlackNet that matches Slack users to accounts in its own system by their profile email: an address Slack hasn't confirmed is whatever a workspace administrator typed, so I read
is_email_confirmedfrom the rawusers.inforesponse next to the typedUser. I found the other five by comparing a realusers.inforesponse and the reference withUserandUserProfile. This models them. It is four commits, each one builds and passes the tests.User.IsEmailConfirmed(is_email_confirmed): "Whether the user's email address has been confirmed." It is what tells an app thatProfile.Emailis Slack's word and not an administrator's.User.WhoCanShareContactCard(who_can_share_contact_card): "Contact card sharing permission setting." A string, because the reference doesn't list the values; its example showsEVERYONE.User.IsWorkflowBot(is_workflow_bot): "Whether this is a workflow bot user.", next toIsBot.UserProfile.DisplayNameNormalized(display_name_normalized),Image1024(image_1024) andIsCustomImage(is_custom_image), next toRealNameNormalizedand the other image sizes.Image1024needs[JsonProperty("image_1024")]likeImage24toImage512have.The doc comments copy Slack's one-line descriptions, as
AGENTS.mdasks.Compatibility
Additive only. The new properties default to null or false.
Testing
Each field has a deserialization test in
UserTests, in the same shape as the existing ones../do testpasses on all four commits (784, 785, 786 and 788 tests). I also took the[JsonProperty("image_1024")]offImage1024to check that its test needs it, and it fails without it.Seen in a real response:
is_email_confirmed,who_can_share_contact_card,display_name_normalized,image_1024andis_custom_imageare all in ausers.inforesponse I captured from a real workspace.Not verified:
is_workflow_bot. I haven't seen it in a real response, so it follows the reference only. I also haven't run my app against a local pack of this branch.