payload: {"action":"created","comment":{"url":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/comments/300579514","pull_request_review_id":258269742,"id":300579514,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMwMDU3OTUxNA==","diff_hunk":"@@ -0,0 +1,456 @@\n+/*\n+ * Copyright 2019 VMware, Inc.  All rights reserved.  Licensed under the Apache v2 License.\n+ */\n+\n+package govcd\n+\n+import (\n+\t\"fmt\"\n+\t\"net/http\"\n+\t\"net/url\"\n+\t\"time\"\n+\n+\t\"github.com/vmware/go-vcloud-director/v2/types/v56\"\n+\t\"github.com/vmware/go-vcloud-director/v2/util\"\n+)\n+\n+// Definition of an OrgUser\n+type OrgUser struct {\n+\tUser     *types.User\n+\tclient   *Client\n+\tAdminOrg *AdminOrg // needed to be able to update, as the list of roles is found in the Org\n+}\n+\n+// Simplified structure to insert or modify an organization user\n+type OrgUserConfiguration struct {\n+\tName            string // Mandatory\n+\tPassword        string // Mandatory\n+\tRoleName        string // Mandatory\n+\tProviderType    string // Optional: defaults to \"INTEGRATED\"\n+\tIsEnabled       bool   // Optional: defaults to false\n+\tIsLocked        bool   // Only used for updates\n+\tDeployedVmQuota int    // Optional: 0 means \"unlimited\"\n+\tStoredVmQuota   int    // Optional: 0 means \"unlimited\"\n+\tFullName        string\n+\tDescription     string\n+\tEmailAddress    string\n+\tTelephone       string\n+}\n+\n+const (\n+\t// Common role names and provider types are kept here to reduce hard-coded text and prevent mistakes\n+\t// Roles that are added to the organization need to be entered as free text\n+\n+\tOrgUserRoleOrganizationAdministrator = \"Organization Administrator\"\n+\tOrgUserRoleCatalogAuthor             = \"Catalog Author\"\n+\tOrgUserRoleVappAuthor                = \"vApp Author\"\n+\tOrgUserRoleVappUser                  = \"vApp User\"\n+\tOrgUserRoleConsoleAccessOnly         = \"Console Access Only\"\n+\tOrgUserRoleDeferToIdentityProvider   = \"Defer to Identity Provider\"\n+\n+\t// Allowed values for provider types\n+\tOrgUserProviderIntegrated = \"INTEGRATED\" // The user is created locally or imported from LDAP\n+\tOrgUserProviderSAML       = \"SAML\"       // The user is imported from a SAML identity provider.\n+\tOrgUserProviderOAUTH      = \"OAUTH\"      // The user is imported from an OAUTH identity provider\n+)\n+\n+// Used to check the validity of provider type on creation\n+var OrgUserProviderTypes = []string{\n+\tOrgUserProviderIntegrated,\n+\tOrgUserProviderSAML,\n+\tOrgUserProviderOAUTH,\n+}\n+\n+// NewUser creates an empty user\n+func NewUser(cli *Client, org *AdminOrg) *OrgUser {\n+\treturn &OrgUser{\n+\t\tUser:     new(types.User),\n+\t\tclient:   cli,\n+\t\tAdminOrg: org,\n+\t}\n+}\n+\n+// GetUserByNameOrId retrieves an user within an admin organization\n+// by either name or ID\n+// Returns a valid user if it exists. If it doesn't, returns nil and ErrorEntityNotFound\n+func (adminOrg *AdminOrg) GetUserByNameOrId(identifier string, willRefresh bool) (*OrgUser, error) {\n+\tif willRefresh {","path":"govcd/user.go","position":81,"original_position":77,"commit_id":"ef9ab3a530e699f1e104df22478b696947d712cd","original_commit_id":"89994ac0853756b8a718731be1552d815a6c60ca","user":{"login":"vbauzysvmware","id":41415459,"node_id":"MDQ6VXNlcjQxNDE1NDU5","avatar_url":"https://avatars3.githubusercontent.com/u/41415459?v=4","gravatar_id":"","url":"https://api.github.com/users/vbauzysvmware","html_url":"https://github.com/vbauzysvmware","followers_url":"https://api.github.com/users/vbauzysvmware/followers","following_url":"https://api.github.com/users/vbauzysvmware/following{/other_user}","gists_url":"https://api.github.com/users/vbauzysvmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vbauzysvmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbauzysvmware/subscriptions","organizations_url":"https://api.github.com/users/vbauzysvmware/orgs","repos_url":"https://api.github.com/users/vbauzysvmware/repos","events_url":"https://api.github.com/users/vbauzysvmware/events{/privacy}","received_events_url":"https://api.github.com/users/vbauzysvmware/received_events","type":"User","site_admin":false},"body":"Sorry, I meant 'willRefresh -> 'refresh' or something else","created_at":"2019-07-05T08:02:52Z","updated_at":"2019-07-05T08:02:52Z","html_url":"https://github.com/vmware/go-vcloud-director/pull/210#discussion_r300579514","pull_request_url":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/comments/300579514"},"html":{"href":"https://github.com/vmware/go-vcloud-director/pull/210#discussion_r300579514"},"pull_request":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210"}},"in_reply_to_id":300326274},"pull_request":{"url":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210","id":294231219,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk0MjMxMjE5","html_url":"https://github.com/vmware/go-vcloud-director/pull/210","diff_url":"https://github.com/vmware/go-vcloud-director/pull/210.diff","patch_url":"https://github.com/vmware/go-vcloud-director/pull/210.patch","issue_url":"https://api.github.com/repos/vmware/go-vcloud-director/issues/210","number":210,"state":"open","locked":false,"title":"Add CRUD operations for Org user","user":{"login":"dataclouder","id":11331818,"node_id":"MDQ6VXNlcjExMzMxODE4","avatar_url":"https://avatars0.githubusercontent.com/u/11331818?v=4","gravatar_id":"","url":"https://api.github.com/users/dataclouder","html_url":"https://github.com/dataclouder","followers_url":"https://api.github.com/users/dataclouder/followers","following_url":"https://api.github.com/users/dataclouder/following{/other_user}","gists_url":"https://api.github.com/users/dataclouder/gists{/gist_id}","starred_url":"https://api.github.com/users/dataclouder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dataclouder/subscriptions","organizations_url":"https://api.github.com/users/dataclouder/orgs","repos_url":"https://api.github.com/users/dataclouder/repos","events_url":"https://api.github.com/users/dataclouder/events{/privacy}","received_events_url":"https://api.github.com/users/dataclouder/received_events","type":"User","site_admin":false},"body":"* Update AdminOrg structure to include roles and users\r\n* Define the new type User\r\n* Define auxiliary types RoleReference, RightReference\r\n* Add AdminOrg methods GetRole, GetUserByNameOrId\r\n* Add AdminOrg methods CreateUser, SimpleCreateUser\r\n* Add OrgUser methods GetRoleName, Update, Enable, Disable\r\n* Add OrgUser methods UnconditionalDelete, SafeDelete\r\n* Add OrgUser methods ChangePassword, Unlock, TakeOwnership\r\n* Add tests for org user retrieval, creation, update, deletion\r\n\r\n","created_at":"2019-07-03T15:51:04Z","updated_at":"2019-07-05T08:02:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"863ead32fe3caff83069a9dbbfe1354753c13f60","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":997050390,"node_id":"MDU6TGFiZWw5OTcwNTAzOTA=","url":"https://api.github.com/repos/vmware/go-vcloud-director/labels/cla-not-required","name":"cla-not-required","color":"159818","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210/commits","review_comments_url":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210/comments","review_comment_url":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/go-vcloud-director/issues/210/comments","statuses_url":"https://api.github.com/repos/vmware/go-vcloud-director/statuses/ef9ab3a530e699f1e104df22478b696947d712cd","head":{"label":"dataclouder:add-org-user","ref":"add-org-user","sha":"ef9ab3a530e699f1e104df22478b696947d712cd","user":{"login":"dataclouder","id":11331818,"node_id":"MDQ6VXNlcjExMzMxODE4","avatar_url":"https://avatars0.githubusercontent.com/u/11331818?v=4","gravatar_id":"","url":"https://api.github.com/users/dataclouder","html_url":"https://github.com/dataclouder","followers_url":"https://api.github.com/users/dataclouder/followers","following_url":"https://api.github.com/users/dataclouder/following{/other_user}","gists_url":"https://api.github.com/users/dataclouder/gists{/gist_id}","starred_url":"https://api.github.com/users/dataclouder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dataclouder/subscriptions","organizations_url":"https://api.github.com/users/dataclouder/orgs","repos_url":"https://api.github.com/users/dataclouder/repos","events_url":"https://api.github.com/users/dataclouder/events{/privacy}","received_events_url":"https://api.github.com/users/dataclouder/received_events","type":"User","site_admin":false},"repo":{"id":144573879,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ1NzM4Nzk=","name":"go-vcloud-director","full_name":"dataclouder/go-vcloud-director","private":false,"owner":{"login":"dataclouder","id":11331818,"node_id":"MDQ6VXNlcjExMzMxODE4","avatar_url":"https://avatars0.githubusercontent.com/u/11331818?v=4","gravatar_id":"","url":"https://api.github.com/users/dataclouder","html_url":"https://github.com/dataclouder","followers_url":"https://api.github.com/users/dataclouder/followers","following_url":"https://api.github.com/users/dataclouder/following{/other_user}","gists_url":"https://api.github.com/users/dataclouder/gists{/gist_id}","starred_url":"https://api.github.com/users/dataclouder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dataclouder/subscriptions","organizations_url":"https://api.github.com/users/dataclouder/orgs","repos_url":"https://api.github.com/users/dataclouder/repos","events_url":"https://api.github.com/users/dataclouder/events{/privacy}","received_events_url":"https://api.github.com/users/dataclouder/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dataclouder/go-vcloud-director","description":"Golang SDK for vCloud Director","fork":true,"url":"https://api.github.com/repos/dataclouder/go-vcloud-director","forks_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/forks","keys_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/teams","hooks_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/hooks","issue_events_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/issues/events{/number}","events_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/events","assignees_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/assignees{/user}","branches_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/branches{/branch}","tags_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/tags","blobs_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/git/refs{/sha}","trees_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/statuses/{sha}","languages_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/languages","stargazers_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/stargazers","contributors_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/contributors","subscribers_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/subscribers","subscription_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/subscription","commits_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/commits{/sha}","git_commits_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/git/commits{/sha}","comments_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/comments{/number}","issue_comment_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/issues/comments{/number}","contents_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/contents/{+path}","compare_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/merges","archive_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/downloads","issues_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/issues{/number}","pulls_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/pulls{/number}","milestones_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/milestones{/number}","notifications_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/labels{/name}","releases_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/releases{/id}","deployments_url":"https://api.github.com/repos/dataclouder/go-vcloud-director/deployments","created_at":"2018-08-13T12:00:49Z","updated_at":"2019-07-03T16:44:55Z","pushed_at":"2019-07-04T13:14:45Z","git_url":"git://github.com/dataclouder/go-vcloud-director.git","ssh_url":"git@github.com:dataclouder/go-vcloud-director.git","clone_url":"https://github.com/dataclouder/go-vcloud-director.git","svn_url":"https://github.com/dataclouder/go-vcloud-director","homepage":"","size":1645,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vmware:master","ref":"master","sha":"8d1556058636ebf6bc8cc58cadb9ea38bbf7138d","user":{"login":"vmware","id":473334,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzMzNA==","avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":140753907,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA3NTM5MDc=","name":"go-vcloud-director","full_name":"vmware/go-vcloud-director","private":false,"owner":{"login":"vmware","id":473334,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzMzNA==","avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vmware/go-vcloud-director","description":"Golang SDK for vCloud Director","fork":false,"url":"https://api.github.com/repos/vmware/go-vcloud-director","forks_url":"https://api.github.com/repos/vmware/go-vcloud-director/forks","keys_url":"https://api.github.com/repos/vmware/go-vcloud-director/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/go-vcloud-director/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/go-vcloud-director/teams","hooks_url":"https://api.github.com/repos/vmware/go-vcloud-director/hooks","issue_events_url":"https://api.github.com/repos/vmware/go-vcloud-director/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/go-vcloud-director/events","assignees_url":"https://api.github.com/repos/vmware/go-vcloud-director/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/go-vcloud-director/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/go-vcloud-director/tags","blobs_url":"https://api.github.com/repos/vmware/go-vcloud-director/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/go-vcloud-director/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/go-vcloud-director/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/go-vcloud-director/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/go-vcloud-director/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/go-vcloud-director/languages","stargazers_url":"https://api.github.com/repos/vmware/go-vcloud-director/stargazers","contributors_url":"https://api.github.com/repos/vmware/go-vcloud-director/contributors","subscribers_url":"https://api.github.com/repos/vmware/go-vcloud-director/subscribers","subscription_url":"https://api.github.com/repos/vmware/go-vcloud-director/subscription","commits_url":"https://api.github.com/repos/vmware/go-vcloud-director/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/go-vcloud-director/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/go-vcloud-director/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/go-vcloud-director/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/go-vcloud-director/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/go-vcloud-director/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/go-vcloud-director/merges","archive_url":"https://api.github.com/repos/vmware/go-vcloud-director/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/go-vcloud-director/downloads","issues_url":"https://api.github.com/repos/vmware/go-vcloud-director/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/go-vcloud-director/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/go-vcloud-director/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/go-vcloud-director/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/go-vcloud-director/labels{/name}","releases_url":"https://api.github.com/repos/vmware/go-vcloud-director/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/go-vcloud-director/deployments","created_at":"2018-07-12T19:04:07Z","updated_at":"2019-07-02T10:20:45Z","pushed_at":"2019-07-04T13:14:47Z","git_url":"git://github.com/vmware/go-vcloud-director.git","ssh_url":"git@github.com:vmware/go-vcloud-director.git","clone_url":"https://github.com/vmware/go-vcloud-director.git","svn_url":"https://github.com/vmware/go-vcloud-director","homepage":"","size":1586,"stargazers_count":24,"watchers_count":24,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":43,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":24,"open_issues":43,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210"},"html":{"href":"https://github.com/vmware/go-vcloud-director/pull/210"},"issue":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/issues/210"},"comments":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/issues/210/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/pulls/210/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/go-vcloud-director/statuses/ef9ab3a530e699f1e104df22478b696947d712cd"}},"author_association":"COLLABORATOR"}}
other: {"actor":{"display_login":"vbauzysvmware"}}