Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change a few ExactlyOneOfs of nested blocks to AtLeastOneOfs #5194

Merged
merged 1 commit into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions google/resource_compute_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ specifies a protocol and port-range tuple that describes a permitted
connection.`,
Elem: computeFirewallAllowSchema(),
Set: resourceComputeFirewallRuleHash,
ExactlyOneOf: []string{"allow", "deny"},
AtLeastOneOf: []string{"allow", "deny"},
},
"deny": {
Type: schema.TypeSet,
Expand All @@ -109,7 +109,7 @@ connection.`,
a protocol and port-range tuple that describes a denied connection.`,
Elem: computeFirewallDenySchema(),
Set: resourceComputeFirewallRuleHash,
ExactlyOneOf: []string{"allow", "deny"},
AtLeastOneOf: []string{"allow", "deny"},
},
"description": {
Type: schema.TypeString,
Expand Down
10 changes: 5 additions & 5 deletions google/resource_compute_health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"http_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -316,7 +316,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"https_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -395,7 +395,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"ssl_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -467,7 +467,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"tcp_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -539,7 +539,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"timeout_sec": {
Type: schema.TypeInt,
Expand Down
10 changes: 5 additions & 5 deletions google/resource_compute_region_health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"http_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -233,7 +233,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"https_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -312,7 +312,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"region": {
Type: schema.TypeString,
Expand Down Expand Up @@ -393,7 +393,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"tcp_health_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -465,7 +465,7 @@ can only be ASCII.`,
},
},
},
ExactlyOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
AtLeastOneOf: []string{"http_health_check", "https_health_check", "http2_health_check", "tcp_health_check", "ssl_health_check"},
},
"timeout_sec": {
Type: schema.TypeInt,
Expand Down
20 changes: 12 additions & 8 deletions google/resource_google_organization_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"allow": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
ExactlyOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
// TODO(terraform-providers/terraform-provider-google#5193): Change back to exactly_one_of
// once hashicorp/terraform-plugin-sdk#280 is fixed
AtLeastOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"all": {
Expand All @@ -63,10 +65,12 @@ var schemaOrganizationPolicy = map[string]*schema.Schema{
},
},
"deny": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
ExactlyOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
// TODO(terraform-providers/terraform-provider-google#5193): Change back to exactly_one_of
// once hashicorp/terraform-plugin-sdk#280 is fixed
AtLeastOneOf: []string{"list_policy.0.allow", "list_policy.0.deny"},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"all": {
Expand Down