Skip to content

Commit

Permalink
feat(workspace): use custom url types
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszPorowski committed Nov 12, 2024
1 parent 81f4780 commit 7f2e117
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions internal/services/workspace/data_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ func (d *dataSourceWorkspace) Schema(ctx context.Context, _ datasource.SchemaReq
"blob_endpoint": schema.StringAttribute{
MarkdownDescription: "The OneLake API endpoint available for Blob API operations.",
Computed: true,
CustomType: customtypes.URLType{},
},
"dfs_endpoint": schema.StringAttribute{
MarkdownDescription: "The OneLake API endpoint available for Distributed File System (DFS) or ADLSgen2 filesystem API operations.",
Computed: true,
CustomType: customtypes.URLType{},
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions internal/services/workspace/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ func (to *workspaceIdentityModel) set(from *fabcore.WorkspaceIdentity) {
}

type oneLakeEndpointsModel struct {
BlobEndpoint types.String `tfsdk:"blob_endpoint"`
DfsEndpoint types.String `tfsdk:"dfs_endpoint"`
BlobEndpoint customtypes.URL `tfsdk:"blob_endpoint"`
DfsEndpoint customtypes.URL `tfsdk:"dfs_endpoint"`
}

func (to *oneLakeEndpointsModel) set(from *fabcore.OneLakeEndpoints) {
to.BlobEndpoint = types.StringPointerValue(from.BlobEndpoint)
to.DfsEndpoint = types.StringPointerValue(from.DfsEndpoint)
to.BlobEndpoint = customtypes.NewURLPointerValue(from.BlobEndpoint)
to.DfsEndpoint = customtypes.NewURLPointerValue(from.DfsEndpoint)
}

func checkWorkspaceType(entity fabcore.WorkspaceInfo) diag.Diagnostics {
Expand Down
2 changes: 2 additions & 0 deletions internal/services/workspace/resource_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ func (r *resourceWorkspace) Schema(ctx context.Context, _ resource.SchemaRequest
"blob_endpoint": schema.StringAttribute{
MarkdownDescription: "The OneLake API endpoint available for Blob API operations.",
Computed: true,
CustomType: customtypes.URLType{},
},
"dfs_endpoint": schema.StringAttribute{
MarkdownDescription: "The OneLake API endpoint available for Distributed File System (DFS) or ADLSgen2 filesystem API operations.",
Computed: true,
CustomType: customtypes.URLType{},
},
},
},
Expand Down

0 comments on commit 7f2e117

Please sign in to comment.