Skip to content

Commit

Permalink
change a few ExactlyOneOfs of nested blocks to AtLeastOneOfs (#5194)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and danawillow committed Dec 16, 2019
1 parent 37a4514 commit eeebe1c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
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

0 comments on commit eeebe1c

Please sign in to comment.