ToOrganizationID returns the organization identifier of the specified unique ID.
(uid string)
| 97 | |
| 98 | // ToOrganizationID returns the organization identifier of the specified unique ID. |
| 99 | func ToOrganizationID(uid string) (id *ttnpb.OrganizationIdentifiers, err error) { |
| 100 | id = &ttnpb.OrganizationIdentifiers{OrganizationId: uid} |
| 101 | if err := id.ValidateFields("organization_id"); err != nil { |
| 102 | return nil, errUniqueIdentifier.WithCause(err).WithAttributes("uid", uid) |
| 103 | } |
| 104 | return id, nil |
| 105 | } |
| 106 | |
| 107 | // ToUserID returns the user identifier of the specified unique ID. |
| 108 | func ToUserID(uid string) (id *ttnpb.UserIdentifiers, err error) { |