diff --git a/sdk/storage/azfile/file/client_test.go b/sdk/storage/azfile/file/client_test.go index bab8724fa4ec..74648a877a0f 100644 --- a/sdk/storage/azfile/file/client_test.go +++ b/sdk/storage/azfile/file/client_test.go @@ -20,6 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/file" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/fileerror" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/generated" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/shared" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/internal/testcommon" "github.com/Azure/azure-sdk-for-go/sdk/storage/azfile/lease" @@ -4340,4 +4341,40 @@ func (f *FileUnrecordedTestsSuite) TestFileUploadRangeFromURLNow() { _require.NotEqualValues(*uResp.FileLastWriteTime, *cResp.FileLastWriteTime) } +type serviceVersionTest struct{} + +// newServiceVersionTestPolicy returns a policy that checks the x-ms-version header +func newServiceVersionTestPolicy() policy.Policy { + return &serviceVersionTest{} +} + +func (m serviceVersionTest) Do(req *policy.Request) (*http.Response, error) { + const versionHeader = "x-ms-version" + currentVersion := map[string][]string(req.Raw().Header)[versionHeader] + if currentVersion[0] != generated.ServiceVersion { + return nil, fmt.Errorf(currentVersion[0] + " service version doesn't match expected version: " + generated.ServiceVersion) + } + + return &http.Response{ + Request: req.Raw(), + Status: "Created", + StatusCode: http.StatusCreated, + Header: http.Header{}, + Body: http.NoBody, + }, nil +} + +func TestServiceVersion(t *testing.T) { + client, err := file.NewClientWithNoCredential("https://fake/file/testpath", &file.ClientOptions{ + ClientOptions: policy.ClientOptions{ + PerCallPolicies: []policy.Policy{newServiceVersionTestPolicy()}, + }, + }) + require.NoError(t, err) + require.NotNil(t, client) + + _, err = client.Create(context.Background(), 1024, nil) + require.NoError(t, err) +} + // TODO: Add tests for retry header options diff --git a/sdk/storage/azfile/internal/generated/autorest.md b/sdk/storage/azfile/internal/generated/autorest.md index 921ad0ca976c..9572da0256e2 100644 --- a/sdk/storage/azfile/internal/generated/autorest.md +++ b/sdk/storage/azfile/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/7dcd41cd28d46eb256bac034760a7e2f0a036238/specification/storage/data-plane/Microsoft.FileStorage/preview/2022-11-02/file.json" +input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/4bafbf3ab1532e390ad5757433679e9ebb5cbf38/specification/storage/data-plane/Microsoft.FileStorage/preview/2023-08-03/file.json" credential-scope: "https://storage.azure.com/.default" output-folder: ../generated file-prefix: "zz_" @@ -22,6 +22,22 @@ export-clients: true use: "@autorest/go@4.0.0-preview.49" ``` +### Updating service version to 2023-11-03 + +```yaml +directive: +- from: + - zz_directory_client.go + - zz_file_client.go + - zz_share_client.go + - zz_service_client.go + where: $ + transform: >- + return $. + replaceAll(`[]string{"2023-08-03"}`, `[]string{ServiceVersion}`). + replaceAll(`2023-08-03`, `2023-11-03`); +``` + ### Don't include share name, directory, or file name in path - we have direct URIs ``` yaml diff --git a/sdk/storage/azfile/internal/generated/constants.go b/sdk/storage/azfile/internal/generated/constants.go new file mode 100644 index 000000000000..8f2bbbb7cb81 --- /dev/null +++ b/sdk/storage/azfile/internal/generated/constants.go @@ -0,0 +1,9 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +package generated + +const ServiceVersion = "2023-11-03" diff --git a/sdk/storage/azfile/internal/generated/zz_constants.go b/sdk/storage/azfile/internal/generated/zz_constants.go index 2f356c7c3f63..9df8784a97a1 100644 --- a/sdk/storage/azfile/internal/generated/zz_constants.go +++ b/sdk/storage/azfile/internal/generated/zz_constants.go @@ -9,6 +9,24 @@ package generated +// AccessRight - Access rights of the access policy. +type AccessRight string + +const ( + AccessRightDelete AccessRight = "Delete" + AccessRightRead AccessRight = "Read" + AccessRightWrite AccessRight = "Write" +) + +// PossibleAccessRightValues returns the possible values for the AccessRight const type. +func PossibleAccessRightValues() []AccessRight { + return []AccessRight{ + AccessRightDelete, + AccessRightRead, + AccessRightWrite, + } +} + type CopyStatusType string const ( diff --git a/sdk/storage/azfile/internal/generated/zz_directory_client.go b/sdk/storage/azfile/internal/generated/zz_directory_client.go index 4e05f2f7d860..5a13781a835b 100644 --- a/sdk/storage/azfile/internal/generated/zz_directory_client.go +++ b/sdk/storage/azfile/internal/generated/zz_directory_client.go @@ -35,7 +35,7 @@ type DirectoryClient struct { // Create - Creates a new directory under the specified share or parent directory. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - DirectoryClientCreateOptions contains the optional parameters for the DirectoryClient.Create method. func (client *DirectoryClient) Create(ctx context.Context, options *DirectoryClientCreateOptions) (DirectoryClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, options) @@ -74,7 +74,7 @@ func (client *DirectoryClient) createCreateRequest(ctx context.Context, options } } } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.FilePermission != nil { req.Raw().Header["x-ms-file-permission"] = []string{*options.FilePermission} } @@ -172,7 +172,7 @@ func (client *DirectoryClient) createHandleResponse(resp *http.Response) (Direct // Delete - Removes the specified empty directory. Note that the directory must be empty before it can be deleted. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - DirectoryClientDeleteOptions contains the optional parameters for the DirectoryClient.Delete method. func (client *DirectoryClient) Delete(ctx context.Context, options *DirectoryClientDeleteOptions) (DirectoryClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, options) @@ -204,7 +204,7 @@ func (client *DirectoryClient) deleteCreateRequest(ctx context.Context, options if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.fileRequestIntent != nil { req.Raw().Header["x-ms-file-request-intent"] = []string{string(*client.fileRequestIntent)} } @@ -234,7 +234,7 @@ func (client *DirectoryClient) deleteHandleResponse(resp *http.Response) (Direct // ForceCloseHandles - Closes all handles open for given directory. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - handleID - Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard that specifies // all handles. // - options - DirectoryClientForceCloseHandlesOptions contains the optional parameters for the DirectoryClient.ForceCloseHandles @@ -276,7 +276,7 @@ func (client *DirectoryClient) forceCloseHandlesCreateRequest(ctx context.Contex if options != nil && options.Recursive != nil { req.Raw().Header["x-ms-recursive"] = []string{strconv.FormatBool(*options.Recursive)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } @@ -330,7 +330,7 @@ func (client *DirectoryClient) forceCloseHandlesHandleResponse(resp *http.Respon // subdirectories. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - DirectoryClientGetPropertiesOptions contains the optional parameters for the DirectoryClient.GetProperties method. func (client *DirectoryClient) GetProperties(ctx context.Context, options *DirectoryClientGetPropertiesOptions) (DirectoryClientGetPropertiesResponse, error) { req, err := client.getPropertiesCreateRequest(ctx, options) @@ -365,7 +365,7 @@ func (client *DirectoryClient) getPropertiesCreateRequest(ctx context.Context, o if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.fileRequestIntent != nil { req.Raw().Header["x-ms-file-request-intent"] = []string{string(*client.fileRequestIntent)} } @@ -453,7 +453,7 @@ func (client *DirectoryClient) getPropertiesHandleResponse(resp *http.Response) // NewListFilesAndDirectoriesSegmentPager - Returns a list of files or directories under the specified share or directory. // It lists the contents only for a single level of the directory hierarchy. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - DirectoryClientListFilesAndDirectoriesSegmentOptions contains the optional parameters for the DirectoryClient.NewListFilesAndDirectoriesSegmentPager // method. // @@ -485,7 +485,7 @@ func (client *DirectoryClient) ListFilesAndDirectoriesSegmentCreateRequest(ctx c reqQP.Set("include", strings.Join(strings.Fields(strings.Trim(fmt.Sprint(options.Include), "[]")), ",")) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.IncludeExtendedInfo != nil { req.Raw().Header["x-ms-file-extended-info"] = []string{strconv.FormatBool(*options.IncludeExtendedInfo)} } @@ -527,7 +527,7 @@ func (client *DirectoryClient) ListFilesAndDirectoriesSegmentHandleResponse(resp // ListHandles - Lists handles for directory. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - DirectoryClientListHandlesOptions contains the optional parameters for the DirectoryClient.ListHandles method. func (client *DirectoryClient) ListHandles(ctx context.Context, options *DirectoryClientListHandlesOptions) (DirectoryClientListHandlesResponse, error) { req, err := client.listHandlesCreateRequest(ctx, options) @@ -568,7 +568,7 @@ func (client *DirectoryClient) listHandlesCreateRequest(ctx context.Context, opt if options != nil && options.Recursive != nil { req.Raw().Header["x-ms-recursive"] = []string{strconv.FormatBool(*options.Recursive)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } @@ -607,7 +607,7 @@ func (client *DirectoryClient) listHandlesHandleResponse(resp *http.Response) (D // Rename - Renames a directory // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - renameSource - Required. Specifies the URI-style path of the source file, up to 2 KB in length. // - options - DirectoryClientRenameOptions contains the optional parameters for the DirectoryClient.Rename method. // - SourceLeaseAccessConditions - SourceLeaseAccessConditions contains a group of parameters for the DirectoryClient.Rename @@ -643,7 +643,7 @@ func (client *DirectoryClient) renameCreateRequest(ctx context.Context, renameSo reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} req.Raw().Header["x-ms-file-rename-source"] = []string{renameSource} if options != nil && options.ReplaceIfExists != nil { req.Raw().Header["x-ms-file-rename-replace-if-exists"] = []string{strconv.FormatBool(*options.ReplaceIfExists)} @@ -767,7 +767,7 @@ func (client *DirectoryClient) renameHandleResponse(resp *http.Response) (Direct // SetMetadata - Updates user defined metadata for the specified directory. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - DirectoryClientSetMetadataOptions contains the optional parameters for the DirectoryClient.SetMetadata method. func (client *DirectoryClient) SetMetadata(ctx context.Context, options *DirectoryClientSetMetadataOptions) (DirectoryClientSetMetadataResponse, error) { req, err := client.setMetadataCreateRequest(ctx, options) @@ -804,7 +804,7 @@ func (client *DirectoryClient) setMetadataCreateRequest(ctx context.Context, opt } } } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } @@ -847,7 +847,7 @@ func (client *DirectoryClient) setMetadataHandleResponse(resp *http.Response) (D // SetProperties - Sets properties on the directory. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - DirectoryClientSetPropertiesOptions contains the optional parameters for the DirectoryClient.SetProperties method. func (client *DirectoryClient) SetProperties(ctx context.Context, options *DirectoryClientSetPropertiesOptions) (DirectoryClientSetPropertiesResponse, error) { req, err := client.setPropertiesCreateRequest(ctx, options) @@ -877,7 +877,7 @@ func (client *DirectoryClient) setPropertiesCreateRequest(ctx context.Context, o reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.FilePermission != nil { req.Raw().Header["x-ms-file-permission"] = []string{*options.FilePermission} } diff --git a/sdk/storage/azfile/internal/generated/zz_file_client.go b/sdk/storage/azfile/internal/generated/zz_file_client.go index fda41c5f79a3..be104c8e1aa0 100644 --- a/sdk/storage/azfile/internal/generated/zz_file_client.go +++ b/sdk/storage/azfile/internal/generated/zz_file_client.go @@ -36,7 +36,7 @@ type FileClient struct { // AbortCopy - Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - copyID - The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. // - options - FileClientAbortCopyOptions contains the optional parameters for the FileClient.AbortCopy method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. @@ -69,7 +69,7 @@ func (client *FileClient) abortCopyCreateRequest(ctx context.Context, copyID str } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["x-ms-copy-action"] = []string{"abort"} - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -105,7 +105,7 @@ func (client *FileClient) abortCopyHandleResponse(resp *http.Response) (FileClie // AcquireLease - [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -142,7 +142,7 @@ func (client *FileClient) acquireLeaseCreateRequest(ctx context.Context, duratio if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -194,7 +194,7 @@ func (client *FileClient) acquireLeaseHandleResponse(resp *http.Response) (FileC // BreakLease - [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientBreakLeaseOptions contains the optional parameters for the FileClient.BreakLease method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *FileClient) BreakLease(ctx context.Context, options *FileClientBreakLeaseOptions, leaseAccessConditions *LeaseAccessConditions) (FileClientBreakLeaseResponse, error) { @@ -228,7 +228,7 @@ func (client *FileClient) breakLeaseCreateRequest(ctx context.Context, options * if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -280,7 +280,7 @@ func (client *FileClient) breakLeaseHandleResponse(resp *http.Response) (FileCli // ChangeLease - [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - leaseID - Specifies the current lease ID on the resource. // - options - FileClientChangeLeaseOptions contains the optional parameters for the FileClient.ChangeLease method. func (client *FileClient) ChangeLease(ctx context.Context, leaseID string, options *FileClientChangeLeaseOptions) (FileClientChangeLeaseResponse, error) { @@ -315,7 +315,7 @@ func (client *FileClient) changeLeaseCreateRequest(ctx context.Context, leaseID if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -367,7 +367,7 @@ func (client *FileClient) changeLeaseHandleResponse(resp *http.Response) (FileCl // Create - Creates a new file or replaces a file. Note it only initializes the file with no content. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - fileContentLength - Specifies the maximum size for the file, up to 4 TB. // - options - FileClientCreateOptions contains the optional parameters for the FileClient.Create method. // - ShareFileHTTPHeaders - ShareFileHTTPHeaders contains a group of parameters for the FileClient.Create method. @@ -401,7 +401,7 @@ func (client *FileClient) createCreateRequest(ctx context.Context, fileContentLe if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} req.Raw().Header["x-ms-content-length"] = []string{strconv.FormatInt(fileContentLength, 10)} req.Raw().Header["x-ms-type"] = []string{"file"} if shareFileHTTPHeaders != nil && shareFileHTTPHeaders.ContentType != nil { @@ -529,7 +529,7 @@ func (client *FileClient) createHandleResponse(resp *http.Response) (FileClientC // Delete - removes the file from the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientDeleteOptions contains the optional parameters for the FileClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *FileClient) Delete(ctx context.Context, options *FileClientDeleteOptions, leaseAccessConditions *LeaseAccessConditions) (FileClientDeleteResponse, error) { @@ -561,7 +561,7 @@ func (client *FileClient) deleteCreateRequest(ctx context.Context, options *File if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -594,7 +594,7 @@ func (client *FileClient) deleteHandleResponse(resp *http.Response) (FileClientD // Download - Reads or downloads a file from the system, including its metadata and properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientDownloadOptions contains the optional parameters for the FileClient.Download method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *FileClient) Download(ctx context.Context, options *FileClientDownloadOptions, leaseAccessConditions *LeaseAccessConditions) (FileClientDownloadResponse, error) { @@ -627,7 +627,7 @@ func (client *FileClient) downloadCreateRequest(ctx context.Context, options *Fi if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } @@ -797,7 +797,7 @@ func (client *FileClient) downloadHandleResponse(resp *http.Response) (FileClien // ForceCloseHandles - Closes all handles open for given file // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - handleID - Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard that specifies // all handles. // - options - FileClientForceCloseHandlesOptions contains the optional parameters for the FileClient.ForceCloseHandles method. @@ -835,7 +835,7 @@ func (client *FileClient) forceCloseHandlesCreateRequest(ctx context.Context, ha } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["x-ms-handle-id"] = []string{handleID} - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } @@ -888,7 +888,7 @@ func (client *FileClient) forceCloseHandlesHandleResponse(resp *http.Response) ( // not return the content of the file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientGetPropertiesOptions contains the optional parameters for the FileClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *FileClient) GetProperties(ctx context.Context, options *FileClientGetPropertiesOptions, leaseAccessConditions *LeaseAccessConditions) (FileClientGetPropertiesResponse, error) { @@ -923,7 +923,7 @@ func (client *FileClient) getPropertiesCreateRequest(ctx context.Context, option if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -1077,7 +1077,7 @@ func (client *FileClient) getPropertiesHandleResponse(resp *http.Response) (File // GetRangeList - Returns the list of valid ranges for a file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientGetRangeListOptions contains the optional parameters for the FileClient.GetRangeList method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *FileClient) GetRangeList(ctx context.Context, options *FileClientGetRangeListOptions, leaseAccessConditions *LeaseAccessConditions) (FileClientGetRangeListResponse, error) { @@ -1113,7 +1113,7 @@ func (client *FileClient) getRangeListCreateRequest(ctx context.Context, options reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } @@ -1172,7 +1172,7 @@ func (client *FileClient) getRangeListHandleResponse(resp *http.Response) (FileC // ListHandles - Lists handles for file // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientListHandlesOptions contains the optional parameters for the FileClient.ListHandles method. func (client *FileClient) ListHandles(ctx context.Context, options *FileClientListHandlesOptions) (FileClientListHandlesResponse, error) { req, err := client.listHandlesCreateRequest(ctx, options) @@ -1210,7 +1210,7 @@ func (client *FileClient) listHandlesCreateRequest(ctx context.Context, options reqQP.Set("sharesnapshot", *options.Sharesnapshot) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.allowTrailingDot != nil { req.Raw().Header["x-ms-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowTrailingDot)} } @@ -1249,7 +1249,7 @@ func (client *FileClient) listHandlesHandleResponse(resp *http.Response) (FileCl // ReleaseLease - [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - leaseID - Specifies the current lease ID on the resource. // - options - FileClientReleaseLeaseOptions contains the optional parameters for the FileClient.ReleaseLease method. func (client *FileClient) ReleaseLease(ctx context.Context, leaseID string, options *FileClientReleaseLeaseOptions) (FileClientReleaseLeaseResponse, error) { @@ -1281,7 +1281,7 @@ func (client *FileClient) releaseLeaseCreateRequest(ctx context.Context, leaseID req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["x-ms-lease-action"] = []string{"release"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -1330,7 +1330,7 @@ func (client *FileClient) releaseLeaseHandleResponse(resp *http.Response) (FileC // Rename - Renames a file // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - renameSource - Required. Specifies the URI-style path of the source file, up to 2 KB in length. // - options - FileClientRenameOptions contains the optional parameters for the FileClient.Rename method. // - SourceLeaseAccessConditions - SourceLeaseAccessConditions contains a group of parameters for the DirectoryClient.Rename @@ -1366,7 +1366,7 @@ func (client *FileClient) renameCreateRequest(ctx context.Context, renameSource reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} req.Raw().Header["x-ms-file-rename-source"] = []string{renameSource} if options != nil && options.ReplaceIfExists != nil { req.Raw().Header["x-ms-file-rename-replace-if-exists"] = []string{strconv.FormatBool(*options.ReplaceIfExists)} @@ -1493,7 +1493,7 @@ func (client *FileClient) renameHandleResponse(resp *http.Response) (FileClientR // SetHTTPHeaders - Sets HTTP headers on the file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientSetHTTPHeadersOptions contains the optional parameters for the FileClient.SetHTTPHeaders method. // - ShareFileHTTPHeaders - ShareFileHTTPHeaders contains a group of parameters for the FileClient.Create method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. @@ -1524,7 +1524,7 @@ func (client *FileClient) setHTTPHeadersCreateRequest(ctx context.Context, optio reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.FileContentLength != nil { req.Raw().Header["x-ms-content-length"] = []string{strconv.FormatInt(*options.FileContentLength, 10)} } @@ -1649,7 +1649,7 @@ func (client *FileClient) setHTTPHeadersHandleResponse(resp *http.Response) (Fil // SetMetadata - Updates user-defined metadata for the specified file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - FileClientSetMetadataOptions contains the optional parameters for the FileClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *FileClient) SetMetadata(ctx context.Context, options *FileClientSetMetadataOptions, leaseAccessConditions *LeaseAccessConditions) (FileClientSetMetadataResponse, error) { @@ -1686,7 +1686,7 @@ func (client *FileClient) setMetadataCreateRequest(ctx context.Context, options } } } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -1739,7 +1739,7 @@ func (client *FileClient) setMetadataHandleResponse(resp *http.Response) (FileCl // StartCopy - Copies a blob or file to a destination file within the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - copySource - Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another file within // the same storage account, you may use Shared Key to authenticate the source file. If you are // copying a file from another storage account, or if you are copying a blob from the same storage account or another storage @@ -1775,7 +1775,7 @@ func (client *FileClient) startCopyCreateRequest(ctx context.Context, copySource reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.Metadata != nil { for k, v := range options.Metadata { if v != nil { @@ -1865,7 +1865,7 @@ func (client *FileClient) startCopyHandleResponse(resp *http.Response) (FileClie // UploadRange - Upload a range of bytes to a file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - rangeParam - Specifies the range of bytes to be written. Both the start and end of the range must be specified. For an // update operation, the range can be up to 4 MB in size. For a clear operation, the range can be // up to the value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' @@ -1914,7 +1914,7 @@ func (client *FileClient) uploadRangeCreateRequest(ctx context.Context, rangePar if options != nil && options.ContentMD5 != nil { req.Raw().Header["Content-MD5"] = []string{base64.StdEncoding.EncodeToString(options.ContentMD5)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -1987,7 +1987,7 @@ func (client *FileClient) uploadRangeHandleResponse(resp *http.Response) (FileCl // UploadRangeFromURL - Upload a range of bytes to a file where the contents are read from a URL. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - rangeParam - Writes data to the specified byte range in the file. // - copySource - Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another file within // the same storage account, you may use Shared Key to authenticate the source file. If you are @@ -2044,7 +2044,7 @@ func (client *FileClient) uploadRangeFromURLCreateRequest(ctx context.Context, r if sourceModifiedAccessConditions != nil && sourceModifiedAccessConditions.SourceIfNoneMatchCRC64 != nil { req.Raw().Header["x-ms-source-if-none-match-crc64"] = []string{base64.StdEncoding.EncodeToString(sourceModifiedAccessConditions.SourceIfNoneMatchCRC64)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -2060,6 +2060,9 @@ func (client *FileClient) uploadRangeFromURLCreateRequest(ctx context.Context, r if client.allowSourceTrailingDot != nil { req.Raw().Header["x-ms-source-allow-trailing-dot"] = []string{strconv.FormatBool(*client.allowSourceTrailingDot)} } + if client.fileRequestIntent != nil { + req.Raw().Header["x-ms-file-request-intent"] = []string{string(*client.fileRequestIntent)} + } req.Raw().Header["Accept"] = []string{"application/xml"} return req, nil } diff --git a/sdk/storage/azfile/internal/generated/zz_models.go b/sdk/storage/azfile/internal/generated/zz_models.go index a27b53f42cea..10aace210fe4 100644 --- a/sdk/storage/azfile/internal/generated/zz_models.go +++ b/sdk/storage/azfile/internal/generated/zz_models.go @@ -590,7 +590,8 @@ type Handle struct { Path *string `xml:"Path"` // REQUIRED; SMB session ID in context of which the file handle was opened - SessionID *string `xml:"SessionId"` + SessionID *string `xml:"SessionId"` + AccessRightList []*AccessRight `xml:"AccessRightList>AccessRight"` // Time handle was last connected to (UTC) LastReconnectTime *time.Time `xml:"LastReconnectTime"` diff --git a/sdk/storage/azfile/internal/generated/zz_service_client.go b/sdk/storage/azfile/internal/generated/zz_service_client.go index 847b97903bae..fc0cf80a4f2c 100644 --- a/sdk/storage/azfile/internal/generated/zz_service_client.go +++ b/sdk/storage/azfile/internal/generated/zz_service_client.go @@ -31,7 +31,7 @@ type ServiceClient struct { // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. func (client *ServiceClient) GetProperties(ctx context.Context, options *ServiceClientGetPropertiesOptions) (ServiceClientGetPropertiesResponse, error) { req, err := client.getPropertiesCreateRequest(ctx, options) @@ -61,7 +61,7 @@ func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, opt reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} req.Raw().Header["Accept"] = []string{"application/xml"} return req, nil } @@ -84,7 +84,7 @@ func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (S // NewListSharesSegmentPager - The List Shares Segment operation returns a list of the shares and share snapshots under the // specified account. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ServiceClientListSharesSegmentOptions contains the optional parameters for the ServiceClient.NewListSharesSegmentPager // method. // @@ -112,7 +112,7 @@ func (client *ServiceClient) ListSharesSegmentCreateRequest(ctx context.Context, reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} req.Raw().Header["Accept"] = []string{"application/xml"} return req, nil } @@ -136,7 +136,7 @@ func (client *ServiceClient) ListSharesSegmentHandleResponse(resp *http.Response // metrics and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - storageServiceProperties - The StorageService properties. // - options - ServiceClientSetPropertiesOptions contains the optional parameters for the ServiceClient.SetProperties method. func (client *ServiceClient) SetProperties(ctx context.Context, storageServiceProperties StorageServiceProperties, options *ServiceClientSetPropertiesOptions) (ServiceClientSetPropertiesResponse, error) { @@ -167,7 +167,7 @@ func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, sto reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} req.Raw().Header["Accept"] = []string{"application/xml"} if err := runtime.MarshalAsXML(req, storageServiceProperties); err != nil { return nil, err diff --git a/sdk/storage/azfile/internal/generated/zz_share_client.go b/sdk/storage/azfile/internal/generated/zz_share_client.go index 3c83f97775df..83a3092cd292 100644 --- a/sdk/storage/azfile/internal/generated/zz_share_client.go +++ b/sdk/storage/azfile/internal/generated/zz_share_client.go @@ -34,7 +34,7 @@ type ShareClient struct { // delete share operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -75,7 +75,7 @@ func (client *ShareClient) acquireLeaseCreateRequest(ctx context.Context, durati if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -122,7 +122,7 @@ func (client *ShareClient) acquireLeaseHandleResponse(resp *http.Response) (Shar // delete share operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientBreakLeaseOptions contains the optional parameters for the ShareClient.BreakLease method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *ShareClient) BreakLease(ctx context.Context, options *ShareClientBreakLeaseOptions, leaseAccessConditions *LeaseAccessConditions) (ShareClientBreakLeaseResponse, error) { @@ -163,7 +163,7 @@ func (client *ShareClient) breakLeaseCreateRequest(ctx context.Context, options if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -218,7 +218,7 @@ func (client *ShareClient) breakLeaseHandleResponse(resp *http.Response) (ShareC // delete share operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - leaseID - Specifies the current lease ID on the resource. // - options - ShareClientChangeLeaseOptions contains the optional parameters for the ShareClient.ChangeLease method. func (client *ShareClient) ChangeLease(ctx context.Context, leaseID string, options *ShareClientChangeLeaseOptions) (ShareClientChangeLeaseResponse, error) { @@ -257,7 +257,7 @@ func (client *ShareClient) changeLeaseCreateRequest(ctx context.Context, leaseID if options != nil && options.ProposedLeaseID != nil { req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -304,7 +304,7 @@ func (client *ShareClient) changeLeaseHandleResponse(resp *http.Response) (Share // fails. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientCreateOptions contains the optional parameters for the ShareClient.Create method. func (client *ShareClient) Create(ctx context.Context, options *ShareClientCreateOptions) (ShareClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, options) @@ -346,7 +346,7 @@ func (client *ShareClient) createCreateRequest(ctx context.Context, options *Sha if options != nil && options.AccessTier != nil { req.Raw().Header["x-ms-access-tier"] = []string{string(*options.AccessTier)} } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.EnabledProtocols != nil { req.Raw().Header["x-ms-enabled-protocols"] = []string{*options.EnabledProtocols} } @@ -389,7 +389,7 @@ func (client *ShareClient) createHandleResponse(resp *http.Response) (ShareClien // CreatePermission - Create a permission (a security descriptor). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - sharePermission - A permission (a security descriptor) at the share level. // - options - ShareClientCreatePermissionOptions contains the optional parameters for the ShareClient.CreatePermission method. func (client *ShareClient) CreatePermission(ctx context.Context, sharePermission SharePermission, options *ShareClientCreatePermissionOptions) (ShareClientCreatePermissionResponse, error) { @@ -420,7 +420,7 @@ func (client *ShareClient) createPermissionCreateRequest(ctx context.Context, sh reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.fileRequestIntent != nil { req.Raw().Header["x-ms-file-request-intent"] = []string{string(*client.fileRequestIntent)} } @@ -456,7 +456,7 @@ func (client *ShareClient) createPermissionHandleResponse(resp *http.Response) ( // CreateSnapshot - Creates a read-only snapshot of a share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientCreateSnapshotOptions contains the optional parameters for the ShareClient.CreateSnapshot method. func (client *ShareClient) CreateSnapshot(ctx context.Context, options *ShareClientCreateSnapshotOptions) (ShareClientCreateSnapshotResponse, error) { req, err := client.createSnapshotCreateRequest(ctx, options) @@ -493,7 +493,7 @@ func (client *ShareClient) createSnapshotCreateRequest(ctx context.Context, opti } } } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} req.Raw().Header["Accept"] = []string{"application/xml"} return req, nil } @@ -534,7 +534,7 @@ func (client *ShareClient) createSnapshotHandleResponse(resp *http.Response) (Sh // contained within it are later deleted during garbage collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientDeleteOptions contains the optional parameters for the ShareClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *ShareClient) Delete(ctx context.Context, options *ShareClientDeleteOptions, leaseAccessConditions *LeaseAccessConditions) (ShareClientDeleteResponse, error) { @@ -567,7 +567,7 @@ func (client *ShareClient) deleteCreateRequest(ctx context.Context, options *Sha reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.DeleteSnapshots != nil { req.Raw().Header["x-ms-delete-snapshots"] = []string{string(*options.DeleteSnapshots)} } @@ -600,7 +600,7 @@ func (client *ShareClient) deleteHandleResponse(resp *http.Response) (ShareClien // GetAccessPolicy - Returns information about stored access policies specified on the share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientGetAccessPolicyOptions contains the optional parameters for the ShareClient.GetAccessPolicy method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *ShareClient) GetAccessPolicy(ctx context.Context, options *ShareClientGetAccessPolicyOptions, leaseAccessConditions *LeaseAccessConditions) (ShareClientGetAccessPolicyResponse, error) { @@ -631,7 +631,7 @@ func (client *ShareClient) getAccessPolicyCreateRequest(ctx context.Context, opt reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -674,7 +674,7 @@ func (client *ShareClient) getAccessPolicyHandleResponse(resp *http.Response) (S // GetPermission - Returns the permission (security descriptor) for a given key // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - filePermissionKey - Key of the permission to be set for the directory/file. // - options - ShareClientGetPermissionOptions contains the optional parameters for the ShareClient.GetPermission method. func (client *ShareClient) GetPermission(ctx context.Context, filePermissionKey string, options *ShareClientGetPermissionOptions) (ShareClientGetPermissionResponse, error) { @@ -706,7 +706,7 @@ func (client *ShareClient) getPermissionCreateRequest(ctx context.Context, fileP } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["x-ms-file-permission-key"] = []string{filePermissionKey} - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if client.fileRequestIntent != nil { req.Raw().Header["x-ms-file-request-intent"] = []string{string(*client.fileRequestIntent)} } @@ -740,7 +740,7 @@ func (client *ShareClient) getPermissionHandleResponse(resp *http.Response) (Sha // data returned does not include the share's list of files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientGetPropertiesOptions contains the optional parameters for the ShareClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *ShareClient) GetProperties(ctx context.Context, options *ShareClientGetPropertiesOptions, leaseAccessConditions *LeaseAccessConditions) (ShareClientGetPropertiesResponse, error) { @@ -773,7 +773,7 @@ func (client *ShareClient) getPropertiesCreateRequest(ctx context.Context, optio reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -896,7 +896,7 @@ func (client *ShareClient) getPropertiesHandleResponse(resp *http.Response) (Sha // GetStatistics - Retrieves statistics related to the share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientGetStatisticsOptions contains the optional parameters for the ShareClient.GetStatistics method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *ShareClient) GetStatistics(ctx context.Context, options *ShareClientGetStatisticsOptions, leaseAccessConditions *LeaseAccessConditions) (ShareClientGetStatisticsResponse, error) { @@ -927,7 +927,7 @@ func (client *ShareClient) getStatisticsCreateRequest(ctx context.Context, optio reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -971,7 +971,7 @@ func (client *ShareClient) getStatisticsHandleResponse(resp *http.Response) (Sha // delete share operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - leaseID - Specifies the current lease ID on the resource. // - options - ShareClientReleaseLeaseOptions contains the optional parameters for the ShareClient.ReleaseLease method. func (client *ShareClient) ReleaseLease(ctx context.Context, leaseID string, options *ShareClientReleaseLeaseOptions) (ShareClientReleaseLeaseResponse, error) { @@ -1007,7 +1007,7 @@ func (client *ShareClient) releaseLeaseCreateRequest(ctx context.Context, leaseI req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["x-ms-lease-action"] = []string{"release"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -1051,7 +1051,7 @@ func (client *ShareClient) releaseLeaseHandleResponse(resp *http.Response) (Shar // delete share operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - leaseID - Specifies the current lease ID on the resource. // - options - ShareClientRenewLeaseOptions contains the optional parameters for the ShareClient.RenewLease method. func (client *ShareClient) RenewLease(ctx context.Context, leaseID string, options *ShareClientRenewLeaseOptions) (ShareClientRenewLeaseResponse, error) { @@ -1087,7 +1087,7 @@ func (client *ShareClient) renewLeaseCreateRequest(ctx context.Context, leaseID req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["x-ms-lease-action"] = []string{"renew"} req.Raw().Header["x-ms-lease-id"] = []string{leaseID} - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -1133,7 +1133,7 @@ func (client *ShareClient) renewLeaseHandleResponse(resp *http.Response) (ShareC // Restore - Restores a previously deleted Share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientRestoreOptions contains the optional parameters for the ShareClient.Restore method. func (client *ShareClient) Restore(ctx context.Context, options *ShareClientRestoreOptions) (ShareClientRestoreResponse, error) { req, err := client.restoreCreateRequest(ctx, options) @@ -1163,7 +1163,7 @@ func (client *ShareClient) restoreCreateRequest(ctx context.Context, options *Sh reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} } @@ -1212,7 +1212,7 @@ func (client *ShareClient) restoreHandleResponse(resp *http.Response) (ShareClie // SetAccessPolicy - Sets a stored access policy for use with shared access signatures. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - shareACL - The ACL for the share. // - options - ShareClientSetAccessPolicyOptions contains the optional parameters for the ShareClient.SetAccessPolicy method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. @@ -1244,7 +1244,7 @@ func (client *ShareClient) setAccessPolicyCreateRequest(ctx context.Context, sha reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -1291,7 +1291,7 @@ func (client *ShareClient) setAccessPolicyHandleResponse(resp *http.Response) (S // SetMetadata - Sets one or more user-defined name-value pairs for the specified share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientSetMetadataOptions contains the optional parameters for the ShareClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *ShareClient) SetMetadata(ctx context.Context, options *ShareClientSetMetadataOptions, leaseAccessConditions *LeaseAccessConditions) (ShareClientSetMetadataResponse, error) { @@ -1329,7 +1329,7 @@ func (client *ShareClient) setMetadataCreateRequest(ctx context.Context, options } } } - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } @@ -1369,7 +1369,7 @@ func (client *ShareClient) setMetadataHandleResponse(resp *http.Response) (Share // SetProperties - Sets properties for the specified share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-02 +// Generated from API version 2023-11-03 // - options - ShareClientSetPropertiesOptions contains the optional parameters for the ShareClient.SetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ShareClient.GetProperties method. func (client *ShareClient) SetProperties(ctx context.Context, options *ShareClientSetPropertiesOptions, leaseAccessConditions *LeaseAccessConditions) (ShareClientSetPropertiesResponse, error) { @@ -1400,7 +1400,7 @@ func (client *ShareClient) setPropertiesCreateRequest(ctx context.Context, optio reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["x-ms-version"] = []string{"2022-11-02"} + req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if options != nil && options.Quota != nil { req.Raw().Header["x-ms-share-quota"] = []string{strconv.FormatInt(int64(*options.Quota), 10)} }