mhoppa commented on a change in pull request #3996: Rewrote /user/current to Go
URL: https://github.com/apache/trafficcontrol/pull/3996#discussion_r341168333
 
 

 ##########
 File path: lib/go-tc/users.go
 ##########
 @@ -99,6 +109,179 @@ type UserCurrent struct {
        commonUserFields
 }
 
+// CurrentUserUpdateRequest differs from a regular User/UserCurrent in that 
many of its fields are
+// *parsed* but not *unmarshaled*. This allows a handler to distinguish 
between "null" and
+// "undefined" values.
+type CurrentUserUpdateRequest struct {
+       // User, for whatever reason, contains all of the actual data.
+       User CurrentUserUpdateRequestUser `json:"user"`
+}
+
+// CurrentUserUpdateRequestUser holds all of the actual data in a request to 
update the current user.
+type CurrentUserUpdateRequestUser struct {
+       AddressLine1       json.RawMessage `json:"addressLine1"`
+       AddressLine2       json.RawMessage `json:"addressLine2"`
+       City               json.RawMessage `json:"city"`
+       Company            json.RawMessage `json:"company"`
+       ConfirmLocalPasswd *string         `json:"confirmLocalPasswd"`
+       Country            json.RawMessage `json:"country"`
+       Email              json.RawMessage `json:"email"`
+       FullName           json.RawMessage `json:"fullName"`
+       GID                json.RawMessage `json:"gid"`
+       ID                 json.RawMessage `json:"id"`
+       LocalPasswd        *string         `json:"localPasswd"`
+       PhoneNumber        json.RawMessage `json:"phoneNumber"`
+       PostalCode         json.RawMessage `json:"postalCode"`
+       PublicSSHKey       json.RawMessage `json:"publicSshKey"`
+       Role               json.RawMessage `json:"role"`
+       StateOrProvince    json.RawMessage `json:"stateOrProvince"`
+       TenantID           json.RawMessage `json:"tenantId"`
+       UID                json.RawMessage `json:"uid"`
+       Username           json.RawMessage         `json:"username"`
 
 Review comment:
   gofmt 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to