66
77 "github.com/hashicorp/terraform-plugin-framework/resource"
88 "github.com/hashicorp/terraform-plugin-framework/resource/schema"
9- "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
109 "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
1110 "github.com/hashicorp/terraform-plugin-framework/types"
1211 "github.com/passbolt/go-passbolt/api"
@@ -32,7 +31,6 @@ type folderResource struct {
3231type foldersModelCreate struct {
3332 ID types.String `tfsdk:"id"`
3433 Name types.String `tfsdk:"name"`
35- Personal types.Bool `tfsdk:"personal"`
3634 FolderParentId types.String `tfsdk:"folder_parent_id"`
3735}
3836
@@ -79,12 +77,6 @@ func (r *folderResource) Schema(_ context.Context, _ resource.SchemaRequest, res
7977 Computed : true ,
8078 Default : stringdefault .StaticString ("" ),
8179 },
82- "personal" : schema.BoolAttribute {
83- Description : "If the folder is a personal folder." ,
84- Computed : true ,
85- Optional : true ,
86- Default : booldefault .StaticBool (true ),
87- },
8880 },
8981 }
9082}
@@ -108,7 +100,6 @@ func (r *folderResource) Create(ctx context.Context, req resource.CreateRequest,
108100 // Generate API request body from plan
109101 var folder = api.Folder {
110102 Name : plan .Name .ValueString (),
111- Personal : plan .Personal .ValueBool (),
112103 FolderParentID : plan .FolderParentId .ValueString (),
113104 }
114105
@@ -130,6 +121,7 @@ func (r *folderResource) Create(ctx context.Context, req resource.CreateRequest,
130121
131122 // Map response body to schema and populate Computed attribute values
132123 plan .ID = types .StringValue (cFolder .ID )
124+ plan .FolderParentId = types .StringValue (cFolder .FolderParentID )
133125
134126 // Set state to fully populated data
135127 diags = resp .State .Set (ctx , plan )
@@ -160,7 +152,6 @@ func (r *folderResource) Read(ctx context.Context, req resource.ReadRequest, res
160152
161153 state .ID = types .StringValue (folder .ID )
162154 state .Name = types .StringValue (folder .Name )
163- state .Personal = types .BoolValue (folder .Personal )
164155 state .FolderParentId = types .StringValue (folder .FolderParentID )
165156
166157 // Set state to fully populated data
@@ -184,7 +175,6 @@ func (r *folderResource) Update(ctx context.Context, req resource.UpdateRequest,
184175 // Generate API request body from plan
185176 var folder = api.Folder {
186177 Name : plan .Name .ValueString (),
187- Personal : plan .Personal .ValueBool (),
188178 FolderParentID : plan .FolderParentId .ValueString (),
189179 }
190180
@@ -215,7 +205,6 @@ func (r *folderResource) Update(ctx context.Context, req resource.UpdateRequest,
215205 // Map response body to schema and populate Computed attribute values
216206 plan .ID = types .StringValue (cFolder .ID )
217207 plan .Name = types .StringValue (cFolder .Name )
218- plan .Personal = types .BoolValue (cFolder .Personal )
219208 // This uses folder instead of cFolder since cFolder may contain the previous parent ID if a move operation was performed.
220209 plan .FolderParentId = types .StringValue (folder .FolderParentID )
221210
0 commit comments