Skip to content

Commit 808598c

Browse files
chore(api): Specify default value for Zone Lockdown 'paused' property
1 parent 072f9f7 commit 808598c

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1769
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-64386694cfc0ee9d354e15bb6398ccbdc66e4bd51c1af0d0d531e4b938e5930b.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e53659eea1b4f1fb11addaddb82880c177d8fa3e7a93f0d664a65e43ac526f4.yml
33
openapi_spec_hash: 3e0f59ac2722028954566a4c850e8849
4-
config_hash: eb5c619d50d6dd1b8cc66f03d5649c28
4+
config_hash: fba73e92c75cff1909420025367fd0c0

internal/services/firewall_rule/schema.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1212
"github.com/hashicorp/terraform-plugin-framework/resource"
1313
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
14-
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
1514
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1615
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1716
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
@@ -106,7 +105,6 @@ func ResourceSchema(ctx context.Context) schema.Schema {
106105
"paused": schema.BoolAttribute{
107106
Description: "When true, indicates that the firewall rule is currently paused.",
108107
Computed: true,
109-
Default: booldefault.StaticBool(false),
110108
},
111109
"priority": schema.Float64Attribute{
112110
Description: "The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority.",

internal/services/user_agent_blocking_rule/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type UserAgentBlockingRuleModel struct {
1717
Mode types.String `tfsdk:"mode" json:"mode,required"`
1818
Configuration *UserAgentBlockingRuleConfigurationModel `tfsdk:"configuration" json:"configuration,required"`
1919
Description types.String `tfsdk:"description" json:"description,optional"`
20-
Paused types.Bool `tfsdk:"paused" json:"paused,optional"`
20+
Paused types.Bool `tfsdk:"paused" json:"paused,computed_optional"`
2121
}
2222

2323
func (m UserAgentBlockingRuleModel) MarshalJSON() (data []byte, err error) {

internal/services/user_agent_blocking_rule/schema.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
99
"github.com/hashicorp/terraform-plugin-framework/resource"
1010
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
11+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
1112
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1213
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1314
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
@@ -63,7 +64,9 @@ func ResourceSchema(ctx context.Context) schema.Schema {
6364
},
6465
"paused": schema.BoolAttribute{
6566
Description: "When true, indicates that the rule is currently paused.",
67+
Computed: true,
6668
Optional: true,
69+
Default: booldefault.StaticBool(false),
6770
},
6871
},
6972
}

internal/services/zone_lockdown/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ type ZoneLockdownModel struct {
1616
ID types.String `tfsdk:"id" json:"id,computed"`
1717
ZoneID types.String `tfsdk:"zone_id" path:"zone_id,required"`
1818
Description types.String `tfsdk:"description" json:"description,optional"`
19-
Paused types.Bool `tfsdk:"paused" json:"paused,optional"`
2019
Priority types.Float64 `tfsdk:"priority" json:"priority,optional,no_refresh"`
20+
Paused types.Bool `tfsdk:"paused" json:"paused,computed_optional"`
2121
URLs *[]types.String `tfsdk:"urls" json:"urls,required"`
2222
Configurations *[]*ZoneLockdownConfigurationsModel `tfsdk:"configurations" json:"configurations,required"`
2323
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`

internal/services/zone_lockdown/schema.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1010
"github.com/hashicorp/terraform-plugin-framework/resource"
1111
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
12+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
1213
"github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
1314
"github.com/hashicorp/terraform-plugin-framework/resource/schema/float64planmodifier"
1415
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
@@ -37,16 +38,18 @@ func ResourceSchema(ctx context.Context) schema.Schema {
3738
Optional: true,
3839
PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()},
3940
},
40-
"paused": schema.BoolAttribute{
41-
Description: "When true, indicates that the rule is currently paused.",
42-
Optional: true,
43-
PlanModifiers: []planmodifier.Bool{boolplanmodifier.RequiresReplace()},
44-
},
4541
"priority": schema.Float64Attribute{
4642
Description: "The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.",
4743
Optional: true,
4844
PlanModifiers: []planmodifier.Float64{float64planmodifier.RequiresReplace()},
4945
},
46+
"paused": schema.BoolAttribute{
47+
Description: "When true, indicates that the rule is currently paused.",
48+
Computed: true,
49+
Optional: true,
50+
PlanModifiers: []planmodifier.Bool{boolplanmodifier.RequiresReplaceIfConfigured()},
51+
Default: booldefault.StaticBool(false),
52+
},
5053
"urls": schema.ListAttribute{
5154
Description: "The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.",
5255
Required: true,

0 commit comments

Comments
 (0)