@@ -8,36 +8,35 @@ import (
8
8
"github.com/hashicorp/terraform-plugin-framework/types"
9
9
)
10
10
11
- // WorkspaceDataSourceModel describes the data source data model.
12
- type WorkspaceDataSourceModel struct {
13
- Id types.String `tfsdk:"id"`
14
- Name types.String `tfsdk:"name"`
15
- Description types.String `tfsdk:"description"`
16
- OrganizationName types.String `tfsdk:"organization_name"`
17
- CicdEnforcedDefault types.Bool `tfsdk:"cicd_enforced_default"`
18
- CreatedAt types.String `tfsdk:"created_at"`
19
- UpdatedAt types.String `tfsdk:"updated_at"`
20
- CreatedBy * SubjectProfileModel `tfsdk:"created_by"`
21
- UpdatedBy * SubjectProfileModel `tfsdk:"updated_by"`
11
+ // WorkspaceDataSource describes the data source data model.
12
+ type WorkspaceDataSource struct {
13
+ Id types.String `tfsdk:"id"`
14
+ Name types.String `tfsdk:"name"`
15
+ Description types.String `tfsdk:"description"`
16
+ OrganizationName types.String `tfsdk:"organization_name"`
17
+ CicdEnforcedDefault types.Bool `tfsdk:"cicd_enforced_default"`
18
+ CreatedAt types.String `tfsdk:"created_at"`
19
+ UpdatedAt types.String `tfsdk:"updated_at"`
20
+ CreatedBy types. Object `tfsdk:"created_by"`
21
+ UpdatedBy types. Object `tfsdk:"updated_by"`
22
22
}
23
23
24
- // WorkspaceResourceModel describes the resource data model.
25
- type WorkspaceResourceModel struct {
26
- Id types.String `tfsdk:"id"`
27
- Name types.String `tfsdk:"name"`
28
- Description types.String `tfsdk:"description"`
29
- OrganizationName types.String `tfsdk:"organization_name"`
30
- CicdEnforcedDefault types.Bool `tfsdk:"cicd_enforced_default"`
31
- CreatedAt types.String `tfsdk:"created_at"`
32
- UpdatedAt types.String `tfsdk:"updated_at"`
33
- CreatedBy * SubjectProfileModel `tfsdk:"created_by"`
34
- UpdatedBy * SubjectProfileModel `tfsdk:"updated_by"`
24
+ // WorkspaceResource describes the resource data model.
25
+ type WorkspaceResource struct {
26
+ Id types.String `tfsdk:"id"`
27
+ Name types.String `tfsdk:"name"`
28
+ Description types.String `tfsdk:"description"`
29
+ OrganizationName types.String `tfsdk:"organization_name"`
30
+ CicdEnforcedDefault types.Bool `tfsdk:"cicd_enforced_default"`
31
+ CreatedAt types.String `tfsdk:"created_at"`
32
+ UpdatedAt types.String `tfsdk:"updated_at"`
33
+ CreatedBy types. Object `tfsdk:"created_by"`
34
+ UpdatedBy types. Object `tfsdk:"updated_by"`
35
35
}
36
36
37
- func FillWorkspaceResourceState (
37
+ func ( data * WorkspaceResource ) ReadFromResponse (
38
38
ctx context.Context ,
39
39
workspace * platform.Workspace ,
40
- data * WorkspaceResourceModel ,
41
40
) diag.Diagnostics {
42
41
data .Id = types .StringValue (workspace .Id )
43
42
data .Name = types .StringValue (workspace .Name )
@@ -63,10 +62,9 @@ func FillWorkspaceResourceState(
63
62
return nil
64
63
}
65
64
66
- func FillWorkspaceDataSourceState (
65
+ func ( data * WorkspaceDataSource ) ReadFromResponse (
67
66
ctx context.Context ,
68
67
workspace * platform.Workspace ,
69
- data * WorkspaceDataSourceModel ,
70
68
) diag.Diagnostics {
71
69
data .Id = types .StringValue (workspace .Id )
72
70
data .Name = types .StringValue (workspace .Name )
0 commit comments