Skip to content

Commit 746be08

Browse files
feat(api): api update
1 parent a2c5c6a commit 746be08

File tree

7 files changed

+36
-19
lines changed

7 files changed

+36
-19
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: 1781
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8efc1376a00d3137b7e83d6ad94f80d1d8058d4997322d23fb263bcf50cdf112.yml
3-
openapi_spec_hash: 6a0341306821788fa1c9f839bd0ae3cc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b3ce752c7b171704ed785a8f35bc61b15aa712792e749d831614cfff7b55058.yml
3+
openapi_spec_hash: 6b85b7c798ade6f47a69fa057c470e35
44
config_hash: 11218d4e895d6852fa70acc77ad5da3d

internal/services/workers_for_platforms_dispatch_namespace/data_source_model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type WorkersForPlatformsDispatchNamespaceDataSourceModel struct {
2727
NamespaceID types.String `tfsdk:"namespace_id" json:"namespace_id,computed"`
2828
NamespaceName types.String `tfsdk:"namespace_name" json:"namespace_name,computed"`
2929
ScriptCount types.Int64 `tfsdk:"script_count" json:"script_count,computed"`
30+
TrustedWorkers types.Bool `tfsdk:"trusted_workers" json:"trusted_workers,computed"`
3031
}
3132

3233
func (m *WorkersForPlatformsDispatchNamespaceDataSourceModel) toReadParams(_ context.Context) (params workers_for_platforms.DispatchNamespaceGetParams, diags diag.Diagnostics) {

internal/services/workers_for_platforms_dispatch_namespace/data_source_schema.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ func DataSourceSchema(ctx context.Context) schema.Schema {
5757
Description: "The current number of scripts in this Dispatch Namespace.",
5858
Computed: true,
5959
},
60+
"trusted_workers": schema.BoolAttribute{
61+
Description: "Whether the Workers in the namespace are executed in a \"trusted\" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the `request.cf` object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and `request.cf` is undefined. By default, Workers in a namespace are \"untrusted\".",
62+
Computed: true,
63+
},
6064
},
6165
}
6266
}

internal/services/workers_for_platforms_dispatch_namespace/list_data_source_model.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ func (m *WorkersForPlatformsDispatchNamespacesDataSourceModel) toListParams(_ co
3232
}
3333

3434
type WorkersForPlatformsDispatchNamespacesResultDataSourceModel struct {
35-
CreatedBy types.String `tfsdk:"created_by" json:"created_by,computed"`
36-
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
37-
ModifiedBy types.String `tfsdk:"modified_by" json:"modified_by,computed"`
38-
ModifiedOn timetypes.RFC3339 `tfsdk:"modified_on" json:"modified_on,computed" format:"date-time"`
39-
NamespaceID types.String `tfsdk:"namespace_id" json:"namespace_id,computed"`
40-
NamespaceName types.String `tfsdk:"namespace_name" json:"namespace_name,computed"`
41-
ScriptCount types.Int64 `tfsdk:"script_count" json:"script_count,computed"`
35+
CreatedBy types.String `tfsdk:"created_by" json:"created_by,computed"`
36+
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
37+
ModifiedBy types.String `tfsdk:"modified_by" json:"modified_by,computed"`
38+
ModifiedOn timetypes.RFC3339 `tfsdk:"modified_on" json:"modified_on,computed" format:"date-time"`
39+
NamespaceID types.String `tfsdk:"namespace_id" json:"namespace_id,computed"`
40+
NamespaceName types.String `tfsdk:"namespace_name" json:"namespace_name,computed"`
41+
ScriptCount types.Int64 `tfsdk:"script_count" json:"script_count,computed"`
42+
TrustedWorkers types.Bool `tfsdk:"trusted_workers" json:"trusted_workers,computed"`
4243
}

internal/services/workers_for_platforms_dispatch_namespace/list_data_source_schema.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func ListDataSourceSchema(ctx context.Context) schema.Schema {
6565
Description: "The current number of scripts in this Dispatch Namespace.",
6666
Computed: true,
6767
},
68+
"trusted_workers": schema.BoolAttribute{
69+
Description: "Whether the Workers in the namespace are executed in a \"trusted\" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the `request.cf` object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and `request.cf` is undefined. By default, Workers in a namespace are \"untrusted\".",
70+
Computed: true,
71+
},
6872
},
6973
},
7074
},

internal/services/workers_for_platforms_dispatch_namespace/model.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ type WorkersForPlatformsDispatchNamespaceResultEnvelope struct {
1313
}
1414

1515
type WorkersForPlatformsDispatchNamespaceModel struct {
16-
ID types.String `tfsdk:"id" json:"-,computed"`
17-
NamespaceName types.String `tfsdk:"namespace_name" json:"namespace_name,computed"`
18-
AccountID types.String `tfsdk:"account_id" path:"account_id,required"`
19-
Name types.String `tfsdk:"name" json:"name,optional,no_refresh"`
20-
CreatedBy types.String `tfsdk:"created_by" json:"created_by,computed"`
21-
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
22-
ModifiedBy types.String `tfsdk:"modified_by" json:"modified_by,computed"`
23-
ModifiedOn timetypes.RFC3339 `tfsdk:"modified_on" json:"modified_on,computed" format:"date-time"`
24-
NamespaceID types.String `tfsdk:"namespace_id" json:"namespace_id,computed"`
25-
ScriptCount types.Int64 `tfsdk:"script_count" json:"script_count,computed"`
16+
ID types.String `tfsdk:"id" json:"-,computed"`
17+
NamespaceName types.String `tfsdk:"namespace_name" json:"namespace_name,computed"`
18+
AccountID types.String `tfsdk:"account_id" path:"account_id,required"`
19+
Name types.String `tfsdk:"name" json:"name,optional,no_refresh"`
20+
CreatedBy types.String `tfsdk:"created_by" json:"created_by,computed"`
21+
CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
22+
ModifiedBy types.String `tfsdk:"modified_by" json:"modified_by,computed"`
23+
ModifiedOn timetypes.RFC3339 `tfsdk:"modified_on" json:"modified_on,computed" format:"date-time"`
24+
NamespaceID types.String `tfsdk:"namespace_id" json:"namespace_id,computed"`
25+
ScriptCount types.Int64 `tfsdk:"script_count" json:"script_count,computed"`
26+
TrustedWorkers types.Bool `tfsdk:"trusted_workers" json:"trusted_workers,computed"`
2627
}
2728

2829
func (m WorkersForPlatformsDispatchNamespaceModel) MarshalJSON() (data []byte, err error) {

internal/services/workers_for_platforms_dispatch_namespace/schema.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/hashicorp/terraform-plugin-framework-timetypes/timetypes"
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
)
@@ -63,6 +64,11 @@ func ResourceSchema(ctx context.Context) schema.Schema {
6364
Description: "The current number of scripts in this Dispatch Namespace.",
6465
Computed: true,
6566
},
67+
"trusted_workers": schema.BoolAttribute{
68+
Description: "Whether the Workers in the namespace are executed in a \"trusted\" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the `request.cf` object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and `request.cf` is undefined. By default, Workers in a namespace are \"untrusted\".",
69+
Computed: true,
70+
Default: booldefault.StaticBool(false),
71+
},
6672
},
6773
}
6874
}

0 commit comments

Comments
 (0)