{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/comments/242260856","pull_request_review_id":185730709,"id":242260856,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjI2MDg1Ng==","diff_hunk":"@@ -98,12 +97,45 @@ func Provider() terraform.ResourceProvider {\n \t\t\t\"google_project_services\":                dataSourceGoogleProjectServices(),\n \t\t\t\"google_service_account\":                 dataSourceGoogleServiceAccount(),\n \t\t\t\"google_service_account_key\":             dataSourceGoogleServiceAccountKey(),\n-\t\t\t\"google_storage_bucket_object\":           dataSourceGoogleStorageBucketObject(),\n \t\t\t\"google_storage_object_signed_url\":       dataSourceGoogleSignedUrl(),\n \t\t\t\"google_storage_project_service_account\": dataSourceGoogleStorageProjectServiceAccount(),\n \t\t},\n \n-\t\tResourcesMap: mergeResourceMaps(\n+\t\tResourcesMap: ResourceMap(),\n+\n+\t\tConfigureFunc: providerConfigure,\n+\t}\n+}\n+\n+func mergeResourceMaps(ms ...map[string]*schema.Resource) (map[string]*schema.Resource, error) {\n+\tmerged := make(map[string]*schema.Resource)\n+\tduplicates := []string{}\n+\n+\tfor _, m := range ms {\n+\t\tfor k, v := range m {\n+\t\t\tif _, ok := merged[k]; ok {\n+\t\t\t\tduplicates = append(duplicates, k)\n+\t\t\t}\n+\n+\t\t\tmerged[k] = v\n+\t\t}\n+\t}\n+\n+\tvar err error\n+\tif len(duplicates) > 0 {\n+\t\terr = fmt.Errorf(\"saw duplicates in mergeResourceMaps: %v\", duplicates)\n+\t}\n+\n+\treturn merged, err\n+}\n+\n+func ResourceMap() map[string]*schema.Resource {","path":"third_party/terraform/utils/provider.go.erb","position":21,"original_position":46,"commit_id":"8a795a39805ec80899b00effe1ca0a6280c99c90","original_commit_id":"0505d071544130d380d6ce09943456ab7a5b5d7a","user":{"login":"rileykarson","id":2080520,"node_id":"MDQ6VXNlcjIwODA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/2080520?v=4","gravatar_id":"","url":"https://api.github.com/users/rileykarson","html_url":"https://github.com/rileykarson","followers_url":"https://api.github.com/users/rileykarson/followers","following_url":"https://api.github.com/users/rileykarson/following{/other_user}","gists_url":"https://api.github.com/users/rileykarson/gists{/gist_id}","starred_url":"https://api.github.com/users/rileykarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rileykarson/subscriptions","organizations_url":"https://api.github.com/users/rileykarson/orgs","repos_url":"https://api.github.com/users/rileykarson/repos","events_url":"https://api.github.com/users/rileykarson/events{/privacy}","received_events_url":"https://api.github.com/users/rileykarson/received_events","type":"User","site_admin":false},"body":"If Go didn't require me to break this out into a function, it would totally just be a const - imo `Build` or `Get` or another prefix makes it sound like more is happening than actually is, so calling it the name of the resource is most clear. We're not really building or getting anything, this fn just returns the ResourceMap as a property.","created_at":"2018-12-17T18:21:44Z","updated_at":"2018-12-17T18:21:45Z","html_url":"https://github.com/GoogleCloudPlatform/magic-modules/pull/1065#discussion_r242260856","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/comments/242260856"},"html":{"href":"https://github.com/GoogleCloudPlatform/magic-modules/pull/1065#discussion_r242260856"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065"}},"in_reply_to_id":242250726},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065","id":238884722,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4ODg0NzIy","html_url":"https://github.com/GoogleCloudPlatform/magic-modules/pull/1065","diff_url":"https://github.com/GoogleCloudPlatform/magic-modules/pull/1065.diff","patch_url":"https://github.com/GoogleCloudPlatform/magic-modules/pull/1065.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/1065","number":1065,"state":"open","locked":false,"title":"[Terraform]: Remove duplicates from provider resource map, add dupe test","user":{"login":"rileykarson","id":2080520,"node_id":"MDQ6VXNlcjIwODA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/2080520?v=4","gravatar_id":"","url":"https://api.github.com/users/rileykarson","html_url":"https://github.com/rileykarson","followers_url":"https://api.github.com/users/rileykarson/followers","following_url":"https://api.github.com/users/rileykarson/following{/other_user}","gists_url":"https://api.github.com/users/rileykarson/gists{/gist_id}","starred_url":"https://api.github.com/users/rileykarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rileykarson/subscriptions","organizations_url":"https://api.github.com/users/rileykarson/orgs","repos_url":"https://api.github.com/users/rileykarson/repos","events_url":"https://api.github.com/users/rileykarson/events{/privacy}","received_events_url":"https://api.github.com/users/rileykarson/received_events","type":"User","site_admin":false},"body":"Supersedes https://github.com/GoogleCloudPlatform/magic-modules/pull/1064\r\n\r\nOh cool you PR'ed the changes and I had a test mostly done so let's combine them!\r\n\r\nAlso git is so cool - all I had to do was cherry pick your commit, and automerge figured this out!\r\n\r\n-----------------------------------------------------------------\r\n# [all]\r\n## [terraform]\r\nRemove duplicates from provider resource map, add dupe test\r\n### [terraform-beta]\r\n## [ansible]\r\n## [inspec]\r\n","created_at":"2018-12-15T02:15:21Z","updated_at":"2018-12-17T18:21:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c380e4e4c8706849f212eec5311821ac89971c9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":995484256,"node_id":"MDU6TGFiZWw5OTU0ODQyNTY=","url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false},{"id":918813420,"node_id":"MDU6TGFiZWw5MTg4MTM0MjA=","url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/labels/downstream-generated","name":"downstream-generated","color":"aaffd9","default":false},{"id":891510289,"node_id":"MDU6TGFiZWw4OTE1MTAyODk=","url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/labels/terraform","name":"terraform","color":"5C4EE5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/1065/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/8a795a39805ec80899b00effe1ca0a6280c99c90","head":{"label":"rileykarson:test-dupes","ref":"test-dupes","sha":"8a795a39805ec80899b00effe1ca0a6280c99c90","user":{"login":"rileykarson","id":2080520,"node_id":"MDQ6VXNlcjIwODA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/2080520?v=4","gravatar_id":"","url":"https://api.github.com/users/rileykarson","html_url":"https://github.com/rileykarson","followers_url":"https://api.github.com/users/rileykarson/followers","following_url":"https://api.github.com/users/rileykarson/following{/other_user}","gists_url":"https://api.github.com/users/rileykarson/gists{/gist_id}","starred_url":"https://api.github.com/users/rileykarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rileykarson/subscriptions","organizations_url":"https://api.github.com/users/rileykarson/orgs","repos_url":"https://api.github.com/users/rileykarson/repos","events_url":"https://api.github.com/users/rileykarson/events{/privacy}","received_events_url":"https://api.github.com/users/rileykarson/received_events","type":"User","site_admin":false},"repo":{"id":142906651,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI5MDY2NTE=","name":"magic-modules","full_name":"rileykarson/magic-modules","private":false,"owner":{"login":"rileykarson","id":2080520,"node_id":"MDQ6VXNlcjIwODA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/2080520?v=4","gravatar_id":"","url":"https://api.github.com/users/rileykarson","html_url":"https://github.com/rileykarson","followers_url":"https://api.github.com/users/rileykarson/followers","following_url":"https://api.github.com/users/rileykarson/following{/other_user}","gists_url":"https://api.github.com/users/rileykarson/gists{/gist_id}","starred_url":"https://api.github.com/users/rileykarson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rileykarson/subscriptions","organizations_url":"https://api.github.com/users/rileykarson/orgs","repos_url":"https://api.github.com/users/rileykarson/repos","events_url":"https://api.github.com/users/rileykarson/events{/privacy}","received_events_url":"https://api.github.com/users/rileykarson/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rileykarson/magic-modules","description":"Magic Modules: Automagically generate Google Cloud Platform support for OSS","fork":true,"url":"https://api.github.com/repos/rileykarson/magic-modules","forks_url":"https://api.github.com/repos/rileykarson/magic-modules/forks","keys_url":"https://api.github.com/repos/rileykarson/magic-modules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rileykarson/magic-modules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rileykarson/magic-modules/teams","hooks_url":"https://api.github.com/repos/rileykarson/magic-modules/hooks","issue_events_url":"https://api.github.com/repos/rileykarson/magic-modules/issues/events{/number}","events_url":"https://api.github.com/repos/rileykarson/magic-modules/events","assignees_url":"https://api.github.com/repos/rileykarson/magic-modules/assignees{/user}","branches_url":"https://api.github.com/repos/rileykarson/magic-modules/branches{/branch}","tags_url":"https://api.github.com/repos/rileykarson/magic-modules/tags","blobs_url":"https://api.github.com/repos/rileykarson/magic-modules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rileykarson/magic-modules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rileykarson/magic-modules/git/refs{/sha}","trees_url":"https://api.github.com/repos/rileykarson/magic-modules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rileykarson/magic-modules/statuses/{sha}","languages_url":"https://api.github.com/repos/rileykarson/magic-modules/languages","stargazers_url":"https://api.github.com/repos/rileykarson/magic-modules/stargazers","contributors_url":"https://api.github.com/repos/rileykarson/magic-modules/contributors","subscribers_url":"https://api.github.com/repos/rileykarson/magic-modules/subscribers","subscription_url":"https://api.github.com/repos/rileykarson/magic-modules/subscription","commits_url":"https://api.github.com/repos/rileykarson/magic-modules/commits{/sha}","git_commits_url":"https://api.github.com/repos/rileykarson/magic-modules/git/commits{/sha}","comments_url":"https://api.github.com/repos/rileykarson/magic-modules/comments{/number}","issue_comment_url":"https://api.github.com/repos/rileykarson/magic-modules/issues/comments{/number}","contents_url":"https://api.github.com/repos/rileykarson/magic-modules/contents/{+path}","compare_url":"https://api.github.com/repos/rileykarson/magic-modules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rileykarson/magic-modules/merges","archive_url":"https://api.github.com/repos/rileykarson/magic-modules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rileykarson/magic-modules/downloads","issues_url":"https://api.github.com/repos/rileykarson/magic-modules/issues{/number}","pulls_url":"https://api.github.com/repos/rileykarson/magic-modules/pulls{/number}","milestones_url":"https://api.github.com/repos/rileykarson/magic-modules/milestones{/number}","notifications_url":"https://api.github.com/repos/rileykarson/magic-modules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rileykarson/magic-modules/labels{/name}","releases_url":"https://api.github.com/repos/rileykarson/magic-modules/releases{/id}","deployments_url":"https://api.github.com/repos/rileykarson/magic-modules/deployments","created_at":"2018-07-30T17:24:41Z","updated_at":"2018-07-30T17:24:45Z","pushed_at":"2018-12-17T18:18:59Z","git_url":"git://github.com/rileykarson/magic-modules.git","ssh_url":"git@github.com:rileykarson/magic-modules.git","clone_url":"https://github.com/rileykarson/magic-modules.git","svn_url":"https://github.com/rileykarson/magic-modules","homepage":"","size":6019,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"9afd94b5301c4c39efdd78fa820f30092c6da98c","user":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":114834469,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ4MzQ0Njk=","name":"magic-modules","full_name":"GoogleCloudPlatform/magic-modules","private":false,"owner":{"login":"GoogleCloudPlatform","id":2810941,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTA5NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GoogleCloudPlatform/magic-modules","description":"Magic Modules: Automagically generate Google Cloud Platform support for OSS","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/deployments","created_at":"2017-12-20T02:39:56Z","updated_at":"2018-12-15T02:21:16Z","pushed_at":"2018-12-17T18:19:01Z","git_url":"git://github.com/GoogleCloudPlatform/magic-modules.git","ssh_url":"git@github.com:GoogleCloudPlatform/magic-modules.git","clone_url":"https://github.com/GoogleCloudPlatform/magic-modules.git","svn_url":"https://github.com/GoogleCloudPlatform/magic-modules","homepage":"","size":7055,"stargazers_count":107,"watchers_count":107,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":85,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":47,"open_issues":85,"watchers":107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065"},"html":{"href":"https://github.com/GoogleCloudPlatform/magic-modules/pull/1065"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/1065"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/issues/1065/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/pulls/1065/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/8a795a39805ec80899b00effe1ca0a6280c99c90"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rileykarson"}}