From 3c531a823bfa696889647c6c4bc79ee6934e0381 Mon Sep 17 00:00:00 2001 From: tanyasethi-msft <124860586+tanyasethi-msft@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:02:55 +0530 Subject: [PATCH] STG 82 swagger update, azcore, azidentity dependancy updates (#22000) * corrected release date in changelog * STG84 swagger and azcore, azidentity, azblob dependency updates * dependancy updates * indirect dependancy * update code generator version * using STG 82 swagger, and revert code gen version * adding transforms for missing header files * re-generate zz_options.go file * reverting to azblob 1.1.0 * reverting to azblob 1.0.0 * Updated input file from main to latest commit id --- sdk/storage/azdatalake/go.mod | 14 +-- sdk/storage/azdatalake/go.sum | 32 ++++--- .../azdatalake/internal/generated/autorest.md | 25 +++++- .../internal/generated/zz_constants.go | 19 ++++ .../generated/zz_filesystem_client.go | 24 +++--- .../internal/generated/zz_models.go | 33 ++++++- .../internal/generated/zz_models_serde.go | 4 + .../internal/generated/zz_path_client.go | 86 +++++++++++++------ .../internal/generated/zz_response_types.go | 6 ++ .../internal/generated/zz_service_client.go | 4 +- 10 files changed, 180 insertions(+), 67 deletions(-) diff --git a/sdk/storage/azdatalake/go.mod b/sdk/storage/azdatalake/go.mod index 32183804dae3..41b6baad6629 100644 --- a/sdk/storage/azdatalake/go.mod +++ b/sdk/storage/azdatalake/go.mod @@ -3,21 +3,21 @@ module github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 - github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 github.com/stretchr/testify v1.8.4 ) require ( - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.2.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect + github.com/golang-jwt/jwt/v5 v5.0.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/net v0.17.0 // indirect diff --git a/sdk/storage/azdatalake/go.sum b/sdk/storage/azdatalake/go.sum index 6712a77cdedc..007620a163cc 100644 --- a/sdk/storage/azdatalake/go.sum +++ b/sdk/storage/azdatalake/go.sum @@ -1,28 +1,26 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 h1:8q4SaHjFsClSvuVne0ID/5Ka8u3fcIHyqkLjcFpNRHQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 h1:TuEMD+E+1aTjjLICGQOW6vLe8UWES7kopac9mUXL56Y= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 h1:u/LLAOFgsMv7HmNL4Qufg58y+qElGOt5qv0z1mURkRY= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0/go.mod h1:2e8rMJtl2+2j+HXbTBwnyGpm5Nou7KhvSfxOq8JpTag= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -31,7 +29,7 @@ golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= diff --git a/sdk/storage/azdatalake/internal/generated/autorest.md b/sdk/storage/azdatalake/internal/generated/autorest.md index edc674717865..d0fcbb9a408a 100644 --- a/sdk/storage/azdatalake/internal/generated/autorest.md +++ b/sdk/storage/azdatalake/internal/generated/autorest.md @@ -7,7 +7,7 @@ go: true clear-output-folder: false version: "^3.0.0" license-header: MICROSOFT_MIT_NO_VERSION -input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Azure.Storage.Files.DataLake/preview/2020-10-02/DataLakeStorage.json" +input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/3f3b51edf8fd0eb65004df390d6ee98e0e23c53d/specification/storage/data-plane/Azure.Storage.Files.DataLake/preview/2021-06-08/DataLakeStorage.json" credential-scope: "https://storage.azure.com/.default" output-folder: ../generated file-prefix: "zz_" @@ -109,6 +109,27 @@ directive: ]; ``` +### Add Missing Imports to zz_service_client.go + +``` yaml +directive: +- from: zz_service_client.go + where: $ + transform: >- + return $. + replace(/"strconv"/, `"strconv"\n\t"strings"`); +``` +### Add Missing Imports to zz_models_serde.go + +``` yaml +directive: +- from: zz_models_serde.go + where: $ + transform: >- + return $. + replace(/"reflect"/, `"reflect"\n\t"strconv"`); +``` + ### Clean up some const type names so they don't stutter ``` yaml @@ -276,4 +297,4 @@ directive: return $. replace(/err = unpopulate\((.*), "ContentLength", &p\.ContentLength\)/g, 'var rawVal string\nerr = unpopulate(val, "ContentLength", &rawVal)\nintVal, _ := strconv.ParseInt(rawVal, 10, 64)\np.ContentLength = &intVal'). replace(/err = unpopulate\((.*), "IsDirectory", &p\.IsDirectory\)/g, 'var rawVal string\nerr = unpopulate(val, "IsDirectory", &rawVal)\nboolVal, _ := strconv.ParseBool(rawVal)\np.IsDirectory = &boolVal'); -``` \ No newline at end of file +``` diff --git a/sdk/storage/azdatalake/internal/generated/zz_constants.go b/sdk/storage/azdatalake/internal/generated/zz_constants.go index bfb6f9ceee76..73ba6132d722 100644 --- a/sdk/storage/azdatalake/internal/generated/zz_constants.go +++ b/sdk/storage/azdatalake/internal/generated/zz_constants.go @@ -43,6 +43,25 @@ func PossibleExpiryOptionsValues() []ExpiryOptions { } } +type LeaseAction string + +const ( + LeaseActionAcquire LeaseAction = "acquire" + LeaseActionAcquireRelease LeaseAction = "acquire-release" + LeaseActionAutoRenew LeaseAction = "auto-renew" + LeaseActionRelease LeaseAction = "release" +) + +// PossibleLeaseActionValues returns the possible values for the LeaseAction const type. +func PossibleLeaseActionValues() []LeaseAction { + return []LeaseAction{ + LeaseActionAcquire, + LeaseActionAcquireRelease, + LeaseActionAutoRenew, + LeaseActionRelease, + } +} + type ListBlobsIncludeItem string const ( diff --git a/sdk/storage/azdatalake/internal/generated/zz_filesystem_client.go b/sdk/storage/azdatalake/internal/generated/zz_filesystem_client.go index 377a623ea155..115de5aeaa9d 100644 --- a/sdk/storage/azdatalake/internal/generated/zz_filesystem_client.go +++ b/sdk/storage/azdatalake/internal/generated/zz_filesystem_client.go @@ -32,7 +32,7 @@ type FileSystemClient struct { // operation does not support conditional HTTP requests. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - FileSystemClientCreateOptions contains the optional parameters for the FileSystemClient.Create method. func (client *FileSystemClient) Create(ctx context.Context, options *FileSystemClientCreateOptions) (FileSystemClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, options) @@ -64,7 +64,7 @@ func (client *FileSystemClient) createCreateRequest(ctx context.Context, options if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if options != nil && options.Properties != nil { req.Raw().Header["x-ms-properties"] = []string{*options.Properties} } @@ -114,7 +114,7 @@ func (client *FileSystemClient) createHandleResponse(resp *http.Response) (FileS // [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - FileSystemClientDeleteOptions contains the optional parameters for the FileSystemClient.Delete method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the FileSystemClient.SetProperties // method. @@ -148,7 +148,7 @@ func (client *FileSystemClient) deleteCreateRequest(ctx context.Context, options if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} } @@ -181,7 +181,7 @@ func (client *FileSystemClient) deleteHandleResponse(resp *http.Response) (FileS // GetProperties - All system and user-defined filesystem properties are specified in the response headers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - FileSystemClientGetPropertiesOptions contains the optional parameters for the FileSystemClient.GetProperties // method. func (client *FileSystemClient) GetProperties(ctx context.Context, options *FileSystemClientGetPropertiesOptions) (FileSystemClientGetPropertiesResponse, error) { @@ -214,7 +214,7 @@ func (client *FileSystemClient) getPropertiesCreateRequest(ctx context.Context, if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -256,7 +256,7 @@ func (client *FileSystemClient) getPropertiesHandleResponse(resp *http.Response) // NewListBlobHierarchySegmentPager - The List Blobs operation returns a list of the blobs under the specified container // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - FileSystemClientListBlobHierarchySegmentOptions contains the optional parameters for the FileSystemClient.NewListBlobHierarchySegmentPager // method. // @@ -291,7 +291,7 @@ func (client *FileSystemClient) ListBlobHierarchySegmentCreateRequest(ctx contex reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -329,7 +329,7 @@ func (client *FileSystemClient) ListBlobHierarchySegmentHandleResponse(resp *htt // NewListPathsPager - List FileSystem paths and their properties. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - recursive - Required // - options - FileSystemClientListPathsOptions contains the optional parameters for the FileSystemClient.NewListPathsPager // method. @@ -362,7 +362,7 @@ func (client *FileSystemClient) ListPathsCreateRequest(ctx context.Context, recu if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -407,7 +407,7 @@ func (client *FileSystemClient) ListPathsHandleResponse(resp *http.Response) (Fi // [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - FileSystemClientSetPropertiesOptions contains the optional parameters for the FileSystemClient.SetProperties // method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the FileSystemClient.SetProperties @@ -442,7 +442,7 @@ func (client *FileSystemClient) setPropertiesCreateRequest(ctx context.Context, if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if options != nil && options.Properties != nil { req.Raw().Header["x-ms-properties"] = []string{*options.Properties} } diff --git a/sdk/storage/azdatalake/internal/generated/zz_models.go b/sdk/storage/azdatalake/internal/generated/zz_models.go index 6201c56fa6d4..1e24dca4257d 100644 --- a/sdk/storage/azdatalake/internal/generated/zz_models.go +++ b/sdk/storage/azdatalake/internal/generated/zz_models.go @@ -260,9 +260,10 @@ type ModifiedAccessConditions struct { } type Path struct { - ContentLength *int64 - CreationTime *string - ETag *string + ContentLength *int64 + CreationTime *string + ETag *string + EncryptionContext *string // The name of the encryption scope under which the blob is encrypted. EncryptionScope *string @@ -280,6 +281,15 @@ type PathClientAppendDataOptions struct { // Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". Must be the length of the request content in bytes // for "Append Data". ContentLength *int64 + // If file should be flushed after the append + Flush *bool + // Optional. If "acquire" it will acquire the lease. If "auto-renew" it will renew the lease. If "release" it will release + // the lease only on flush. If "acquire-release" it will acquire & complete the + // operation & release the lease once operation is done. + LeaseAction *LeaseAction + // The lease duration is required to acquire a lease, and specifies the duration of the lease in seconds. The lease duration + // must be between 15 and 60 seconds or -1 for infinite lease. + LeaseDuration *int64 // This parameter allows the caller to upload data in parallel and control the order in which it is appended to the file. // It is required when uploading data to be appended to the file and when flushing // previously uploaded data to the file. The value must be the position where the data is to be appended. Uploaded data is @@ -288,6 +298,10 @@ type PathClientAppendDataOptions struct { // data has been written, and there must not be a request entity body included // with the request. Position *int64 + // Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is + // not in the correct format. See Guid Constructor (String) for a list of valid GUID + // string formats. + ProposedLeaseID *string // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage // analytics logging is enabled. RequestID *string @@ -309,6 +323,8 @@ type PathClientCreateOptions struct { // this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation // of the delete operation to continue deleting the directory. Continuation *string + // Specifies the encryption context to set on the file. + EncryptionContext *string // The time to set the blob to expiry ExpiresOn *string // Required. Indicates mode of the expiry time @@ -395,6 +411,13 @@ type PathClientFlushDataOptions struct { // Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". Must be the length of the request content in bytes // for "Append Data". ContentLength *int64 + // Optional. If "acquire" it will acquire the lease. If "auto-renew" it will renew the lease. If "release" it will release + // the lease only on flush. If "acquire-release" it will acquire & complete the + // operation & release the lease once operation is done. + LeaseAction *LeaseAction + // The lease duration is required to acquire a lease, and specifies the duration of the lease in seconds. The lease duration + // must be between 15 and 60 seconds or -1 for infinite lease. + LeaseDuration *int64 // This parameter allows the caller to upload data in parallel and control the order in which it is appended to the file. // It is required when uploading data to be appended to the file and when flushing // previously uploaded data to the file. The value must be the position where the data is to be appended. Uploaded data is @@ -403,6 +426,10 @@ type PathClientFlushDataOptions struct { // data has been written, and there must not be a request entity body included // with the request. Position *int64 + // Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is + // not in the correct format. See Guid Constructor (String) for a list of valid GUID + // string formats. + ProposedLeaseID *string // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage // analytics logging is enabled. RequestID *string diff --git a/sdk/storage/azdatalake/internal/generated/zz_models_serde.go b/sdk/storage/azdatalake/internal/generated/zz_models_serde.go index cb66df1e8173..822fc84cb79a 100644 --- a/sdk/storage/azdatalake/internal/generated/zz_models_serde.go +++ b/sdk/storage/azdatalake/internal/generated/zz_models_serde.go @@ -210,6 +210,7 @@ func (p Path) MarshalJSON() ([]byte, error) { populate(objectMap, "contentLength", p.ContentLength) populate(objectMap, "creationTime", p.CreationTime) populate(objectMap, "eTag", p.ETag) + populate(objectMap, "EncryptionContext", p.EncryptionContext) populate(objectMap, "EncryptionScope", p.EncryptionScope) populate(objectMap, "expiryTime", p.ExpiryTime) populate(objectMap, "group", p.Group) @@ -242,6 +243,9 @@ func (p *Path) UnmarshalJSON(data []byte) error { case "eTag": err = unpopulate(val, "ETag", &p.ETag) delete(rawMsg, key) + case "EncryptionContext": + err = unpopulate(val, "EncryptionContext", &p.EncryptionContext) + delete(rawMsg, key) case "EncryptionScope": err = unpopulate(val, "EncryptionScope", &p.EncryptionScope) delete(rawMsg, key) diff --git a/sdk/storage/azdatalake/internal/generated/zz_path_client.go b/sdk/storage/azdatalake/internal/generated/zz_path_client.go index f0547cb91e1a..c110ad790150 100644 --- a/sdk/storage/azdatalake/internal/generated/zz_path_client.go +++ b/sdk/storage/azdatalake/internal/generated/zz_path_client.go @@ -32,7 +32,7 @@ type PathClient struct { // AppendData - Append data to the file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - body - Initial data // - options - PathClientAppendDataOptions contains the optional parameters for the PathClient.AppendData method. // - PathHTTPHeaders - PathHTTPHeaders contains a group of parameters for the PathClient.Create method. @@ -67,6 +67,9 @@ func (client *PathClient) appendDataCreateRequest(ctx context.Context, body io.R if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } + if options != nil && options.Flush != nil { + reqQP.Set("flush", strconv.FormatBool(*options.Flush)) + } req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.ContentLength != nil { req.Raw().Header["Content-Length"] = []string{strconv.FormatInt(*options.ContentLength, 10)} @@ -80,10 +83,19 @@ func (client *PathClient) appendDataCreateRequest(ctx context.Context, body io.R if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } + if options != nil && options.LeaseAction != nil { + req.Raw().Header["x-ms-lease-action"] = []string{string(*options.LeaseAction)} + } + if options != nil && options.LeaseDuration != nil { + req.Raw().Header["x-ms-lease-duration"] = []string{strconv.FormatInt(*options.LeaseDuration, 10)} + } + if options != nil && options.ProposedLeaseID != nil { + req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} + } if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if cpkInfo != nil && cpkInfo.EncryptionKey != nil { req.Raw().Header["x-ms-encryption-key"] = []string{*cpkInfo.EncryptionKey} } @@ -146,6 +158,13 @@ func (client *PathClient) appendDataHandleResponse(resp *http.Response) (PathCli if val := resp.Header.Get("x-ms-encryption-key-sha256"); val != "" { result.EncryptionKeySHA256 = &val } + if val := resp.Header.Get("x-ms-lease-renewed"); val != "" { + leaseRenewed, err := strconv.ParseBool(val) + if err != nil { + return PathClientAppendDataResponse{}, err + } + result.LeaseRenewed = &leaseRenewed + } return result, nil } @@ -157,7 +176,7 @@ func (client *PathClient) appendDataHandleResponse(resp *http.Response) (PathCli // If-None-Match: "*". // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - PathClientCreateOptions contains the optional parameters for the PathClient.Create method. // - PathHTTPHeaders - PathHTTPHeaders contains a group of parameters for the PathClient.Create method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the PathClient.Create method. @@ -204,7 +223,7 @@ func (client *PathClient) createCreateRequest(ctx context.Context, options *Path if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if pathHTTPHeaders != nil && pathHTTPHeaders.CacheControl != nil { req.Raw().Header["x-ms-cache-control"] = []string{*pathHTTPHeaders.CacheControl} } @@ -292,6 +311,9 @@ func (client *PathClient) createCreateRequest(ctx context.Context, options *Path if options != nil && options.ExpiresOn != nil { req.Raw().Header["x-ms-expiry-time"] = []string{*options.ExpiresOn} } + if options != nil && options.EncryptionContext != nil { + req.Raw().Header["x-ms-encryption-context"] = []string{*options.EncryptionContext} + } req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -350,7 +372,7 @@ func (client *PathClient) createHandleResponse(resp *http.Response) (PathClientC // [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - PathClientDeleteOptions contains the optional parameters for the PathClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the PathClient.Create method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the FileSystemClient.SetProperties @@ -390,7 +412,7 @@ func (client *PathClient) deleteCreateRequest(ctx context.Context, options *Path if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -438,7 +460,7 @@ func (client *PathClient) deleteHandleResponse(resp *http.Response) (PathClientD // FlushData - Set the owner, group, permissions, or access control list for a path. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - PathClientFlushDataOptions contains the optional parameters for the PathClient.FlushData method. // - PathHTTPHeaders - PathHTTPHeaders contains a group of parameters for the PathClient.Create method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the PathClient.Create method. @@ -490,6 +512,15 @@ func (client *PathClient) flushDataCreateRequest(ctx context.Context, options *P if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } + if options != nil && options.LeaseAction != nil { + req.Raw().Header["x-ms-lease-action"] = []string{string(*options.LeaseAction)} + } + if options != nil && options.LeaseDuration != nil { + req.Raw().Header["x-ms-lease-duration"] = []string{strconv.FormatInt(*options.LeaseDuration, 10)} + } + if options != nil && options.ProposedLeaseID != nil { + req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} + } if pathHTTPHeaders != nil && pathHTTPHeaders.CacheControl != nil { req.Raw().Header["x-ms-cache-control"] = []string{*pathHTTPHeaders.CacheControl} } @@ -520,7 +551,7 @@ func (client *PathClient) flushDataCreateRequest(ctx context.Context, options *P if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if cpkInfo != nil && cpkInfo.EncryptionKey != nil { req.Raw().Header["x-ms-encryption-key"] = []string{*cpkInfo.EncryptionKey} } @@ -580,6 +611,13 @@ func (client *PathClient) flushDataHandleResponse(resp *http.Response) (PathClie if val := resp.Header.Get("x-ms-encryption-key-sha256"); val != "" { result.EncryptionKeySHA256 = &val } + if val := resp.Header.Get("x-ms-lease-renewed"); val != "" { + leaseRenewed, err := strconv.ParseBool(val) + if err != nil { + return PathClientFlushDataResponse{}, err + } + result.LeaseRenewed = &leaseRenewed + } return result, nil } @@ -590,7 +628,7 @@ func (client *PathClient) flushDataHandleResponse(resp *http.Response) (PathClie // [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - PathClientGetPropertiesOptions contains the optional parameters for the PathClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the PathClient.Create method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the FileSystemClient.SetProperties @@ -630,7 +668,7 @@ func (client *PathClient) getPropertiesCreateRequest(ctx context.Context, option if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -742,7 +780,7 @@ func (client *PathClient) getPropertiesHandleResponse(resp *http.Response) (Path // Operations [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - xmsLeaseAction - There are five lease actions: "acquire", "break", "change", "renew", and "release". Use "acquire" and // specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" // to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which time no lease @@ -785,7 +823,7 @@ func (client *PathClient) leaseCreateRequest(ctx context.Context, xmsLeaseAction if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} req.Raw().Header["x-ms-lease-action"] = []string{string(xmsLeaseAction)} req.Raw().Header["x-ms-lease-duration"] = []string{strconv.FormatInt(int64(client.xmsLeaseDuration), 10)} if options != nil && options.XMSLeaseBreakPeriod != nil { @@ -853,7 +891,7 @@ func (client *PathClient) leaseHandleResponse(resp *http.Response) (PathClientLe // Service Operations [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - PathClientReadOptions contains the optional parameters for the PathClient.Read method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the PathClient.Create method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the FileSystemClient.SetProperties @@ -889,7 +927,7 @@ func (client *PathClient) readCreateRequest(ctx context.Context, options *PathCl if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if options != nil && options.Range != nil { req.Raw().Header["Range"] = []string{*options.Range} } @@ -1015,7 +1053,7 @@ func (client *PathClient) readHandleResponse(resp *http.Response) (PathClientRea // SetAccessControl - Set the owner, group, permissions, or access control list for a path. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - PathClientSetAccessControlOptions contains the optional parameters for the PathClient.SetAccessControl method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the PathClient.Create method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the FileSystemClient.SetProperties @@ -1077,7 +1115,7 @@ func (client *PathClient) setAccessControlCreateRequest(ctx context.Context, opt if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1117,7 +1155,7 @@ func (client *PathClient) setAccessControlHandleResponse(resp *http.Response) (P // SetAccessControlRecursive - Set the access control list for a path and sub-paths. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - mode - Mode "set" sets POSIX access control rights on files and directories, "modify" modifies one or more POSIX access // control rights that pre-exist on files and directories, "remove" removes one or more // POSIX access control rights that were present earlier on files and directories @@ -1166,7 +1204,7 @@ func (client *PathClient) SetAccessControlRecursiveCreateRequest(ctx context.Con if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1202,7 +1240,7 @@ func (client *PathClient) SetAccessControlRecursiveHandleResponse(resp *http.Res // SetExpiry - Sets the time a blob will expire and be deleted. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - expiryOptions - Required. Indicates mode of the expiry time // - options - PathClientSetExpiryOptions contains the optional parameters for the PathClient.SetExpiry method. func (client *PathClient) SetExpiry(ctx context.Context, expiryOptions ExpiryOptions, options *PathClientSetExpiryOptions) (PathClientSetExpiryResponse, error) { @@ -1232,7 +1270,7 @@ func (client *PathClient) setExpiryCreateRequest(ctx context.Context, expiryOpti reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -1279,7 +1317,7 @@ func (client *PathClient) setExpiryHandleResponse(resp *http.Response) (PathClie // Undelete - Undelete a path that was previously soft deleted // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - PathClientUndeleteOptions contains the optional parameters for the PathClient.Undelete method. func (client *PathClient) Undelete(ctx context.Context, options *PathClientUndeleteOptions) (PathClientUndeleteResponse, error) { req, err := client.undeleteCreateRequest(ctx, options) @@ -1311,7 +1349,7 @@ func (client *PathClient) undeleteCreateRequest(ctx context.Context, options *Pa if options != nil && options.UndeleteSource != nil { req.Raw().Header["x-ms-undelete-source"] = []string{*options.UndeleteSource} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -1351,7 +1389,7 @@ func (client *PathClient) undeleteHandleResponse(resp *http.Response) (PathClien // Headers for Blob Service Operations [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - action - The action must be "append" to upload data to be appended to a file, "flush" to flush previously uploaded data // to a file, "setProperties" to set the properties of a file or directory, // "setAccessControl" to set the owner, group, permissions, or access control list for a file or directory, or "setAccessControlRecursive" @@ -1417,7 +1455,7 @@ func (client *PathClient) updateCreateRequest(ctx context.Context, action PathUp if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} if options != nil && options.ContentLength != nil { req.Raw().Header["Content-Length"] = []string{strconv.FormatInt(*options.ContentLength, 10)} } diff --git a/sdk/storage/azdatalake/internal/generated/zz_response_types.go b/sdk/storage/azdatalake/internal/generated/zz_response_types.go index 58112b532f0c..fdf0d25fdc74 100644 --- a/sdk/storage/azdatalake/internal/generated/zz_response_types.go +++ b/sdk/storage/azdatalake/internal/generated/zz_response_types.go @@ -154,6 +154,9 @@ type PathClientAppendDataResponse struct { // IsServerEncrypted contains the information returned from the x-ms-request-server-encrypted header response. IsServerEncrypted *bool + // LeaseRenewed contains the information returned from the x-ms-lease-renewed header response. + LeaseRenewed *bool + // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string @@ -232,6 +235,9 @@ type PathClientFlushDataResponse struct { // LastModified contains the information returned from the Last-Modified header response. LastModified *time.Time + // LeaseRenewed contains the information returned from the x-ms-lease-renewed header response. + LeaseRenewed *bool + // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string diff --git a/sdk/storage/azdatalake/internal/generated/zz_service_client.go b/sdk/storage/azdatalake/internal/generated/zz_service_client.go index 4c6e81408b18..a441fa581105 100644 --- a/sdk/storage/azdatalake/internal/generated/zz_service_client.go +++ b/sdk/storage/azdatalake/internal/generated/zz_service_client.go @@ -29,7 +29,7 @@ type ServiceClient struct { // NewListFileSystemsPager - List filesystems and their properties in given account. // -// Generated from API version 2020-10-02 +// Generated from API version 2021-06-08 // - options - ServiceClientListFileSystemsOptions contains the optional parameters for the ServiceClient.NewListFileSystemsPager // method. // @@ -57,7 +57,7 @@ func (client *ServiceClient) ListFileSystemsCreateRequest(ctx context.Context, o if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } - req.Raw().Header["x-ms-version"] = []string{"2020-10-02"} + req.Raw().Header["x-ms-version"] = []string{"2021-06-08"} req.Raw().Header["Accept"] = []string{"application/json"} return req, nil }