Skip to content

[AzDatalake] File Client Support #21141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 64 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e8167a2
Enable gocritic during linting (#20715)
jhendrixMSFT Apr 28, 2023
86627ae
Cosmos DB: Enable merge support (#20716)
ealsur Apr 28, 2023
8ac8c6d
[azservicebus, azeventhubs] Stress test and logging improvement (#20710)
richardpark-msft May 1, 2023
9111616
update proxy version (#20712)
azure-sdk May 1, 2023
d6bf190
Return an error when you try to send a message that's too large. (#20…
richardpark-msft May 1, 2023
e2693bd
Changes in test that is failing in pipeline (#20693)
siminsavani-msft May 2, 2023
03f0ac3
[azservicebus, azeventhubs] Treat 'entity full' as a fatal error (#20…
richardpark-msft May 2, 2023
838842d
[azservicebus/azeventhubs] Redirect stderr and stdout to tee (#20726)
richardpark-msft May 3, 2023
20b4dd8
Update changelog with latest features (#20730)
jhendrixMSFT May 3, 2023
745d967
pass along the artifact name so we can override it later (#20732)
azure-sdk May 3, 2023
6dfd0cb
[azeventhubs] Fixing checkpoint store race condition (#20727)
richardpark-msft May 3, 2023
ed7f3c7
Fix azidentity troubleshooting guide link (#20736)
chlowell May 3, 2023
b2cddab
[Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 (…
Alancere May 4, 2023
2a8d96d
add sdk/resourcemanager/postgresql/armpostgresql live test (#20685)
Alancere May 4, 2023
0d22aed
add sdk/resourcemanager/eventhub/armeventhub live test (#20686)
Alancere May 4, 2023
5fa7df4
add sdk/resourcemanager/compute/armcompute live test (#20048)
Alancere May 4, 2023
c005ed6
sdk/resourcemanager/network/armnetwork live test (#20331)
Alancere May 4, 2023
36f766d
add sdk/resourcemanager/cosmos/armcosmos live test (#20705)
Alancere May 4, 2023
9c9d62a
Increment package version after release of azcore (#20740)
azure-sdk May 4, 2023
8bc3450
[azeventhubs] Improperly resetting etag in the checkpoint store (#20737)
richardpark-msft May 4, 2023
e1a6152
Eng workflows sync and branch cleanup additions (#20743)
azure-sdk May 4, 2023
04b463d
[azeventhubs] Latest start position can also be inclusive (ie, get th…
richardpark-msft May 4, 2023
8849196
Update GitHubEventProcessor version and remove pull_request_review pr…
azure-sdk May 5, 2023
27f5ee0
Rename DisableAuthorityValidationAndInstanceDiscovery (#20746)
chlowell May 5, 2023
2eec707
fix (#20707)
Alancere May 6, 2023
22db2d4
AzFile (#20739)
souravgupta-msft May 8, 2023
0cbfd88
azfile: Fixing connection string parsing logic (#20798)
souravgupta-msft May 8, 2023
d54fb08
[azadmin] fix flaky test (#20758)
gracewilcox May 8, 2023
ad8ebd9
Prepare azidentity v1.3.0 for release (#20756)
chlowell May 8, 2023
e2a6f70
Fix broken podman link (#20801)
azure-sdk May 8, 2023
a59d912
[azquery] update doc comments (#20755)
gracewilcox May 8, 2023
bd3b467
Fixed contribution section (#20752)
bobtabor-msft May 8, 2023
132a01a
[azeventhubs,azservicebus] Some API cleanup, renames (#20754)
richardpark-msft May 8, 2023
8db51ca
Add supporting features to enable distributed tracing (#20301) (#20708)
jhendrixMSFT May 9, 2023
4a66b4f
Restore ARM CAE support for azcore beta (#20657)
chlowell May 9, 2023
7d4a3cb
Upgrade to stable azcore (#20808)
chlowell May 9, 2023
068c3be
Increment package version after release of data/azcosmos (#20807)
azure-sdk May 9, 2023
8e0f66e
Updating changelog (#20810)
souravgupta-msft May 9, 2023
ce926c4
Add fake package to azcore (#20711)
jhendrixMSFT May 9, 2023
1a145c5
Updating CHANGELOG.md (#20809)
siminsavani-msft May 9, 2023
90dfc5c
changelog (#20811)
tasherif-msft May 9, 2023
c7eda59
Increment package version after release of storage/azfile (#20813)
azure-sdk May 9, 2023
7fac0b5
Update changelog (azblob) (#20815)
siminsavani-msft May 9, 2023
498a2ef
[azquery] migration guide (#20742)
gracewilcox May 9, 2023
ccb967e
Increment package version after release of monitor/azquery (#20820)
azure-sdk May 9, 2023
f4e6a22
[keyvault] prep for release (#20819)
gracewilcox May 10, 2023
8fd8eda
Merge branch 'main' into feature/azdatalake
tasherif-msft May 11, 2023
c94fa00
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft May 11, 2023
fc0b2b5
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jun 12, 2023
6fb1694
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jun 19, 2023
4f7fe43
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jun 26, 2023
3dac9d0
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jul 4, 2023
a0a861b
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft Jul 7, 2023
875d7f8
added apis and models
tasherif-msft Jul 11, 2023
ce21510
cleanup
tasherif-msft Jul 11, 2023
eebaf1a
cleanup + block blob client
tasherif-msft Jul 11, 2023
7cf4cb7
added tests
tasherif-msft Jul 18, 2023
9f451f0
added tests
tasherif-msft Jul 18, 2023
4cf2387
added tests
tasherif-msft Jul 18, 2023
0e5df49
added more tests
tasherif-msft Jul 18, 2023
a990209
added more tests
tasherif-msft Jul 18, 2023
ec3dc66
dir block client
tasherif-msft Jul 18, 2023
98bcd09
sas test
tasherif-msft Jul 18, 2023
93250db
sas test
tasherif-msft Jul 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/storage/azdatalake/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/storage/azdatalake",
"Tag": "go/storage/azdatalake_e05ec93d89"
"Tag": "go/storage/azdatalake_820b86faa9"
}
3 changes: 3 additions & 0 deletions sdk/storage/azdatalake/datalakeerror/error_codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,7 @@ const (
var (
// MissingSharedKeyCredential - Error is returned when SAS URL is being created without SharedKeyCredential.
MissingSharedKeyCredential = bloberror.MissingSharedKeyCredential

// MissingParameters - Error is returned when at least one parameter should be set for any API.
MissingParameters = errors.New("at least one parameter should be set for SetAccessControl API")
)
26 changes: 13 additions & 13 deletions sdk/storage/azdatalake/directory/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/base"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
Expand All @@ -22,7 +22,7 @@ import (
type ClientOptions base.ClientOptions

// Client represents a URL to the Azure Datalake Storage service.
type Client base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client]
type Client base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client]

// NewClient creates an instance of Client with the specified values.
// - directoryURL - the URL of the directory e.g. https://<account>.dfs.core.windows.net/fs/dir
Expand All @@ -46,10 +46,10 @@ func NewClient(directoryURL string, cred azcore.TokenCredential, options *Client
if options == nil {
options = &ClientOptions{}
}
blobClientOpts := blob.ClientOptions{
blobClientOpts := blockblob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobClient, _ := blob.NewClient(blobURL, cred, &blobClientOpts)
blobClient, _ := blockblob.NewClient(blobURL, cred, &blobClientOpts)
dirClient := base.NewPathClient(directoryURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(dirClient), nil
Expand All @@ -74,10 +74,10 @@ func NewClientWithNoCredential(directoryURL string, options *ClientOptions) (*Cl
if options == nil {
options = &ClientOptions{}
}
blobClientOpts := blob.ClientOptions{
blobClientOpts := blockblob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobClient, _ := blob.NewClientWithNoCredential(blobURL, &blobClientOpts)
blobClient, _ := blockblob.NewClientWithNoCredential(blobURL, &blobClientOpts)
dirClient := base.NewPathClient(directoryURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(dirClient), nil
Expand Down Expand Up @@ -105,14 +105,14 @@ func NewClientWithSharedKeyCredential(directoryURL string, cred *SharedKeyCreden
if options == nil {
options = &ClientOptions{}
}
blobClientOpts := blob.ClientOptions{
blobClientOpts := blockblob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobSharedKey, err := cred.ConvertToBlobSharedKey()
if err != nil {
return nil, err
}
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
blobClient, _ := blockblob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
dirClient := base.NewPathClient(directoryURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(dirClient), nil
Expand Down Expand Up @@ -140,22 +140,22 @@ func NewClientFromConnectionString(connectionString string, options *ClientOptio

func (d *Client) generatedDirClientWithDFS() *generated.PathClient {
//base.SharedKeyComposite((*base.CompositeClient[generated.BlobClient, generated.BlockBlobClient])(bb))
dirClientWithDFS, _, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(d))
dirClientWithDFS, _, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
return dirClientWithDFS
}

func (d *Client) generatedDirClientWithBlob() *generated.PathClient {
_, dirClientWithBlob, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(d))
_, dirClientWithBlob, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
return dirClientWithBlob
}

func (d *Client) blobClient() *blob.Client {
_, _, blobClient := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(d))
func (d *Client) blobClient() *blockblob.Client {
_, _, blobClient := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
return blobClient
}

func (d *Client) sharedKey() *exported.SharedKeyCredential {
return base.SharedKeyComposite((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(d))
return base.SharedKeyComposite((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
}

// DFSURL returns the URL endpoint used by the Client object.
Expand Down
167 changes: 93 additions & 74 deletions sdk/storage/azdatalake/file/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/base"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
Expand All @@ -22,7 +22,7 @@ import (
type ClientOptions base.ClientOptions

// Client represents a URL to the Azure Datalake Storage service.
type Client base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client]
type Client base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client]

// NewClient creates an instance of Client with the specified values.
// - fileURL - the URL of the blob e.g. https://<account>.dfs.core.windows.net/fs/file.txt
Expand All @@ -45,10 +45,10 @@ func NewClient(fileURL string, cred azcore.TokenCredential, options *ClientOptio
if options == nil {
options = &ClientOptions{}
}
blobClientOpts := blob.ClientOptions{
blobClientOpts := blockblob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobClient, _ := blob.NewClient(blobURL, cred, &blobClientOpts)
blobClient, _ := blockblob.NewClient(blobURL, cred, &blobClientOpts)
fileClient := base.NewPathClient(fileURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(fileClient), nil
Expand All @@ -73,10 +73,10 @@ func NewClientWithNoCredential(fileURL string, options *ClientOptions) (*Client,
if options == nil {
options = &ClientOptions{}
}
blobClientOpts := blob.ClientOptions{
blobClientOpts := blockblob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobClient, _ := blob.NewClientWithNoCredential(blobURL, &blobClientOpts)
blobClient, _ := blockblob.NewClientWithNoCredential(blobURL, &blobClientOpts)
fileClient := base.NewPathClient(fileURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(fileClient), nil
Expand Down Expand Up @@ -104,14 +104,14 @@ func NewClientWithSharedKeyCredential(fileURL string, cred *SharedKeyCredential,
if options == nil {
options = &ClientOptions{}
}
blobClientOpts := blob.ClientOptions{
blobClientOpts := blockblob.ClientOptions{
ClientOptions: options.ClientOptions,
}
blobSharedKey, err := cred.ConvertToBlobSharedKey()
if err != nil {
return nil, err
}
blobClient, _ := blob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
blobClient, _ := blockblob.NewClientWithSharedKeyCredential(blobURL, blobSharedKey, &blobClientOpts)
fileClient := base.NewPathClient(fileURL, blobURL, blobClient, azClient, nil, (*base.ClientOptions)(conOptions))

return (*Client)(fileClient), nil
Expand Down Expand Up @@ -139,22 +139,26 @@ func NewClientFromConnectionString(connectionString string, options *ClientOptio

func (f *Client) generatedFileClientWithDFS() *generated.PathClient {
//base.SharedKeyComposite((*base.CompositeClient[generated.BlobClient, generated.BlockBlobClient])(bb))
dirClientWithDFS, _, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(f))
dirClientWithDFS, _, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(f))
return dirClientWithDFS
}

func (f *Client) generatedFileClientWithBlob() *generated.PathClient {
_, dirClientWithBlob, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(f))
_, dirClientWithBlob, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(f))
return dirClientWithBlob
}

func (f *Client) blobClient() *blob.Client {
_, _, blobClient := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(f))
func (f *Client) blobClient() *blockblob.Client {
_, _, blobClient := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(f))
return blobClient
}

func (f *Client) sharedKey() *exported.SharedKeyCredential {
return base.SharedKeyComposite((*base.CompositeClient[generated.PathClient, generated.PathClient, blob.Client])(f))
return base.SharedKeyComposite((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(f))
}

func (f *Client) getClientOptions() *base.ClientOptions {
return base.GetCompositeClientOptions((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(f))
}

// DFSURL returns the URL endpoint used by the Client object.
Expand All @@ -169,96 +173,111 @@ func (f *Client) BlobURL() string {

// Create creates a new file (dfs1).
func (f *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error) {
// TODO: format for options should be able to handle the access conditions parameter correctly
return CreateResponse{}, nil
lac, mac, httpHeaders, createOpts, cpkOpts := options.format()
return f.generatedFileClientWithDFS().Create(ctx, createOpts, httpHeaders, lac, mac, nil, cpkOpts)
}

// Delete deletes a file (dfs1).
func (f *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error) {
// TODO: recursive set to false when calling generated code
return DeleteResponse{}, nil
lac, mac, deleteOpts := options.format()
return f.generatedFileClientWithDFS().Delete(ctx, deleteOpts, lac, mac)
}

// GetProperties gets the properties of a file (blob3)
func (f *Client) GetProperties(ctx context.Context, options *GetPropertiesOptions) (GetPropertiesResponse, error) {
// TODO: format blob response to path response
return GetPropertiesResponse{}, nil
}

// Rename renames a file (dfs1).
func (f *Client) Rename(ctx context.Context, newName string, options *RenameOptions) (RenameResponse, error) {
return RenameResponse{}, nil
opts := options.format()
// TODO: format response + add acls, owner, group, permissions to it
return f.blobClient().GetProperties(ctx, opts)
}

// SetExpiry operation sets an expiry time on an existing file.
func (f *Client) SetExpiry(ctx context.Context, expiryType ExpiryType, o *SetExpiryOptions) (SetExpiryResponse, error) {
// TODO: consider using the blob client set expiry
// TODO: call methods in set_expiry.go
return SetExpiryResponse{}, nil
// TODO: implement below
//// Rename renames a file (dfs1). TODO: look into returning a new client possibly or changing the url
//func (f *Client) Rename(ctx context.Context, newName string, options *RenameOptions) (RenameResponse, error) {
// path, err := url.Parse(f.DFSURL())
// if err != nil {
// return RenameResponse{}, err
// }
// lac, mac, smac, createOpts := options.format(path.Path)
// fileURL := runtime.JoinPaths(f.generatedFileClientWithDFS().Endpoint(), newName)
// // TODO: remove new azcore.Client creation after the API for shallow copying with new client name is implemented
// clOpts := f.getClientOptions()
// azClient, err := azcore.NewClient(shared.FileClient, exported.ModuleVersion, *(base.GetPipelineOptions(clOpts)), &(clOpts.ClientOptions))
// if err != nil {
// if log.Should(exported.EventError) {
// log.Writef(exported.EventError, err.Error())
// }
// return RenameResponse{}, err
// }
// blobURL, fileURL := shared.GetURLs(fileURL)
// tempFileClient := (*Client)(base.NewPathClient(fileURL, blobURL, nil, azClient, f.sharedKey(), clOpts))
// // this tempClient does not have a blobClient
// return tempFileClient.generatedFileClientWithDFS().Create(ctx, createOpts, nil, lac, mac, smac, nil)
//}

// SetExpiry operation sets an expiry time on an existing file (blob2).
func (f *Client) SetExpiry(ctx context.Context, expiryType SetExpiryType, o *SetExpiryOptions) (SetExpiryResponse, error) {
expMode, opts := expiryType.Format(o)
return f.generatedFileClientWithBlob().SetExpiry(ctx, expMode, opts)
}

// Upload uploads data to a file.
func (f *Client) Upload(ctx context.Context) {

}

// Append appends data to a file.
func (f *Client) Append(ctx context.Context) {

}

// Flush flushes previous uploaded data to a file.
func (f *Client) Flush(ctx context.Context) {

}

// Download downloads data from a file.
func (f *Client) Download(ctx context.Context) {

}
//// Upload uploads data to a file.
//func (f *Client) Upload(ctx context.Context) {
//
//}
//
//// Append appends data to a file.
//func (f *Client) Append(ctx context.Context) {
//
//}
//
//// Flush flushes previous uploaded data to a file.
//func (f *Client) Flush(ctx context.Context) {
//
//}
//
//// Download downloads data from a file.
//func (f *Client) Download(ctx context.Context) {
//
//}

// SetAccessControl sets the owner, owning group, and permissions for a file or directory (dfs1).
func (f *Client) SetAccessControl(ctx context.Context, options *SetAccessControlOptions) (SetAccessControlResponse, error) {
return SetAccessControlResponse{}, nil
}

// SetAccessControlRecursive sets the owner, owning group, and permissions for a file or directory (dfs1).
func (f *Client) SetAccessControlRecursive(ctx context.Context, options *SetAccessControlRecursiveOptions) (SetAccessControlRecursiveResponse, error) {
// TODO explicitly pass SetAccessControlRecursiveMode
return SetAccessControlRecursiveResponse{}, nil
opts, lac, mac, err := options.format()
if err != nil {
return SetAccessControlResponse{}, err
}
return f.generatedFileClientWithDFS().SetAccessControl(ctx, opts, lac, mac)
}

// UpdateAccessControlRecursive updates the owner, owning group, and permissions for a file or directory (dfs1).
func (f *Client) UpdateAccessControlRecursive(ctx context.Context, options *UpdateAccessControlRecursiveOptions) (UpdateAccessControlRecursiveResponse, error) {
// TODO explicitly pass SetAccessControlRecursiveMode
return SetAccessControlRecursiveResponse{}, nil
// UpdateAccessControl updates the owner, owning group, and permissions for a file or directory (dfs1).
func (f *Client) UpdateAccessControl(ctx context.Context, ACL string, options *UpdateAccessControlOptions) (UpdateAccessControlResponse, error) {
opts, mode := options.format(ACL)
return f.generatedFileClientWithDFS().SetAccessControlRecursive(ctx, mode, opts)
}

// GetAccessControl gets the owner, owning group, and permissions for a file or directory (dfs1).
func (f *Client) GetAccessControl(ctx context.Context, options *GetAccessControlOptions) (GetAccessControlResponse, error) {
return GetAccessControlResponse{}, nil
opts, lac, mac := options.format()
return f.generatedFileClientWithDFS().GetProperties(ctx, opts, lac, mac)
}

// RemoveAccessControlRecursive removes the owner, owning group, and permissions for a file or directory (dfs1).
func (f *Client) RemoveAccessControlRecursive(ctx context.Context, options *RemoveAccessControlRecursiveOptions) (RemoveAccessControlRecursiveResponse, error) {
// TODO explicitly pass SetAccessControlRecursiveMode
return SetAccessControlRecursiveResponse{}, nil
// RemoveAccessControl removes the owner, owning group, and permissions for a file or directory (dfs1).
func (f *Client) RemoveAccessControl(ctx context.Context, ACL string, options *RemoveAccessControlOptions) (RemoveAccessControlResponse, error) {
opts, mode := options.format(ACL)
return f.generatedFileClientWithDFS().SetAccessControlRecursive(ctx, mode, opts)
}

// SetMetadata sets the metadata for a file or directory (blob3).
func (f *Client) SetMetadata(ctx context.Context, options *SetMetadataOptions) (SetMetadataResponse, error) {
// TODO: call directly into blob
return SetMetadataResponse{}, nil
opts, metadata := options.format()
return f.blobClient().SetMetadata(ctx, metadata, opts)
}

// SetHTTPHeaders sets the HTTP headers for a file or directory (blob3).
func (f *Client) SetHTTPHeaders(ctx context.Context, httpHeaders HTTPHeaders, options *SetHTTPHeadersOptions) (SetHTTPHeadersResponse, error) {
// TODO: call formatBlobHTTPHeaders() since we want to add the blob prefix to our options before calling into blob
// TODO: call into blob
return SetHTTPHeadersResponse{}, nil
}

// UndeletePath restores the specified path that was previously deleted. (dfs op/blob2).
func (f *Client) UndeletePath(ctx context.Context, path string, options *UndeletePathOptions) (UndeletePathResponse, error) {
return UndeletePathResponse{}, nil
opts, blobHTTPHeaders := options.format(httpHeaders)
resp, err := f.blobClient().SetHTTPHeaders(ctx, blobHTTPHeaders, opts)
newResp := SetHTTPHeadersResponse{}
formatSetHTTPHeadersResponse(&newResp, &resp)
return newResp, err
}
Loading