{"action":"created","comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/comments/238766118","pull_request_review_id":181384812,"id":238766118,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODc2NjExOA==","diff_hunk":"@@ -1,220 +1,536 @@\n+// ----------------------------------------------------------------------------\n+//\n+//     ***     AUTO GENERATED CODE    ***    AUTO GENERATED CODE     ***\n+//\n+// ----------------------------------------------------------------------------\n+//\n+//     This file is automatically generated by Magic Modules and manual\n+//     changes will be clobbered when the file is regenerated.\n+//\n+//     Please read more about how to change this file in\n+//     .github/CONTRIBUTING.md.\n+//\n+// ----------------------------------------------------------------------------\n+\n package google\n \n import (\n \t\"fmt\"\n \t\"log\"\n+\t\"reflect\"\n+\t\"strconv\"\n \t\"time\"\n \n+\t\"github.com/hashicorp/terraform/helper/customdiff\"\n \t\"github.com/hashicorp/terraform/helper/schema\"\n-\t\"google.golang.org/api/compute/v1\"\n-\t\"google.golang.org/api/googleapi\"\n+\tcompute \"google.golang.org/api/compute/v1\"\n )\n \n+func customDiffComputeSnapshotSnapshotEncryptionKeys(diff *schema.ResourceDiff, meta interface{}) error {\n+\t// oC -> Old Convenience Value\n+\t// nC -> New Convenience Value\n+\t// oN -> Old New Field Value\n+\t// nN -> New New Field Value\n+\toC, nC := diff.GetChange(\"snapshot_encryption_key_raw\")\n+\toN, nN := diff.GetChange(\"snapshot_encryption_key.0.raw_key\")\n+\n+\tif nC != \"\" && nN != \"\" {\n+\t\treturn fmt.Errorf(\"can't use snapshot_encryption_key_raw and snapshot_encryption_key.0.raw_key at the same time.\" +\n+\t\t\t\"If you're removing snapshot_encryption_key.0.raw_key, set the value to \\\"\\\" instead. This is due to limitations in terraform plan.\")\n+\t}\n+\n+\t// Either field (convenience or new) has a value\n+\t// and then has another different value, so we ForceNew.\n+\t// We need to handle _EVERY_ ForceNew case in this diff","path":"google-beta/resource_compute_snapshot.go","position":46,"original_position":46,"commit_id":"49bbb992e9b7a082d4644e04c1af6888f7ffe158","original_commit_id":"49bbb992e9b7a082d4644e04c1af6888f7ffe158","user":{"login":"paddycarver","id":59249,"node_id":"MDQ6VXNlcjU5MjQ5","avatar_url":"https://avatars0.githubusercontent.com/u/59249?v=4","gravatar_id":"","url":"https://api.github.com/users/paddycarver","html_url":"https://github.com/paddycarver","followers_url":"https://api.github.com/users/paddycarver/followers","following_url":"https://api.github.com/users/paddycarver/following{/other_user}","gists_url":"https://api.github.com/users/paddycarver/gists{/gist_id}","starred_url":"https://api.github.com/users/paddycarver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paddycarver/subscriptions","organizations_url":"https://api.github.com/users/paddycarver/orgs","repos_url":"https://api.github.com/users/paddycarver/repos","events_url":"https://api.github.com/users/paddycarver/events{/privacy}","received_events_url":"https://api.github.com/users/paddycarver/received_events","type":"User","site_admin":false},"body":"Could all of this be turned into a helper function (`customDiffComputeSnapshotSnapshotEncryptionKeysForceNew`?) that accepts the old and new values, and returns the field that is ForceNew as a string, or `\"\"` if no ForceNew is needed? I only ask because then we could do a table-driven unit test to make sure we're hitting all the edge cases without needing the expensive Terraform overhead. Just a thought, not a requirement.","created_at":"2018-12-04T17:39:22Z","updated_at":"2018-12-04T17:48:58Z","html_url":"https://github.com/terraform-providers/terraform-provider-google-beta/pull/173#discussion_r238766118","pull_request_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/comments/238766118"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-google-beta/pull/173#discussion_r238766118"},"pull_request":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173"}},"in_reply_to_id":238763179},"pull_request":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173","id":235889347,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1ODg5MzQ3","html_url":"https://github.com/terraform-providers/terraform-provider-google-beta/pull/173","diff_url":"https://github.com/terraform-providers/terraform-provider-google-beta/pull/173.diff","patch_url":"https://github.com/terraform-providers/terraform-provider-google-beta/pull/173.patch","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/issues/173","number":173,"state":"open","locked":false,"title":"Deprecate convenience fields in google_compute_snapshot","user":{"login":"modular-magician","id":36310445,"node_id":"MDQ6VXNlcjM2MzEwNDQ1","avatar_url":"https://avatars2.githubusercontent.com/u/36310445?v=4","gravatar_id":"","url":"https://api.github.com/users/modular-magician","html_url":"https://github.com/modular-magician","followers_url":"https://api.github.com/users/modular-magician/followers","following_url":"https://api.github.com/users/modular-magician/following{/other_user}","gists_url":"https://api.github.com/users/modular-magician/gists{/gist_id}","starred_url":"https://api.github.com/users/modular-magician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modular-magician/subscriptions","organizations_url":"https://api.github.com/users/modular-magician/orgs","repos_url":"https://api.github.com/users/modular-magician/repos","events_url":"https://api.github.com/users/modular-magician/events{/privacy}","received_events_url":"https://api.github.com/users/modular-magician/received_events","type":"User","site_admin":false},"body":"<!-- This change is generated by MagicModules. -->\n/cc @rileykarson","created_at":"2018-12-04T17:09:21Z","updated_at":"2018-12-04T17:48:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7098cee5f53ad3fb5da54f31101900486ced493","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1063778373,"node_id":"MDU6TGFiZWwxMDYzNzc4Mzcz","url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/labels/size/XXL","name":"size/XXL","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173/commits","review_comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173/comments","review_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/issues/173/comments","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/statuses/49bbb992e9b7a082d4644e04c1af6888f7ffe158","head":{"label":"modular-magician:codegen-pr-987","ref":"codegen-pr-987","sha":"49bbb992e9b7a082d4644e04c1af6888f7ffe158","user":{"login":"modular-magician","id":36310445,"node_id":"MDQ6VXNlcjM2MzEwNDQ1","avatar_url":"https://avatars2.githubusercontent.com/u/36310445?v=4","gravatar_id":"","url":"https://api.github.com/users/modular-magician","html_url":"https://github.com/modular-magician","followers_url":"https://api.github.com/users/modular-magician/followers","following_url":"https://api.github.com/users/modular-magician/following{/other_user}","gists_url":"https://api.github.com/users/modular-magician/gists{/gist_id}","starred_url":"https://api.github.com/users/modular-magician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modular-magician/subscriptions","organizations_url":"https://api.github.com/users/modular-magician/orgs","repos_url":"https://api.github.com/users/modular-magician/repos","events_url":"https://api.github.com/users/modular-magician/events{/privacy}","received_events_url":"https://api.github.com/users/modular-magician/received_events","type":"User","site_admin":false},"repo":{"id":150492330,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA0OTIzMzA=","name":"terraform-provider-google-beta","full_name":"modular-magician/terraform-provider-google-beta","private":false,"owner":{"login":"modular-magician","id":36310445,"node_id":"MDQ6VXNlcjM2MzEwNDQ1","avatar_url":"https://avatars2.githubusercontent.com/u/36310445?v=4","gravatar_id":"","url":"https://api.github.com/users/modular-magician","html_url":"https://github.com/modular-magician","followers_url":"https://api.github.com/users/modular-magician/followers","following_url":"https://api.github.com/users/modular-magician/following{/other_user}","gists_url":"https://api.github.com/users/modular-magician/gists{/gist_id}","starred_url":"https://api.github.com/users/modular-magician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modular-magician/subscriptions","organizations_url":"https://api.github.com/users/modular-magician/orgs","repos_url":"https://api.github.com/users/modular-magician/repos","events_url":"https://api.github.com/users/modular-magician/events{/privacy}","received_events_url":"https://api.github.com/users/modular-magician/received_events","type":"User","site_admin":false},"html_url":"https://github.com/modular-magician/terraform-provider-google-beta","description":"Terraform Google Cloud provider for Beta APIs and features","fork":true,"url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta","forks_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/forks","keys_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/teams","hooks_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/hooks","issue_events_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/issues/events{/number}","events_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/events","assignees_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/assignees{/user}","branches_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/branches{/branch}","tags_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/tags","blobs_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/git/refs{/sha}","trees_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/statuses/{sha}","languages_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/languages","stargazers_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/stargazers","contributors_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/contributors","subscribers_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/subscribers","subscription_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/subscription","commits_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/commits{/sha}","git_commits_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/git/commits{/sha}","comments_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/comments{/number}","issue_comment_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/issues/comments{/number}","contents_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/contents/{+path}","compare_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/merges","archive_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/downloads","issues_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/issues{/number}","pulls_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/pulls{/number}","milestones_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/milestones{/number}","notifications_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/labels{/name}","releases_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/releases{/id}","deployments_url":"https://api.github.com/repos/modular-magician/terraform-provider-google-beta/deployments","created_at":"2018-09-26T21:28:36Z","updated_at":"2018-09-26T22:22:22Z","pushed_at":"2018-12-04T17:04:30Z","git_url":"git://github.com/modular-magician/terraform-provider-google-beta.git","ssh_url":"git@github.com:modular-magician/terraform-provider-google-beta.git","clone_url":"https://github.com/modular-magician/terraform-provider-google-beta.git","svn_url":"https://github.com/modular-magician/terraform-provider-google-beta","homepage":"https://www.terraform.io/docs/providers/google-beta/","size":14360,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"terraform-providers:2.0.0","ref":"2.0.0","sha":"6c9f6ae34b028adb6b6fb73767b5c037e4a828a0","user":{"login":"terraform-providers","id":29154831,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTU0ODMx","avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"repo":{"id":149645874,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk2NDU4NzQ=","name":"terraform-provider-google-beta","full_name":"terraform-providers/terraform-provider-google-beta","private":false,"owner":{"login":"terraform-providers","id":29154831,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTU0ODMx","avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/terraform-providers/terraform-provider-google-beta","description":"Terraform Google Cloud Platform Beta provider","fork":false,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta","forks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/forks","keys_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/teams","hooks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/hooks","issue_events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/issues/events{/number}","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/events","assignees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/assignees{/user}","branches_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/branches{/branch}","tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/tags","blobs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/git/refs{/sha}","trees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/statuses/{sha}","languages_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/languages","stargazers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/stargazers","contributors_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/contributors","subscribers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/subscribers","subscription_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/subscription","commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/commits{/sha}","git_commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/git/commits{/sha}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/comments{/number}","issue_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/issues/comments{/number}","contents_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/contents/{+path}","compare_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/merges","archive_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/downloads","issues_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/issues{/number}","pulls_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls{/number}","milestones_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/milestones{/number}","notifications_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/labels{/name}","releases_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/releases{/id}","deployments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/deployments","created_at":"2018-09-20T17:28:45Z","updated_at":"2018-12-03T17:21:25Z","pushed_at":"2018-12-04T17:09:22Z","git_url":"git://github.com/terraform-providers/terraform-provider-google-beta.git","ssh_url":"git@github.com:terraform-providers/terraform-provider-google-beta.git","clone_url":"https://github.com/terraform-providers/terraform-provider-google-beta.git","svn_url":"https://github.com/terraform-providers/terraform-provider-google-beta","homepage":"https://www.terraform.io/docs/providers/google-beta/","size":14291,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":13,"open_issues":15,"watchers":8,"default_branch":"2.0.0"}},"_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-google-beta/pull/173"},"issue":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/issues/173"},"comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/issues/173/comments"},"review_comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173/comments"},"review_comment":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/pulls/173/commits"},"statuses":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-google-beta/statuses/49bbb992e9b7a082d4644e04c1af6888f7ffe158"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"paddycarver"}}