< Summary

Class:Azure.Storage.Files.Shares.FileRestClient
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Generated\FileRestClient.cs
Covered lines:2010
Uncovered lines:367
Coverable lines:2377
Total lines:11010
Line coverage:84.5% (2010 of 2377)
Covered branches:829
Total branches:1185
Branch coverage:69.9% (829 of 1185)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
SetPropertiesAsync()-100%100%
SetPropertiesAsync_CreateMessage(...)-80%50%
SetPropertiesAsync_CreateResponse(...)-100%100%
GetPropertiesAsync()-100%100%
GetPropertiesAsync_CreateMessage(...)-76.92%50%
GetPropertiesAsync_CreateResponse(...)-87.5%75%
ListSharesSegmentAsync()-100%100%
ListSharesSegmentAsync_CreateMessage(...)-62.5%57.14%
ListSharesSegmentAsync_CreateResponse(...)-87.5%75%
CreateAsync()-100%100%
CreateAsync_CreateMessage(...)-81.25%75%
CreateAsync_CreateResponse(...)-100%100%
GetPropertiesAsync()-100%100%
GetPropertiesAsync_CreateMessage(...)-69.23%50%
GetPropertiesAsync_CreateResponse(...)-80%77.27%
DeleteAsync()-100%100%
DeleteAsync_CreateMessage(...)-71.43%60%
DeleteAsync_CreateResponse(...)-100%100%
CreateSnapshotAsync()-100%100%
CreateSnapshotAsync_CreateMessage(...)-68.75%40%
CreateSnapshotAsync_CreateResponse(...)-100%100%
CreatePermissionAsync()-100%100%
CreatePermissionAsync_CreateMessage(...)-78.95%50%
CreatePermissionAsync_CreateResponse(...)-100%100%
GetPermissionAsync()-100%100%
GetPermissionAsync_CreateMessage(...)-75%50%
GetPermissionAsync_CreateResponse(...)-88.89%75%
SetQuotaAsync()-100%100%
SetQuotaAsync_CreateMessage(...)-78.57%62.5%
SetQuotaAsync_CreateResponse(...)-100%100%
SetMetadataAsync()-100%100%
SetMetadataAsync_CreateMessage(...)-81.25%70%
SetMetadataAsync_CreateResponse(...)-100%100%
GetAccessPolicyAsync()-100%100%
GetAccessPolicyAsync_CreateMessage(...)-76.92%50%
GetAccessPolicyAsync_CreateResponse(...)-91.67%75%
SetAccessPolicyAsync()-100%100%
SetAccessPolicyAsync_CreateMessage(...)-85.71%70%
SetAccessPolicyAsync_CreateResponse(...)-100%100%
GetStatisticsAsync()-100%100%
GetStatisticsAsync_CreateMessage(...)-76.92%50%
GetStatisticsAsync_CreateResponse(...)-87.5%75%
RestoreAsync()-100%100%
RestoreAsync_CreateMessage(...)-75%66.67%
RestoreAsync_CreateResponse(...)-100%100%
CreateAsync()-100%100%
CreateAsync_CreateMessage(...)-76.92%70%
CreateAsync_CreateResponse(...)-100%100%
GetPropertiesAsync()-100%100%
GetPropertiesAsync_CreateMessage(...)-69.23%50%
GetPropertiesAsync_CreateResponse(...)-96.77%96.43%
DeleteAsync()-100%100%
DeleteAsync_CreateMessage(...)-75%50%
DeleteAsync_CreateResponse(...)-100%100%
SetPropertiesAsync()-87.5%100%
SetPropertiesAsync_CreateMessage(...)-75%62.5%
SetPropertiesAsync_CreateResponse(...)-87.5%95%
SetMetadataAsync()-100%100%
SetMetadataAsync_CreateMessage(...)-81.25%70%
SetMetadataAsync_CreateResponse(...)-100%100%
ListFilesAndDirectoriesSegmentAsync()-100%100%
ListFilesAndDirectoriesSegmentAsync_CreateMessage(...)-58.82%50%
ListFilesAndDirectoriesSegmentAsync_CreateResponse(...)-87.5%75%
ListHandlesAsync()-100%100%
ListHandlesAsync_CreateMessage(...)-70.59%64.29%
ListHandlesAsync_CreateResponse(...)-87.5%75%
ForceCloseHandlesAsync()-100%100%
ForceCloseHandlesAsync_CreateMessage(...)-68.42%57.14%
ForceCloseHandlesAsync_CreateResponse(...)-91.67%87.5%
CreateAsync()-100%100%
CreateAsync_CreateMessage(...)-84.21%84.21%
CreateAsync_CreateResponse(...)-100%100%
DownloadAsync()-100%100%
DownloadAsync_CreateMessage(...)-73.33%66.67%
DownloadAsync_CreateResponse(...)-41.48%38.41%
GetPropertiesAsync()-100%100%
GetPropertiesAsync_CreateMessage(...)-69.23%60%
GetPropertiesAsync_CreateResponse(...)-96.88%93.94%
DeleteAsync()-100%100%
DeleteAsync_CreateMessage(...)-75%62.5%
DeleteAsync_CreateResponse(...)-100%100%
SetPropertiesAsync()-100%100%
SetPropertiesAsync_CreateMessage(...)-80%80.56%
SetPropertiesAsync_CreateResponse(...)-100%100%
SetMetadataAsync()-100%100%
SetMetadataAsync_CreateMessage(...)-81.25%75%
SetMetadataAsync_CreateResponse(...)-100%100%
AcquireLeaseAsync()-100%100%
AcquireLeaseAsync_CreateMessage(...)-75%66.67%
AcquireLeaseAsync_CreateResponse(...)-100%100%
ReleaseLeaseAsync()-100%100%
ReleaseLeaseAsync_CreateMessage(...)-70.59%50%
ReleaseLeaseAsync_CreateResponse(...)-100%100%
ChangeLeaseAsync()-100%100%
ChangeLeaseAsync_CreateMessage(...)-72.22%58.33%
ChangeLeaseAsync_CreateResponse(...)-100%100%
BreakLeaseAsync()-100%100%
BreakLeaseAsync_CreateMessage(...)-73.33%60%
BreakLeaseAsync_CreateResponse(...)-91.67%87.5%
UploadRangeAsync()-100%100%
UploadRangeAsync_CreateMessage(...)-76.19%64.29%
UploadRangeAsync_CreateResponse(...)-100%100%
UploadRangeFromURLAsync()-96.3%100%
UploadRangeFromURLAsync_CreateMessage(...)-64%55%
UploadRangeFromURLAsync_CreateResponse(...)-28.57%10%
GetRangeListAsync()-100%100%
GetRangeListAsync_CreateMessage(...)-73.33%66.67%
GetRangeListAsync_CreateResponse(...)-94.74%90%
StartCopyAsync()-100%100%
StartCopyAsync_CreateMessage(...)-85.71%86.67%
StartCopyAsync_CreateResponse(...)-100%100%
AbortCopyAsync()-95.24%100%
AbortCopyAsync_CreateMessage(...)-76.47%60%
AbortCopyAsync_CreateResponse(...)-80%50%
ListHandlesAsync()-100%100%
ListHandlesAsync_CreateMessage(...)-60%50%
ListHandlesAsync_CreateResponse(...)-87.5%75%
ForceCloseHandlesAsync()-100%100%
ForceCloseHandlesAsync_CreateMessage(...)-64.71%50%
ForceCloseHandlesAsync_CreateResponse(...)-91.67%87.5%
ToString(...)-0%0%
ParseCopyStatus(...)-50%25%
ToString(...)-80%50%
ParseDeleteSnapshotsOptionType(...)-0%0%
ToString(...)-71.43%50%
ParseListSharesIncludeType(...)-0%0%
ToString(...)-66.67%50%
ParsePermissionCopyMode(...)-0%0%
ToString(...)-83.33%75%
ParseShareFileRangeWriteType(...)-0%0%
ToString(...)-0%0%
ParseShareLeaseDuration(...)-66.67%25%
ToString(...)-0%0%
ParseShareLeaseState(...)-55.56%30%
ToString(...)-0%0%
ParseShareLeaseStatus(...)-83.33%75%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Files.Shares\src\Generated\FileRestClient.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// This file was automatically generated.  Do not edit.
 5
 6#pragma warning disable IDE0016 // Null check can be simplified
 7#pragma warning disable IDE0017 // Variable declaration can be inlined
 8#pragma warning disable IDE0018 // Object initialization can be simplified
 9#pragma warning disable SA1402  // File may only contain a single type
 10
 11#region Service
 12namespace Azure.Storage.Files.Shares
 13{
 14    /// <summary>
 15    /// Azure File Storage
 16    /// </summary>
 17    internal static partial class FileRestClient
 18    {
 19        #region Service operations
 20        /// <summary>
 21        /// Service operations for Azure File Storage
 22        /// </summary>
 23        public static partial class Service
 24        {
 25            #region Service.SetPropertiesAsync
 26            /// <summary>
 27            /// Sets properties for a storage account's File service endpoint, including properties for Storage Analytic
 28            /// </summary>
 29            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 30            /// <param name="pipeline">The pipeline used for sending requests.</param>
 31            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 32            /// <param name="properties">The StorageService properties.</param>
 33            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 34            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 35            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 36            /// <param name="operationName">Operation name.</param>
 37            /// <param name="cancellationToken">Cancellation token.</param>
 38            /// <returns>Azure.Response</returns>
 39            public static async System.Threading.Tasks.ValueTask<Azure.Response> SetPropertiesAsync(
 40                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 41                Azure.Core.Pipeline.HttpPipeline pipeline,
 42                System.Uri resourceUri,
 43                Azure.Storage.Files.Shares.Models.ShareServiceProperties properties,
 44                string version,
 45                int? timeout = default,
 46                bool async = true,
 47                string operationName = "ServiceClient.SetProperties",
 48                System.Threading.CancellationToken cancellationToken = default)
 49            {
 450                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 51                try
 52                {
 453                    _scope.AddAttribute("url", resourceUri);
 454                    _scope.Start();
 455                    using (Azure.Core.HttpMessage _message = SetPropertiesAsync_CreateMessage(
 456                        pipeline,
 457                        resourceUri,
 458                        properties,
 459                        version,
 460                        timeout))
 61                    {
 462                        if (async)
 63                        {
 64                            // Send the request asynchronously if we're being called via an async path
 265                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 66                        }
 67                        else
 68                        {
 69                            // Send the request synchronously through the API that blocks if we're being called via a sy
 70                            // (this is safe because the Task will complete before the user can call Wait)
 271                            pipeline.Send(_message, cancellationToken);
 72                        }
 473                        Azure.Response _response = _message.Response;
 474                        cancellationToken.ThrowIfCancellationRequested();
 475                        return SetPropertiesAsync_CreateResponse(clientDiagnostics, _response);
 76                    }
 77                }
 278                catch (System.Exception ex)
 79                {
 280                    _scope.Failed(ex);
 281                    throw;
 82                }
 83                finally
 84                {
 485                    _scope.Dispose();
 86                }
 287            }
 88
 89            /// <summary>
 90            /// Create the Service.SetPropertiesAsync request.
 91            /// </summary>
 92            /// <param name="pipeline">The pipeline used for sending requests.</param>
 93            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 94            /// <param name="properties">The StorageService properties.</param>
 95            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 96            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 97            /// <returns>The Service.SetPropertiesAsync Message.</returns>
 98            internal static Azure.Core.HttpMessage SetPropertiesAsync_CreateMessage(
 99                Azure.Core.Pipeline.HttpPipeline pipeline,
 100                System.Uri resourceUri,
 101                Azure.Storage.Files.Shares.Models.ShareServiceProperties properties,
 102                string version,
 103                int? timeout = default)
 104            {
 105                // Validation
 4106                if (resourceUri == null)
 107                {
 0108                    throw new System.ArgumentNullException(nameof(resourceUri));
 109                }
 4110                if (properties == null)
 111                {
 0112                    throw new System.ArgumentNullException(nameof(properties));
 113                }
 4114                if (version == null)
 115                {
 0116                    throw new System.ArgumentNullException(nameof(version));
 117                }
 118
 119                // Create the request
 4120                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 4121                Azure.Core.Request _request = _message.Request;
 122
 123                // Set the endpoint
 4124                _request.Method = Azure.Core.RequestMethod.Put;
 4125                _request.Uri.Reset(resourceUri);
 4126                _request.Uri.AppendQuery("restype", "service", escapeValue: false);
 4127                _request.Uri.AppendQuery("comp", "properties", escapeValue: false);
 0128                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 129
 130                // Add request headers
 4131                _request.Headers.SetValue("x-ms-version", version);
 132
 133                // Create the body
 4134                System.Xml.Linq.XElement _body = Azure.Storage.Files.Shares.Models.ShareServiceProperties.ToXml(properti
 4135                string _text = _body.ToString(System.Xml.Linq.SaveOptions.DisableFormatting);
 4136                _request.Headers.SetValue("Content-Type", "application/xml");
 4137                _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.Invar
 4138                _request.Content = Azure.Core.RequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text));
 139
 4140                return _message;
 141            }
 142
 143            /// <summary>
 144            /// Create the Service.SetPropertiesAsync response or throw a failure exception.
 145            /// </summary>
 146            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 147            /// <param name="response">The raw Response.</param>
 148            /// <returns>The Service.SetPropertiesAsync Azure.Response.</returns>
 149            internal static Azure.Response SetPropertiesAsync_CreateResponse(
 150                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 151                Azure.Response response)
 152            {
 153                // Process the response
 4154                switch (response.Status)
 155                {
 156                    case 202:
 157                    {
 2158                        return response;
 159                    }
 160                    default:
 161                    {
 162                        // Create the result
 2163                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 2164                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 165
 2166                        throw _value.CreateException(clientDiagnostics, response);
 167                    }
 168                }
 169            }
 170            #endregion Service.SetPropertiesAsync
 171
 172            #region Service.GetPropertiesAsync
 173            /// <summary>
 174            /// Gets the properties of a storage account's File service, including properties for Storage Analytics metr
 175            /// </summary>
 176            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 177            /// <param name="pipeline">The pipeline used for sending requests.</param>
 178            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 179            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 180            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 181            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 182            /// <param name="operationName">Operation name.</param>
 183            /// <param name="cancellationToken">Cancellation token.</param>
 184            /// <returns>Storage service properties.</returns>
 185            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareS
 186                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 187                Azure.Core.Pipeline.HttpPipeline pipeline,
 188                System.Uri resourceUri,
 189                string version,
 190                int? timeout = default,
 191                bool async = true,
 192                string operationName = "ServiceClient.GetProperties",
 193                System.Threading.CancellationToken cancellationToken = default)
 194            {
 10195                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 196                try
 197                {
 10198                    _scope.AddAttribute("url", resourceUri);
 10199                    _scope.Start();
 10200                    using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage(
 10201                        pipeline,
 10202                        resourceUri,
 10203                        version,
 10204                        timeout))
 205                    {
 10206                        if (async)
 207                        {
 208                            // Send the request asynchronously if we're being called via an async path
 5209                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 210                        }
 211                        else
 212                        {
 213                            // Send the request synchronously through the API that blocks if we're being called via a sy
 214                            // (this is safe because the Task will complete before the user can call Wait)
 5215                            pipeline.Send(_message, cancellationToken);
 216                        }
 10217                        Azure.Response _response = _message.Response;
 10218                        cancellationToken.ThrowIfCancellationRequested();
 10219                        return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response);
 220                    }
 221                }
 2222                catch (System.Exception ex)
 223                {
 2224                    _scope.Failed(ex);
 2225                    throw;
 226                }
 227                finally
 228                {
 10229                    _scope.Dispose();
 230                }
 8231            }
 232
 233            /// <summary>
 234            /// Create the Service.GetPropertiesAsync request.
 235            /// </summary>
 236            /// <param name="pipeline">The pipeline used for sending requests.</param>
 237            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 238            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 239            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 240            /// <returns>The Service.GetPropertiesAsync Message.</returns>
 241            internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage(
 242                Azure.Core.Pipeline.HttpPipeline pipeline,
 243                System.Uri resourceUri,
 244                string version,
 245                int? timeout = default)
 246            {
 247                // Validation
 10248                if (resourceUri == null)
 249                {
 0250                    throw new System.ArgumentNullException(nameof(resourceUri));
 251                }
 10252                if (version == null)
 253                {
 0254                    throw new System.ArgumentNullException(nameof(version));
 255                }
 256
 257                // Create the request
 10258                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 10259                Azure.Core.Request _request = _message.Request;
 260
 261                // Set the endpoint
 10262                _request.Method = Azure.Core.RequestMethod.Get;
 10263                _request.Uri.Reset(resourceUri);
 10264                _request.Uri.AppendQuery("restype", "service", escapeValue: false);
 10265                _request.Uri.AppendQuery("comp", "properties", escapeValue: false);
 0266                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 267
 268                // Add request headers
 10269                _request.Headers.SetValue("x-ms-version", version);
 270
 10271                return _message;
 272            }
 273
 274            /// <summary>
 275            /// Create the Service.GetPropertiesAsync response or throw a failure exception.
 276            /// </summary>
 277            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 278            /// <param name="response">The raw Response.</param>
 279            /// <returns>The Service.GetPropertiesAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareServicePro
 280            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareServiceProperties> GetPropertiesAsync_
 281                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 282                Azure.Response response)
 283            {
 284                // Process the response
 10285                switch (response.Status)
 286                {
 287                    case 200:
 288                    {
 289                        // Create the result
 8290                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 8291                        Azure.Storage.Files.Shares.Models.ShareServiceProperties _value = Azure.Storage.Files.Shares.Mod
 292
 293                        // Create the response
 8294                        return Response.FromValue(_value, response);
 295                    }
 296                    case 304:
 297                    {
 0298                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.ShareServiceProperties>(respon
 299                    }
 300                    default:
 301                    {
 302                        // Create the result
 2303                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 2304                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 305
 2306                        throw _value.CreateException(clientDiagnostics, response);
 307                    }
 308                }
 309            }
 310            #endregion Service.GetPropertiesAsync
 311
 312            #region Service.ListSharesSegmentAsync
 313            /// <summary>
 314            /// The List Shares Segment operation returns a list of the shares and share snapshots under the specified a
 315            /// </summary>
 316            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 317            /// <param name="pipeline">The pipeline used for sending requests.</param>
 318            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 319            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 320            /// <param name="prefix">Filters the results to return only entries whose name begins with the specified pre
 321            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 322            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 323            /// <param name="include">Include this parameter to specify one or more datasets to include in the response.
 324            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 325            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 326            /// <param name="operationName">Operation name.</param>
 327            /// <param name="cancellationToken">Cancellation token.</param>
 328            /// <returns>An enumeration of shares.</returns>
 329            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.Shares
 330                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 331                Azure.Core.Pipeline.HttpPipeline pipeline,
 332                System.Uri resourceUri,
 333                string version,
 334                string prefix = default,
 335                string marker = default,
 336                int? maxresults = default,
 337                System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ListSharesIncludeType> include 
 338                int? timeout = default,
 339                bool async = true,
 340                string operationName = "ServiceClient.ListSharesSegment",
 341                System.Threading.CancellationToken cancellationToken = default)
 342            {
 10343                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 344                try
 345                {
 10346                    _scope.AddAttribute("url", resourceUri);
 10347                    _scope.Start();
 10348                    using (Azure.Core.HttpMessage _message = ListSharesSegmentAsync_CreateMessage(
 10349                        pipeline,
 10350                        resourceUri,
 10351                        version,
 10352                        prefix,
 10353                        marker,
 10354                        maxresults,
 10355                        include,
 10356                        timeout))
 357                    {
 10358                        if (async)
 359                        {
 360                            // Send the request asynchronously if we're being called via an async path
 5361                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 362                        }
 363                        else
 364                        {
 365                            // Send the request synchronously through the API that blocks if we're being called via a sy
 366                            // (this is safe because the Task will complete before the user can call Wait)
 5367                            pipeline.Send(_message, cancellationToken);
 368                        }
 10369                        Azure.Response _response = _message.Response;
 10370                        cancellationToken.ThrowIfCancellationRequested();
 10371                        return ListSharesSegmentAsync_CreateResponse(clientDiagnostics, _response);
 372                    }
 373                }
 2374                catch (System.Exception ex)
 375                {
 2376                    _scope.Failed(ex);
 2377                    throw;
 378                }
 379                finally
 380                {
 10381                    _scope.Dispose();
 382                }
 8383            }
 384
 385            /// <summary>
 386            /// Create the Service.ListSharesSegmentAsync request.
 387            /// </summary>
 388            /// <param name="pipeline">The pipeline used for sending requests.</param>
 389            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 390            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 391            /// <param name="prefix">Filters the results to return only entries whose name begins with the specified pre
 392            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 393            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 394            /// <param name="include">Include this parameter to specify one or more datasets to include in the response.
 395            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 396            /// <returns>The Service.ListSharesSegmentAsync Message.</returns>
 397            internal static Azure.Core.HttpMessage ListSharesSegmentAsync_CreateMessage(
 398                Azure.Core.Pipeline.HttpPipeline pipeline,
 399                System.Uri resourceUri,
 400                string version,
 401                string prefix = default,
 402                string marker = default,
 403                int? maxresults = default,
 404                System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ListSharesIncludeType> include 
 405                int? timeout = default)
 406            {
 407                // Validation
 10408                if (resourceUri == null)
 409                {
 0410                    throw new System.ArgumentNullException(nameof(resourceUri));
 411                }
 10412                if (version == null)
 413                {
 0414                    throw new System.ArgumentNullException(nameof(version));
 415                }
 416
 417                // Create the request
 10418                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 10419                Azure.Core.Request _request = _message.Request;
 420
 421                // Set the endpoint
 10422                _request.Method = Azure.Core.RequestMethod.Get;
 10423                _request.Uri.Reset(resourceUri);
 10424                _request.Uri.AppendQuery("comp", "list", escapeValue: false);
 0425                if (prefix != null) { _request.Uri.AppendQuery("prefix", prefix); }
 0426                if (marker != null) { _request.Uri.AppendQuery("marker", marker); }
 0427                if (maxresults != null) { _request.Uri.AppendQuery("maxresults", maxresults.Value.ToString(System.Global
 22428                if (include != null) { _request.Uri.AppendQuery("include", string.Join(",", System.Linq.Enumerable.Selec
 0429                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 430
 431                // Add request headers
 10432                _request.Headers.SetValue("x-ms-version", version);
 433
 10434                return _message;
 435            }
 436
 437            /// <summary>
 438            /// Create the Service.ListSharesSegmentAsync response or throw a failure exception.
 439            /// </summary>
 440            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 441            /// <param name="response">The raw Response.</param>
 442            /// <returns>The Service.ListSharesSegmentAsync Azure.Response{Azure.Storage.Files.Shares.Models.SharesSegme
 443            internal static Azure.Response<Azure.Storage.Files.Shares.Models.SharesSegment> ListSharesSegmentAsync_Creat
 444                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 445                Azure.Response response)
 446            {
 447                // Process the response
 10448                switch (response.Status)
 449                {
 450                    case 200:
 451                    {
 452                        // Create the result
 8453                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 8454                        Azure.Storage.Files.Shares.Models.SharesSegment _value = Azure.Storage.Files.Shares.Models.Share
 455
 456                        // Create the response
 8457                        return Response.FromValue(_value, response);
 458                    }
 459                    case 304:
 460                    {
 0461                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.SharesSegment>(response);
 462                    }
 463                    default:
 464                    {
 465                        // Create the result
 2466                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 2467                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 468
 2469                        throw _value.CreateException(clientDiagnostics, response);
 470                    }
 471                }
 472            }
 473            #endregion Service.ListSharesSegmentAsync
 474        }
 475        #endregion Service operations
 476
 477        #region Share operations
 478        /// <summary>
 479        /// Share operations for Azure File Storage
 480        /// </summary>
 481        public static partial class Share
 482        {
 483            #region Share.CreateAsync
 484            /// <summary>
 485            /// Creates a new share under the specified account. If the share with the same name already exists, the ope
 486            /// </summary>
 487            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 488            /// <param name="pipeline">The pipeline used for sending requests.</param>
 489            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 490            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 491            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 492            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 493            /// <param name="quotaInGB">Specifies the maximum size of the share, in gigabytes.</param>
 494            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 495            /// <param name="operationName">Operation name.</param>
 496            /// <param name="cancellationToken">Cancellation token.</param>
 497            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}</returns>
 498            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareI
 499                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 500                Azure.Core.Pipeline.HttpPipeline pipeline,
 501                System.Uri resourceUri,
 502                string version,
 503                int? timeout = default,
 504                System.Collections.Generic.IDictionary<string, string> metadata = default,
 505                int? quotaInGB = default,
 506                bool async = true,
 507                string operationName = "ShareClient.Create",
 508                System.Threading.CancellationToken cancellationToken = default)
 509            {
 447510                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 511                try
 512                {
 447513                    _scope.AddAttribute("url", resourceUri);
 447514                    _scope.Start();
 447515                    using (Azure.Core.HttpMessage _message = CreateAsync_CreateMessage(
 447516                        pipeline,
 447517                        resourceUri,
 447518                        version,
 447519                        timeout,
 447520                        metadata,
 447521                        quotaInGB))
 522                    {
 447523                        if (async)
 524                        {
 525                            // Send the request asynchronously if we're being called via an async path
 224526                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 527                        }
 528                        else
 529                        {
 530                            // Send the request synchronously through the API that blocks if we're being called via a sy
 531                            // (this is safe because the Task will complete before the user can call Wait)
 223532                            pipeline.Send(_message, cancellationToken);
 533                        }
 447534                        Azure.Response _response = _message.Response;
 447535                        cancellationToken.ThrowIfCancellationRequested();
 447536                        return CreateAsync_CreateResponse(clientDiagnostics, _response);
 537                    }
 538                }
 8539                catch (System.Exception ex)
 540                {
 8541                    _scope.Failed(ex);
 8542                    throw;
 543                }
 544                finally
 545                {
 447546                    _scope.Dispose();
 547                }
 439548            }
 549
 550            /// <summary>
 551            /// Create the Share.CreateAsync request.
 552            /// </summary>
 553            /// <param name="pipeline">The pipeline used for sending requests.</param>
 554            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 555            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 556            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 557            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 558            /// <param name="quotaInGB">Specifies the maximum size of the share, in gigabytes.</param>
 559            /// <returns>The Share.CreateAsync Message.</returns>
 560            internal static Azure.Core.HttpMessage CreateAsync_CreateMessage(
 561                Azure.Core.Pipeline.HttpPipeline pipeline,
 562                System.Uri resourceUri,
 563                string version,
 564                int? timeout = default,
 565                System.Collections.Generic.IDictionary<string, string> metadata = default,
 566                int? quotaInGB = default)
 567            {
 568                // Validation
 447569                if (resourceUri == null)
 570                {
 0571                    throw new System.ArgumentNullException(nameof(resourceUri));
 572                }
 447573                if (version == null)
 574                {
 0575                    throw new System.ArgumentNullException(nameof(version));
 576                }
 577
 578                // Create the request
 447579                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 447580                Azure.Core.Request _request = _message.Request;
 581
 582                // Set the endpoint
 447583                _request.Method = Azure.Core.RequestMethod.Put;
 447584                _request.Uri.Reset(resourceUri);
 447585                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 0586                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 587
 588                // Add request headers
 447589                _request.Headers.SetValue("x-ms-version", version);
 447590                if (metadata != null) {
 850591                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 592                    {
 16593                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 594                    }
 595                }
 457596                if (quotaInGB != null) { _request.Headers.SetValue("x-ms-share-quota", quotaInGB.Value.ToString(System.G
 597
 447598                return _message;
 599            }
 600
 601            /// <summary>
 602            /// Create the Share.CreateAsync response or throw a failure exception.
 603            /// </summary>
 604            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 605            /// <param name="response">The raw Response.</param>
 606            /// <returns>The Share.CreateAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}.</returns>
 607            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo> CreateAsync_CreateResponse(
 608                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 609                Azure.Response response)
 610            {
 611                // Process the response
 447612                switch (response.Status)
 613                {
 614                    case 201:
 615                    {
 616                        // Create the result
 439617                        Azure.Storage.Files.Shares.Models.ShareInfo _value = new Azure.Storage.Files.Shares.Models.Share
 618
 619                        // Get response headers
 620                        string _header;
 439621                        if (response.Headers.TryGetValue("ETag", out _header))
 622                        {
 439623                            _value.ETag = new Azure.ETag(_header);
 624                        }
 439625                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 626                        {
 439627                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 628                        }
 629
 630                        // Create the response
 439631                        return Response.FromValue(_value, response);
 632                    }
 633                    default:
 634                    {
 635                        // Create the result
 8636                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 8637                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 638
 8639                        throw _value.CreateException(clientDiagnostics, response);
 640                    }
 641                }
 642            }
 643            #endregion Share.CreateAsync
 644
 645            #region Share.GetPropertiesAsync
 646            /// <summary>
 647            /// Returns all user-defined metadata and system properties for the specified share or share snapshot. The d
 648            /// </summary>
 649            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 650            /// <param name="pipeline">The pipeline used for sending requests.</param>
 651            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 652            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 653            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 654            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 655            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 656            /// <param name="operationName">Operation name.</param>
 657            /// <param name="cancellationToken">Cancellation token.</param>
 658            /// <returns>Properties of a share.</returns>
 659            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareP
 660                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 661                Azure.Core.Pipeline.HttpPipeline pipeline,
 662                System.Uri resourceUri,
 663                string version,
 664                string sharesnapshot = default,
 665                int? timeout = default,
 666                bool async = true,
 667                string operationName = "ShareClient.GetProperties",
 668                System.Threading.CancellationToken cancellationToken = default)
 669            {
 36670                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 671                try
 672                {
 36673                    _scope.AddAttribute("url", resourceUri);
 36674                    _scope.Start();
 36675                    using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage(
 36676                        pipeline,
 36677                        resourceUri,
 36678                        version,
 36679                        sharesnapshot,
 36680                        timeout))
 681                    {
 36682                        if (async)
 683                        {
 684                            // Send the request asynchronously if we're being called via an async path
 21685                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 686                        }
 687                        else
 688                        {
 689                            // Send the request synchronously through the API that blocks if we're being called via a sy
 690                            // (this is safe because the Task will complete before the user can call Wait)
 15691                            pipeline.Send(_message, cancellationToken);
 692                        }
 36693                        Azure.Response _response = _message.Response;
 36694                        cancellationToken.ThrowIfCancellationRequested();
 36695                        return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response);
 696                    }
 697                }
 14698                catch (System.Exception ex)
 699                {
 14700                    _scope.Failed(ex);
 14701                    throw;
 702                }
 703                finally
 704                {
 36705                    _scope.Dispose();
 706                }
 22707            }
 708
 709            /// <summary>
 710            /// Create the Share.GetPropertiesAsync request.
 711            /// </summary>
 712            /// <param name="pipeline">The pipeline used for sending requests.</param>
 713            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 714            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 715            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 716            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 717            /// <returns>The Share.GetPropertiesAsync Message.</returns>
 718            internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage(
 719                Azure.Core.Pipeline.HttpPipeline pipeline,
 720                System.Uri resourceUri,
 721                string version,
 722                string sharesnapshot = default,
 723                int? timeout = default)
 724            {
 725                // Validation
 36726                if (resourceUri == null)
 727                {
 0728                    throw new System.ArgumentNullException(nameof(resourceUri));
 729                }
 36730                if (version == null)
 731                {
 0732                    throw new System.ArgumentNullException(nameof(version));
 733                }
 734
 735                // Create the request
 36736                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 36737                Azure.Core.Request _request = _message.Request;
 738
 739                // Set the endpoint
 36740                _request.Method = Azure.Core.RequestMethod.Get;
 36741                _request.Uri.Reset(resourceUri);
 36742                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 0743                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 0744                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 745
 746                // Add request headers
 36747                _request.Headers.SetValue("x-ms-version", version);
 748
 36749                return _message;
 750            }
 751
 752            /// <summary>
 753            /// Create the Share.GetPropertiesAsync response or throw a failure exception.
 754            /// </summary>
 755            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 756            /// <param name="response">The raw Response.</param>
 757            /// <returns>The Share.GetPropertiesAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareProperties}.
 758            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareProperties> GetPropertiesAsync_CreateR
 759                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 760                Azure.Response response)
 761            {
 762                // Process the response
 36763                switch (response.Status)
 764                {
 765                    case 200:
 766                    {
 767                        // Create the result
 22768                        Azure.Storage.Files.Shares.Models.ShareProperties _value = new Azure.Storage.Files.Shares.Models
 769
 770                        // Get response headers
 771                        string _header;
 22772                        _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringCompare
 640773                        foreach (Azure.Core.HttpHeader _headerPair in response.Headers)
 774                        {
 298775                            if (_headerPair.Name.StartsWith("x-ms-meta-", System.StringComparison.InvariantCulture))
 776                            {
 16777                                _value.Metadata[_headerPair.Name.Substring(10)] = _headerPair.Value;
 778                            }
 779                        }
 22780                        if (response.Headers.TryGetValue("ETag", out _header))
 781                        {
 22782                            _value.ETag = new Azure.ETag(_header);
 783                        }
 22784                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 785                        {
 22786                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 787                        }
 22788                        if (response.Headers.TryGetValue("x-ms-share-quota", out _header))
 789                        {
 22790                            _value.QuotaInGB = int.Parse(_header, System.Globalization.CultureInfo.InvariantCulture);
 791                        }
 22792                        if (response.Headers.TryGetValue("x-ms-share-provisioned-iops", out _header))
 793                        {
 0794                            _value.ProvisionedIops = int.Parse(_header, System.Globalization.CultureInfo.InvariantCultur
 795                        }
 22796                        if (response.Headers.TryGetValue("x-ms-share-provisioned-ingress-mbps", out _header))
 797                        {
 0798                            _value.ProvisionedIngressMBps = int.Parse(_header, System.Globalization.CultureInfo.Invarian
 799                        }
 22800                        if (response.Headers.TryGetValue("x-ms-share-provisioned-egress-mbps", out _header))
 801                        {
 0802                            _value.ProvisionedEgressMBps = int.Parse(_header, System.Globalization.CultureInfo.Invariant
 803                        }
 22804                        if (response.Headers.TryGetValue("x-ms-share-next-allowed-quota-downgrade-time", out _header))
 805                        {
 0806                            _value.NextAllowedQuotaDowngradeTime = System.DateTimeOffset.Parse(_header, System.Globaliza
 807                        }
 808
 809                        // Create the response
 22810                        return Response.FromValue(_value, response);
 811                    }
 812                    case 304:
 813                    {
 0814                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.ShareProperties>(response);
 815                    }
 816                    default:
 817                    {
 818                        // Create the result
 14819                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 14820                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 821
 14822                        throw _value.CreateException(clientDiagnostics, response);
 823                    }
 824                }
 825            }
 826            #endregion Share.GetPropertiesAsync
 827
 828            #region Share.DeleteAsync
 829            /// <summary>
 830            /// Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any 
 831            /// </summary>
 832            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 833            /// <param name="pipeline">The pipeline used for sending requests.</param>
 834            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 835            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 836            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 837            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 838            /// <param name="deleteSnapshots">Specifies the option include to delete the base share and all of its snaps
 839            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 840            /// <param name="operationName">Operation name.</param>
 841            /// <param name="cancellationToken">Cancellation token.</param>
 842            /// <returns>Azure.Response</returns>
 843            public static async System.Threading.Tasks.ValueTask<Azure.Response> DeleteAsync(
 844                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 845                Azure.Core.Pipeline.HttpPipeline pipeline,
 846                System.Uri resourceUri,
 847                string version,
 848                string sharesnapshot = default,
 849                int? timeout = default,
 850                Azure.Storage.Files.Shares.Models.DeleteSnapshotsOptionType? deleteSnapshots = default,
 851                bool async = true,
 852                string operationName = "ShareClient.Delete",
 853                System.Threading.CancellationToken cancellationToken = default)
 854            {
 451855                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 856                try
 857                {
 451858                    _scope.AddAttribute("url", resourceUri);
 451859                    _scope.Start();
 451860                    using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage(
 451861                        pipeline,
 451862                        resourceUri,
 451863                        version,
 451864                        sharesnapshot,
 451865                        timeout,
 451866                        deleteSnapshots))
 867                    {
 451868                        if (async)
 869                        {
 870                            // Send the request asynchronously if we're being called via an async path
 226871                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 872                        }
 873                        else
 874                        {
 875                            // Send the request synchronously through the API that blocks if we're being called via a sy
 876                            // (this is safe because the Task will complete before the user can call Wait)
 225877                            pipeline.Send(_message, cancellationToken);
 878                        }
 449879                        Azure.Response _response = _message.Response;
 449880                        cancellationToken.ThrowIfCancellationRequested();
 449881                        return DeleteAsync_CreateResponse(clientDiagnostics, _response);
 882                    }
 883                }
 10884                catch (System.Exception ex)
 885                {
 10886                    _scope.Failed(ex);
 10887                    throw;
 888                }
 889                finally
 890                {
 451891                    _scope.Dispose();
 892                }
 441893            }
 894
 895            /// <summary>
 896            /// Create the Share.DeleteAsync request.
 897            /// </summary>
 898            /// <param name="pipeline">The pipeline used for sending requests.</param>
 899            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 900            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 901            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 902            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 903            /// <param name="deleteSnapshots">Specifies the option include to delete the base share and all of its snaps
 904            /// <returns>The Share.DeleteAsync Message.</returns>
 905            internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage(
 906                Azure.Core.Pipeline.HttpPipeline pipeline,
 907                System.Uri resourceUri,
 908                string version,
 909                string sharesnapshot = default,
 910                int? timeout = default,
 911                Azure.Storage.Files.Shares.Models.DeleteSnapshotsOptionType? deleteSnapshots = default)
 912            {
 913                // Validation
 451914                if (resourceUri == null)
 915                {
 0916                    throw new System.ArgumentNullException(nameof(resourceUri));
 917                }
 451918                if (version == null)
 919                {
 0920                    throw new System.ArgumentNullException(nameof(version));
 921                }
 922
 923                // Create the request
 451924                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 451925                Azure.Core.Request _request = _message.Request;
 926
 927                // Set the endpoint
 451928                _request.Method = Azure.Core.RequestMethod.Delete;
 451929                _request.Uri.Reset(resourceUri);
 451930                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 0931                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 0932                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 933
 934                // Add request headers
 451935                _request.Headers.SetValue("x-ms-version", version);
 884936                if (deleteSnapshots != null) { _request.Headers.SetValue("x-ms-delete-snapshots", Azure.Storage.Files.Sh
 937
 451938                return _message;
 939            }
 940
 941            /// <summary>
 942            /// Create the Share.DeleteAsync response or throw a failure exception.
 943            /// </summary>
 944            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 945            /// <param name="response">The raw Response.</param>
 946            /// <returns>The Share.DeleteAsync Azure.Response.</returns>
 947            internal static Azure.Response DeleteAsync_CreateResponse(
 948                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 949                Azure.Response response)
 950            {
 951                // Process the response
 449952                switch (response.Status)
 953                {
 954                    case 202:
 955                    {
 441956                        return response;
 957                    }
 958                    default:
 959                    {
 960                        // Create the result
 8961                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 8962                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 963
 8964                        throw _value.CreateException(clientDiagnostics, response);
 965                    }
 966                }
 967            }
 968            #endregion Share.DeleteAsync
 969
 970            #region Share.CreateSnapshotAsync
 971            /// <summary>
 972            /// Creates a read-only snapshot of a share.
 973            /// </summary>
 974            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 975            /// <param name="pipeline">The pipeline used for sending requests.</param>
 976            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 977            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 978            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 979            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 980            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 981            /// <param name="operationName">Operation name.</param>
 982            /// <param name="cancellationToken">Cancellation token.</param>
 983            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareSnapshotInfo}</returns>
 984            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareS
 985                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 986                Azure.Core.Pipeline.HttpPipeline pipeline,
 987                System.Uri resourceUri,
 988                string version,
 989                int? timeout = default,
 990                System.Collections.Generic.IDictionary<string, string> metadata = default,
 991                bool async = true,
 992                string operationName = "ShareClient.CreateSnapshot",
 993                System.Threading.CancellationToken cancellationToken = default)
 994            {
 12995                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 996                try
 997                {
 12998                    _scope.AddAttribute("url", resourceUri);
 12999                    _scope.Start();
 121000                    using (Azure.Core.HttpMessage _message = CreateSnapshotAsync_CreateMessage(
 121001                        pipeline,
 121002                        resourceUri,
 121003                        version,
 121004                        timeout,
 121005                        metadata))
 1006                    {
 121007                        if (async)
 1008                        {
 1009                            // Send the request asynchronously if we're being called via an async path
 61010                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 1011                        }
 1012                        else
 1013                        {
 1014                            // Send the request synchronously through the API that blocks if we're being called via a sy
 1015                            // (this is safe because the Task will complete before the user can call Wait)
 61016                            pipeline.Send(_message, cancellationToken);
 1017                        }
 121018                        Azure.Response _response = _message.Response;
 121019                        cancellationToken.ThrowIfCancellationRequested();
 121020                        return CreateSnapshotAsync_CreateResponse(clientDiagnostics, _response);
 1021                    }
 1022                }
 21023                catch (System.Exception ex)
 1024                {
 21025                    _scope.Failed(ex);
 21026                    throw;
 1027                }
 1028                finally
 1029                {
 121030                    _scope.Dispose();
 1031                }
 101032            }
 1033
 1034            /// <summary>
 1035            /// Create the Share.CreateSnapshotAsync request.
 1036            /// </summary>
 1037            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1038            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1039            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1040            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1041            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 1042            /// <returns>The Share.CreateSnapshotAsync Message.</returns>
 1043            internal static Azure.Core.HttpMessage CreateSnapshotAsync_CreateMessage(
 1044                Azure.Core.Pipeline.HttpPipeline pipeline,
 1045                System.Uri resourceUri,
 1046                string version,
 1047                int? timeout = default,
 1048                System.Collections.Generic.IDictionary<string, string> metadata = default)
 1049            {
 1050                // Validation
 121051                if (resourceUri == null)
 1052                {
 01053                    throw new System.ArgumentNullException(nameof(resourceUri));
 1054                }
 121055                if (version == null)
 1056                {
 01057                    throw new System.ArgumentNullException(nameof(version));
 1058                }
 1059
 1060                // Create the request
 121061                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 121062                Azure.Core.Request _request = _message.Request;
 1063
 1064                // Set the endpoint
 121065                _request.Method = Azure.Core.RequestMethod.Put;
 121066                _request.Uri.Reset(resourceUri);
 121067                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 121068                _request.Uri.AppendQuery("comp", "snapshot", escapeValue: false);
 01069                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 1070
 1071                // Add request headers
 121072                _request.Headers.SetValue("x-ms-version", version);
 121073                if (metadata != null) {
 01074                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 1075                    {
 01076                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 1077                    }
 1078                }
 1079
 121080                return _message;
 1081            }
 1082
 1083            /// <summary>
 1084            /// Create the Share.CreateSnapshotAsync response or throw a failure exception.
 1085            /// </summary>
 1086            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 1087            /// <param name="response">The raw Response.</param>
 1088            /// <returns>The Share.CreateSnapshotAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareSnapshotInf
 1089            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareSnapshotInfo> CreateSnapshotAsync_Crea
 1090                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1091                Azure.Response response)
 1092            {
 1093                // Process the response
 121094                switch (response.Status)
 1095                {
 1096                    case 201:
 1097                    {
 1098                        // Create the result
 101099                        Azure.Storage.Files.Shares.Models.ShareSnapshotInfo _value = new Azure.Storage.Files.Shares.Mode
 1100
 1101                        // Get response headers
 1102                        string _header;
 101103                        if (response.Headers.TryGetValue("x-ms-snapshot", out _header))
 1104                        {
 101105                            _value.Snapshot = _header;
 1106                        }
 101107                        if (response.Headers.TryGetValue("ETag", out _header))
 1108                        {
 101109                            _value.ETag = new Azure.ETag(_header);
 1110                        }
 101111                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 1112                        {
 101113                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 1114                        }
 1115
 1116                        // Create the response
 101117                        return Response.FromValue(_value, response);
 1118                    }
 1119                    default:
 1120                    {
 1121                        // Create the result
 21122                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 21123                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 1124
 21125                        throw _value.CreateException(clientDiagnostics, response);
 1126                    }
 1127                }
 1128            }
 1129            #endregion Share.CreateSnapshotAsync
 1130
 1131            #region Share.CreatePermissionAsync
 1132            /// <summary>
 1133            /// Create a permission (a security descriptor).
 1134            /// </summary>
 1135            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 1136            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1137            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1138            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1139            /// <param name="sharePermissionJson">A permission (a security descriptor) at the share level.</param>
 1140            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1141            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 1142            /// <param name="operationName">Operation name.</param>
 1143            /// <param name="cancellationToken">Cancellation token.</param>
 1144            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.PermissionInfo}</returns>
 1145            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.Permis
 1146                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1147                Azure.Core.Pipeline.HttpPipeline pipeline,
 1148                System.Uri resourceUri,
 1149                string version,
 1150                string sharePermissionJson,
 1151                int? timeout = default,
 1152                bool async = true,
 1153                string operationName = "ShareClient.CreatePermission",
 1154                System.Threading.CancellationToken cancellationToken = default)
 1155            {
 141156                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 1157                try
 1158                {
 141159                    _scope.AddAttribute("url", resourceUri);
 141160                    _scope.Start();
 141161                    using (Azure.Core.HttpMessage _message = CreatePermissionAsync_CreateMessage(
 141162                        pipeline,
 141163                        resourceUri,
 141164                        version,
 141165                        sharePermissionJson,
 141166                        timeout))
 1167                    {
 141168                        if (async)
 1169                        {
 1170                            // Send the request asynchronously if we're being called via an async path
 71171                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 1172                        }
 1173                        else
 1174                        {
 1175                            // Send the request synchronously through the API that blocks if we're being called via a sy
 1176                            // (this is safe because the Task will complete before the user can call Wait)
 71177                            pipeline.Send(_message, cancellationToken);
 1178                        }
 141179                        Azure.Response _response = _message.Response;
 141180                        cancellationToken.ThrowIfCancellationRequested();
 141181                        return CreatePermissionAsync_CreateResponse(clientDiagnostics, _response);
 1182                    }
 1183                }
 21184                catch (System.Exception ex)
 1185                {
 21186                    _scope.Failed(ex);
 21187                    throw;
 1188                }
 1189                finally
 1190                {
 141191                    _scope.Dispose();
 1192                }
 121193            }
 1194
 1195            /// <summary>
 1196            /// Create the Share.CreatePermissionAsync request.
 1197            /// </summary>
 1198            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1199            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1200            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1201            /// <param name="sharePermissionJson">A permission (a security descriptor) at the share level.</param>
 1202            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1203            /// <returns>The Share.CreatePermissionAsync Message.</returns>
 1204            internal static Azure.Core.HttpMessage CreatePermissionAsync_CreateMessage(
 1205                Azure.Core.Pipeline.HttpPipeline pipeline,
 1206                System.Uri resourceUri,
 1207                string version,
 1208                string sharePermissionJson,
 1209                int? timeout = default)
 1210            {
 1211                // Validation
 141212                if (resourceUri == null)
 1213                {
 01214                    throw new System.ArgumentNullException(nameof(resourceUri));
 1215                }
 141216                if (version == null)
 1217                {
 01218                    throw new System.ArgumentNullException(nameof(version));
 1219                }
 141220                if (sharePermissionJson == null)
 1221                {
 01222                    throw new System.ArgumentNullException(nameof(sharePermissionJson));
 1223                }
 1224
 1225                // Create the request
 141226                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 141227                Azure.Core.Request _request = _message.Request;
 1228
 1229                // Set the endpoint
 141230                _request.Method = Azure.Core.RequestMethod.Put;
 141231                _request.Uri.Reset(resourceUri);
 141232                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 141233                _request.Uri.AppendQuery("comp", "filepermission", escapeValue: false);
 01234                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 1235
 1236                // Add request headers
 141237                _request.Headers.SetValue("x-ms-version", version);
 1238
 1239                // Create the body
 141240                string _text = sharePermissionJson;
 141241                _request.Headers.SetValue("Content-Type", "application/json");
 141242                _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.Invar
 141243                _request.Content = Azure.Core.RequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text));
 1244
 141245                return _message;
 1246            }
 1247
 1248            /// <summary>
 1249            /// Create the Share.CreatePermissionAsync response or throw a failure exception.
 1250            /// </summary>
 1251            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 1252            /// <param name="response">The raw Response.</param>
 1253            /// <returns>The Share.CreatePermissionAsync Azure.Response{Azure.Storage.Files.Shares.Models.PermissionInfo
 1254            internal static Azure.Response<Azure.Storage.Files.Shares.Models.PermissionInfo> CreatePermissionAsync_Creat
 1255                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1256                Azure.Response response)
 1257            {
 1258                // Process the response
 141259                switch (response.Status)
 1260                {
 1261                    case 201:
 1262                    {
 1263                        // Create the result
 121264                        Azure.Storage.Files.Shares.Models.PermissionInfo _value = new Azure.Storage.Files.Shares.Models.
 1265
 1266                        // Get response headers
 1267                        string _header;
 121268                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 1269                        {
 121270                            _value.FilePermissionKey = _header;
 1271                        }
 1272
 1273                        // Create the response
 121274                        return Response.FromValue(_value, response);
 1275                    }
 1276                    default:
 1277                    {
 1278                        // Create the result
 21279                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 21280                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 1281
 21282                        throw _value.CreateException(clientDiagnostics, response);
 1283                    }
 1284                }
 1285            }
 1286            #endregion Share.CreatePermissionAsync
 1287
 1288            #region Share.GetPermissionAsync
 1289            /// <summary>
 1290            /// Returns the permission (security descriptor) for a given key
 1291            /// </summary>
 1292            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 1293            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1294            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1295            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file.</param>
 1296            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1297            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1298            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 1299            /// <param name="operationName">Operation name.</param>
 1300            /// <param name="cancellationToken">Cancellation token.</param>
 1301            /// <returns>A permission (a security descriptor) at the share level.</returns>
 1302            public static async System.Threading.Tasks.ValueTask<Azure.Response<string>> GetPermissionAsync(
 1303                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1304                Azure.Core.Pipeline.HttpPipeline pipeline,
 1305                System.Uri resourceUri,
 1306                string filePermissionKey,
 1307                string version,
 1308                int? timeout = default,
 1309                bool async = true,
 1310                string operationName = "ShareClient.GetPermission",
 1311                System.Threading.CancellationToken cancellationToken = default)
 1312            {
 41313                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 1314                try
 1315                {
 41316                    _scope.AddAttribute("url", resourceUri);
 41317                    _scope.Start();
 41318                    using (Azure.Core.HttpMessage _message = GetPermissionAsync_CreateMessage(
 41319                        pipeline,
 41320                        resourceUri,
 41321                        filePermissionKey,
 41322                        version,
 41323                        timeout))
 1324                    {
 41325                        if (async)
 1326                        {
 1327                            // Send the request asynchronously if we're being called via an async path
 21328                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 1329                        }
 1330                        else
 1331                        {
 1332                            // Send the request synchronously through the API that blocks if we're being called via a sy
 1333                            // (this is safe because the Task will complete before the user can call Wait)
 21334                            pipeline.Send(_message, cancellationToken);
 1335                        }
 41336                        Azure.Response _response = _message.Response;
 41337                        cancellationToken.ThrowIfCancellationRequested();
 41338                        return GetPermissionAsync_CreateResponse(clientDiagnostics, _response);
 1339                    }
 1340                }
 21341                catch (System.Exception ex)
 1342                {
 21343                    _scope.Failed(ex);
 21344                    throw;
 1345                }
 1346                finally
 1347                {
 41348                    _scope.Dispose();
 1349                }
 21350            }
 1351
 1352            /// <summary>
 1353            /// Create the Share.GetPermissionAsync request.
 1354            /// </summary>
 1355            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1356            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1357            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file.</param>
 1358            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1359            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1360            /// <returns>The Share.GetPermissionAsync Message.</returns>
 1361            internal static Azure.Core.HttpMessage GetPermissionAsync_CreateMessage(
 1362                Azure.Core.Pipeline.HttpPipeline pipeline,
 1363                System.Uri resourceUri,
 1364                string filePermissionKey,
 1365                string version,
 1366                int? timeout = default)
 1367            {
 1368                // Validation
 41369                if (resourceUri == null)
 1370                {
 01371                    throw new System.ArgumentNullException(nameof(resourceUri));
 1372                }
 41373                if (filePermissionKey == null)
 1374                {
 01375                    throw new System.ArgumentNullException(nameof(filePermissionKey));
 1376                }
 41377                if (version == null)
 1378                {
 01379                    throw new System.ArgumentNullException(nameof(version));
 1380                }
 1381
 1382                // Create the request
 41383                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 41384                Azure.Core.Request _request = _message.Request;
 1385
 1386                // Set the endpoint
 41387                _request.Method = Azure.Core.RequestMethod.Get;
 41388                _request.Uri.Reset(resourceUri);
 41389                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 41390                _request.Uri.AppendQuery("comp", "filepermission", escapeValue: false);
 01391                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 1392
 1393                // Add request headers
 41394                _request.Headers.SetValue("x-ms-file-permission-key", filePermissionKey);
 41395                _request.Headers.SetValue("x-ms-version", version);
 1396
 41397                return _message;
 1398            }
 1399
 1400            /// <summary>
 1401            /// Create the Share.GetPermissionAsync response or throw a failure exception.
 1402            /// </summary>
 1403            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 1404            /// <param name="response">The raw Response.</param>
 1405            /// <returns>The Share.GetPermissionAsync Azure.Response{string}.</returns>
 1406            internal static Azure.Response<string> GetPermissionAsync_CreateResponse(
 1407                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1408                Azure.Response response)
 1409            {
 1410                // Process the response
 41411                switch (response.Status)
 1412                {
 1413                    case 200:
 1414                    {
 1415                        // Create the result
 1416                        string _value;
 21417                        using (System.IO.StreamReader _streamReader = new System.IO.StreamReader(response.ContentStream)
 1418                        {
 21419                            _value = _streamReader.ReadToEnd();
 21420                        }
 1421
 1422                        // Create the response
 21423                        return Response.FromValue(_value, response);
 1424                    }
 1425                    case 304:
 1426                    {
 01427                        return new Azure.NoBodyResponse<string>(response);
 1428                    }
 1429                    default:
 1430                    {
 1431                        // Create the result
 21432                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 21433                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 1434
 21435                        throw _value.CreateException(clientDiagnostics, response);
 1436                    }
 1437                }
 1438            }
 1439            #endregion Share.GetPermissionAsync
 1440
 1441            #region Share.SetQuotaAsync
 1442            /// <summary>
 1443            /// Sets quota for the specified share.
 1444            /// </summary>
 1445            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 1446            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1447            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1448            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1449            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1450            /// <param name="quotaInGB">Specifies the maximum size of the share, in gigabytes.</param>
 1451            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 1452            /// <param name="operationName">Operation name.</param>
 1453            /// <param name="cancellationToken">Cancellation token.</param>
 1454            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}</returns>
 1455            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareI
 1456                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1457                Azure.Core.Pipeline.HttpPipeline pipeline,
 1458                System.Uri resourceUri,
 1459                string version,
 1460                int? timeout = default,
 1461                int? quotaInGB = default,
 1462                bool async = true,
 1463                string operationName = "ShareClient.SetQuota",
 1464                System.Threading.CancellationToken cancellationToken = default)
 1465            {
 41466                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 1467                try
 1468                {
 41469                    _scope.AddAttribute("url", resourceUri);
 41470                    _scope.Start();
 41471                    using (Azure.Core.HttpMessage _message = SetQuotaAsync_CreateMessage(
 41472                        pipeline,
 41473                        resourceUri,
 41474                        version,
 41475                        timeout,
 41476                        quotaInGB))
 1477                    {
 41478                        if (async)
 1479                        {
 1480                            // Send the request asynchronously if we're being called via an async path
 21481                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 1482                        }
 1483                        else
 1484                        {
 1485                            // Send the request synchronously through the API that blocks if we're being called via a sy
 1486                            // (this is safe because the Task will complete before the user can call Wait)
 21487                            pipeline.Send(_message, cancellationToken);
 1488                        }
 41489                        Azure.Response _response = _message.Response;
 41490                        cancellationToken.ThrowIfCancellationRequested();
 41491                        return SetQuotaAsync_CreateResponse(clientDiagnostics, _response);
 1492                    }
 1493                }
 21494                catch (System.Exception ex)
 1495                {
 21496                    _scope.Failed(ex);
 21497                    throw;
 1498                }
 1499                finally
 1500                {
 41501                    _scope.Dispose();
 1502                }
 21503            }
 1504
 1505            /// <summary>
 1506            /// Create the Share.SetQuotaAsync request.
 1507            /// </summary>
 1508            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1509            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1510            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1511            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1512            /// <param name="quotaInGB">Specifies the maximum size of the share, in gigabytes.</param>
 1513            /// <returns>The Share.SetQuotaAsync Message.</returns>
 1514            internal static Azure.Core.HttpMessage SetQuotaAsync_CreateMessage(
 1515                Azure.Core.Pipeline.HttpPipeline pipeline,
 1516                System.Uri resourceUri,
 1517                string version,
 1518                int? timeout = default,
 1519                int? quotaInGB = default)
 1520            {
 1521                // Validation
 41522                if (resourceUri == null)
 1523                {
 01524                    throw new System.ArgumentNullException(nameof(resourceUri));
 1525                }
 41526                if (version == null)
 1527                {
 01528                    throw new System.ArgumentNullException(nameof(version));
 1529                }
 1530
 1531                // Create the request
 41532                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 41533                Azure.Core.Request _request = _message.Request;
 1534
 1535                // Set the endpoint
 41536                _request.Method = Azure.Core.RequestMethod.Put;
 41537                _request.Uri.Reset(resourceUri);
 41538                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 41539                _request.Uri.AppendQuery("comp", "properties", escapeValue: false);
 01540                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 1541
 1542                // Add request headers
 41543                _request.Headers.SetValue("x-ms-version", version);
 81544                if (quotaInGB != null) { _request.Headers.SetValue("x-ms-share-quota", quotaInGB.Value.ToString(System.G
 1545
 41546                return _message;
 1547            }
 1548
 1549            /// <summary>
 1550            /// Create the Share.SetQuotaAsync response or throw a failure exception.
 1551            /// </summary>
 1552            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 1553            /// <param name="response">The raw Response.</param>
 1554            /// <returns>The Share.SetQuotaAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}.</returns>
 1555            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo> SetQuotaAsync_CreateResponse(
 1556                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1557                Azure.Response response)
 1558            {
 1559                // Process the response
 41560                switch (response.Status)
 1561                {
 1562                    case 200:
 1563                    {
 1564                        // Create the result
 21565                        Azure.Storage.Files.Shares.Models.ShareInfo _value = new Azure.Storage.Files.Shares.Models.Share
 1566
 1567                        // Get response headers
 1568                        string _header;
 21569                        if (response.Headers.TryGetValue("ETag", out _header))
 1570                        {
 21571                            _value.ETag = new Azure.ETag(_header);
 1572                        }
 21573                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 1574                        {
 21575                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 1576                        }
 1577
 1578                        // Create the response
 21579                        return Response.FromValue(_value, response);
 1580                    }
 1581                    default:
 1582                    {
 1583                        // Create the result
 21584                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 21585                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 1586
 21587                        throw _value.CreateException(clientDiagnostics, response);
 1588                    }
 1589                }
 1590            }
 1591            #endregion Share.SetQuotaAsync
 1592
 1593            #region Share.SetMetadataAsync
 1594            /// <summary>
 1595            /// Sets one or more user-defined name-value pairs for the specified share.
 1596            /// </summary>
 1597            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 1598            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1599            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1600            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1601            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1602            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 1603            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 1604            /// <param name="operationName">Operation name.</param>
 1605            /// <param name="cancellationToken">Cancellation token.</param>
 1606            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}</returns>
 1607            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareI
 1608                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1609                Azure.Core.Pipeline.HttpPipeline pipeline,
 1610                System.Uri resourceUri,
 1611                string version,
 1612                int? timeout = default,
 1613                System.Collections.Generic.IDictionary<string, string> metadata = default,
 1614                bool async = true,
 1615                string operationName = "ShareClient.SetMetadata",
 1616                System.Threading.CancellationToken cancellationToken = default)
 1617            {
 41618                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 1619                try
 1620                {
 41621                    _scope.AddAttribute("url", resourceUri);
 41622                    _scope.Start();
 41623                    using (Azure.Core.HttpMessage _message = SetMetadataAsync_CreateMessage(
 41624                        pipeline,
 41625                        resourceUri,
 41626                        version,
 41627                        timeout,
 41628                        metadata))
 1629                    {
 41630                        if (async)
 1631                        {
 1632                            // Send the request asynchronously if we're being called via an async path
 21633                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 1634                        }
 1635                        else
 1636                        {
 1637                            // Send the request synchronously through the API that blocks if we're being called via a sy
 1638                            // (this is safe because the Task will complete before the user can call Wait)
 21639                            pipeline.Send(_message, cancellationToken);
 1640                        }
 41641                        Azure.Response _response = _message.Response;
 41642                        cancellationToken.ThrowIfCancellationRequested();
 41643                        return SetMetadataAsync_CreateResponse(clientDiagnostics, _response);
 1644                    }
 1645                }
 21646                catch (System.Exception ex)
 1647                {
 21648                    _scope.Failed(ex);
 21649                    throw;
 1650                }
 1651                finally
 1652                {
 41653                    _scope.Dispose();
 1654                }
 21655            }
 1656
 1657            /// <summary>
 1658            /// Create the Share.SetMetadataAsync request.
 1659            /// </summary>
 1660            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1661            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1662            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1663            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1664            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 1665            /// <returns>The Share.SetMetadataAsync Message.</returns>
 1666            internal static Azure.Core.HttpMessage SetMetadataAsync_CreateMessage(
 1667                Azure.Core.Pipeline.HttpPipeline pipeline,
 1668                System.Uri resourceUri,
 1669                string version,
 1670                int? timeout = default,
 1671                System.Collections.Generic.IDictionary<string, string> metadata = default)
 1672            {
 1673                // Validation
 41674                if (resourceUri == null)
 1675                {
 01676                    throw new System.ArgumentNullException(nameof(resourceUri));
 1677                }
 41678                if (version == null)
 1679                {
 01680                    throw new System.ArgumentNullException(nameof(version));
 1681                }
 1682
 1683                // Create the request
 41684                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 41685                Azure.Core.Request _request = _message.Request;
 1686
 1687                // Set the endpoint
 41688                _request.Method = Azure.Core.RequestMethod.Put;
 41689                _request.Uri.Reset(resourceUri);
 41690                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 41691                _request.Uri.AppendQuery("comp", "metadata", escapeValue: false);
 01692                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 1693
 1694                // Add request headers
 41695                _request.Headers.SetValue("x-ms-version", version);
 41696                if (metadata != null) {
 401697                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 1698                    {
 161699                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 1700                    }
 1701                }
 1702
 41703                return _message;
 1704            }
 1705
 1706            /// <summary>
 1707            /// Create the Share.SetMetadataAsync response or throw a failure exception.
 1708            /// </summary>
 1709            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 1710            /// <param name="response">The raw Response.</param>
 1711            /// <returns>The Share.SetMetadataAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}.</return
 1712            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo> SetMetadataAsync_CreateResponse(
 1713                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1714                Azure.Response response)
 1715            {
 1716                // Process the response
 41717                switch (response.Status)
 1718                {
 1719                    case 200:
 1720                    {
 1721                        // Create the result
 21722                        Azure.Storage.Files.Shares.Models.ShareInfo _value = new Azure.Storage.Files.Shares.Models.Share
 1723
 1724                        // Get response headers
 1725                        string _header;
 21726                        if (response.Headers.TryGetValue("ETag", out _header))
 1727                        {
 21728                            _value.ETag = new Azure.ETag(_header);
 1729                        }
 21730                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 1731                        {
 21732                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 1733                        }
 1734
 1735                        // Create the response
 21736                        return Response.FromValue(_value, response);
 1737                    }
 1738                    default:
 1739                    {
 1740                        // Create the result
 21741                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 21742                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 1743
 21744                        throw _value.CreateException(clientDiagnostics, response);
 1745                    }
 1746                }
 1747            }
 1748            #endregion Share.SetMetadataAsync
 1749
 1750            #region Share.GetAccessPolicyAsync
 1751            /// <summary>
 1752            /// Returns information about stored access policies specified on the share.
 1753            /// </summary>
 1754            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 1755            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1756            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1757            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1758            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1759            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 1760            /// <param name="operationName">Operation name.</param>
 1761            /// <param name="cancellationToken">Cancellation token.</param>
 1762            /// <returns>A collection of signed identifiers.</returns>
 1763            public static async System.Threading.Tasks.ValueTask<Azure.Response<System.Collections.Generic.IEnumerable<A
 1764                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1765                Azure.Core.Pipeline.HttpPipeline pipeline,
 1766                System.Uri resourceUri,
 1767                string version,
 1768                int? timeout = default,
 1769                bool async = true,
 1770                string operationName = "ShareClient.GetAccessPolicy",
 1771                System.Threading.CancellationToken cancellationToken = default)
 1772            {
 101773                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 1774                try
 1775                {
 101776                    _scope.AddAttribute("url", resourceUri);
 101777                    _scope.Start();
 101778                    using (Azure.Core.HttpMessage _message = GetAccessPolicyAsync_CreateMessage(
 101779                        pipeline,
 101780                        resourceUri,
 101781                        version,
 101782                        timeout))
 1783                    {
 101784                        if (async)
 1785                        {
 1786                            // Send the request asynchronously if we're being called via an async path
 51787                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 1788                        }
 1789                        else
 1790                        {
 1791                            // Send the request synchronously through the API that blocks if we're being called via a sy
 1792                            // (this is safe because the Task will complete before the user can call Wait)
 51793                            pipeline.Send(_message, cancellationToken);
 1794                        }
 101795                        Azure.Response _response = _message.Response;
 101796                        cancellationToken.ThrowIfCancellationRequested();
 101797                        return GetAccessPolicyAsync_CreateResponse(clientDiagnostics, _response);
 1798                    }
 1799                }
 21800                catch (System.Exception ex)
 1801                {
 21802                    _scope.Failed(ex);
 21803                    throw;
 1804                }
 1805                finally
 1806                {
 101807                    _scope.Dispose();
 1808                }
 81809            }
 1810
 1811            /// <summary>
 1812            /// Create the Share.GetAccessPolicyAsync request.
 1813            /// </summary>
 1814            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1815            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1816            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1817            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1818            /// <returns>The Share.GetAccessPolicyAsync Message.</returns>
 1819            internal static Azure.Core.HttpMessage GetAccessPolicyAsync_CreateMessage(
 1820                Azure.Core.Pipeline.HttpPipeline pipeline,
 1821                System.Uri resourceUri,
 1822                string version,
 1823                int? timeout = default)
 1824            {
 1825                // Validation
 101826                if (resourceUri == null)
 1827                {
 01828                    throw new System.ArgumentNullException(nameof(resourceUri));
 1829                }
 101830                if (version == null)
 1831                {
 01832                    throw new System.ArgumentNullException(nameof(version));
 1833                }
 1834
 1835                // Create the request
 101836                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 101837                Azure.Core.Request _request = _message.Request;
 1838
 1839                // Set the endpoint
 101840                _request.Method = Azure.Core.RequestMethod.Get;
 101841                _request.Uri.Reset(resourceUri);
 101842                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 101843                _request.Uri.AppendQuery("comp", "acl", escapeValue: false);
 01844                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 1845
 1846                // Add request headers
 101847                _request.Headers.SetValue("x-ms-version", version);
 1848
 101849                return _message;
 1850            }
 1851
 1852            /// <summary>
 1853            /// Create the Share.GetAccessPolicyAsync response or throw a failure exception.
 1854            /// </summary>
 1855            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 1856            /// <param name="response">The raw Response.</param>
 1857            /// <returns>The Share.GetAccessPolicyAsync Azure.Response{System.Collections.Generic.IEnumerable{Azure.Stor
 1858            internal static Azure.Response<System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.Shar
 1859                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1860                Azure.Response response)
 1861            {
 1862                // Process the response
 101863                switch (response.Status)
 1864                {
 1865                    case 200:
 1866                    {
 1867                        // Create the result
 81868                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 81869                        System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ShareSignedIdentifier> 
 81870                            System.Linq.Enumerable.ToList(
 81871                                System.Linq.Enumerable.Select(
 81872                                    _xml.Element(System.Xml.Linq.XName.Get("SignedIdentifiers", "")).Elements(System.Xml
 81873                                    Azure.Storage.Files.Shares.Models.ShareSignedIdentifier.FromXml));
 1874
 1875                        // Create the response
 81876                        return Response.FromValue(_value, response);
 1877                    }
 1878                    case 304:
 1879                    {
 01880                        return new Azure.NoBodyResponse<System.Collections.Generic.IEnumerable<Azure.Storage.Files.Share
 1881                    }
 1882                    default:
 1883                    {
 1884                        // Create the result
 21885                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 21886                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 1887
 21888                        throw _value.CreateException(clientDiagnostics, response);
 1889                    }
 1890                }
 1891            }
 1892            #endregion Share.GetAccessPolicyAsync
 1893
 1894            #region Share.SetAccessPolicyAsync
 1895            /// <summary>
 1896            /// Sets a stored access policy for use with shared access signatures.
 1897            /// </summary>
 1898            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 1899            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1900            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1901            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1902            /// <param name="permissions">The ACL for the share.</param>
 1903            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1904            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 1905            /// <param name="operationName">Operation name.</param>
 1906            /// <param name="cancellationToken">Cancellation token.</param>
 1907            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}</returns>
 1908            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareI
 1909                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 1910                Azure.Core.Pipeline.HttpPipeline pipeline,
 1911                System.Uri resourceUri,
 1912                string version,
 1913                System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ShareSignedIdentifier> permissi
 1914                int? timeout = default,
 1915                bool async = true,
 1916                string operationName = "ShareClient.SetAccessPolicy",
 1917                System.Threading.CancellationToken cancellationToken = default)
 1918            {
 141919                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 1920                try
 1921                {
 141922                    _scope.AddAttribute("url", resourceUri);
 141923                    _scope.Start();
 141924                    using (Azure.Core.HttpMessage _message = SetAccessPolicyAsync_CreateMessage(
 141925                        pipeline,
 141926                        resourceUri,
 141927                        version,
 141928                        permissions,
 141929                        timeout))
 1930                    {
 141931                        if (async)
 1932                        {
 1933                            // Send the request asynchronously if we're being called via an async path
 71934                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 1935                        }
 1936                        else
 1937                        {
 1938                            // Send the request synchronously through the API that blocks if we're being called via a sy
 1939                            // (this is safe because the Task will complete before the user can call Wait)
 71940                            pipeline.Send(_message, cancellationToken);
 1941                        }
 141942                        Azure.Response _response = _message.Response;
 141943                        cancellationToken.ThrowIfCancellationRequested();
 141944                        return SetAccessPolicyAsync_CreateResponse(clientDiagnostics, _response);
 1945                    }
 1946                }
 21947                catch (System.Exception ex)
 1948                {
 21949                    _scope.Failed(ex);
 21950                    throw;
 1951                }
 1952                finally
 1953                {
 141954                    _scope.Dispose();
 1955                }
 121956            }
 1957
 1958            /// <summary>
 1959            /// Create the Share.SetAccessPolicyAsync request.
 1960            /// </summary>
 1961            /// <param name="pipeline">The pipeline used for sending requests.</param>
 1962            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 1963            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 1964            /// <param name="permissions">The ACL for the share.</param>
 1965            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 1966            /// <returns>The Share.SetAccessPolicyAsync Message.</returns>
 1967            internal static Azure.Core.HttpMessage SetAccessPolicyAsync_CreateMessage(
 1968                Azure.Core.Pipeline.HttpPipeline pipeline,
 1969                System.Uri resourceUri,
 1970                string version,
 1971                System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ShareSignedIdentifier> permissi
 1972                int? timeout = default)
 1973            {
 1974                // Validation
 141975                if (resourceUri == null)
 1976                {
 01977                    throw new System.ArgumentNullException(nameof(resourceUri));
 1978                }
 141979                if (version == null)
 1980                {
 01981                    throw new System.ArgumentNullException(nameof(version));
 1982                }
 1983
 1984                // Create the request
 141985                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 141986                Azure.Core.Request _request = _message.Request;
 1987
 1988                // Set the endpoint
 141989                _request.Method = Azure.Core.RequestMethod.Put;
 141990                _request.Uri.Reset(resourceUri);
 141991                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 141992                _request.Uri.AppendQuery("comp", "acl", escapeValue: false);
 01993                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 1994
 1995                // Add request headers
 141996                _request.Headers.SetValue("x-ms-version", version);
 1997
 1998                // Create the body
 141999                System.Xml.Linq.XElement _body = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get("SignedIdentifie
 142000                if (permissions != null)
 2001                {
 562002                    foreach (Azure.Storage.Files.Shares.Models.ShareSignedIdentifier _child in permissions)
 2003                    {
 142004                        _body.Add(Azure.Storage.Files.Shares.Models.ShareSignedIdentifier.ToXml(_child));
 2005                    }
 2006                }
 142007                string _text = _body.ToString(System.Xml.Linq.SaveOptions.DisableFormatting);
 142008                _request.Headers.SetValue("Content-Type", "application/xml");
 142009                _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.Invar
 142010                _request.Content = Azure.Core.RequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text));
 2011
 142012                return _message;
 2013            }
 2014
 2015            /// <summary>
 2016            /// Create the Share.SetAccessPolicyAsync response or throw a failure exception.
 2017            /// </summary>
 2018            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 2019            /// <param name="response">The raw Response.</param>
 2020            /// <returns>The Share.SetAccessPolicyAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}.</re
 2021            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo> SetAccessPolicyAsync_CreateRespo
 2022                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2023                Azure.Response response)
 2024            {
 2025                // Process the response
 142026                switch (response.Status)
 2027                {
 2028                    case 200:
 2029                    {
 2030                        // Create the result
 122031                        Azure.Storage.Files.Shares.Models.ShareInfo _value = new Azure.Storage.Files.Shares.Models.Share
 2032
 2033                        // Get response headers
 2034                        string _header;
 122035                        if (response.Headers.TryGetValue("ETag", out _header))
 2036                        {
 122037                            _value.ETag = new Azure.ETag(_header);
 2038                        }
 122039                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 2040                        {
 122041                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 2042                        }
 2043
 2044                        // Create the response
 122045                        return Response.FromValue(_value, response);
 2046                    }
 2047                    default:
 2048                    {
 2049                        // Create the result
 22050                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 22051                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 2052
 22053                        throw _value.CreateException(clientDiagnostics, response);
 2054                    }
 2055                }
 2056            }
 2057            #endregion Share.SetAccessPolicyAsync
 2058
 2059            #region Share.GetStatisticsAsync
 2060            /// <summary>
 2061            /// Retrieves statistics related to the share.
 2062            /// </summary>
 2063            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 2064            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2065            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2066            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2067            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2068            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 2069            /// <param name="operationName">Operation name.</param>
 2070            /// <param name="cancellationToken">Cancellation token.</param>
 2071            /// <returns>Stats for the share.</returns>
 2072            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareS
 2073                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2074                Azure.Core.Pipeline.HttpPipeline pipeline,
 2075                System.Uri resourceUri,
 2076                string version,
 2077                int? timeout = default,
 2078                bool async = true,
 2079                string operationName = "ShareClient.GetStatistics",
 2080                System.Threading.CancellationToken cancellationToken = default)
 2081            {
 62082                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 2083                try
 2084                {
 62085                    _scope.AddAttribute("url", resourceUri);
 62086                    _scope.Start();
 62087                    using (Azure.Core.HttpMessage _message = GetStatisticsAsync_CreateMessage(
 62088                        pipeline,
 62089                        resourceUri,
 62090                        version,
 62091                        timeout))
 2092                    {
 62093                        if (async)
 2094                        {
 2095                            // Send the request asynchronously if we're being called via an async path
 32096                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 2097                        }
 2098                        else
 2099                        {
 2100                            // Send the request synchronously through the API that blocks if we're being called via a sy
 2101                            // (this is safe because the Task will complete before the user can call Wait)
 32102                            pipeline.Send(_message, cancellationToken);
 2103                        }
 62104                        Azure.Response _response = _message.Response;
 62105                        cancellationToken.ThrowIfCancellationRequested();
 62106                        return GetStatisticsAsync_CreateResponse(clientDiagnostics, _response);
 2107                    }
 2108                }
 22109                catch (System.Exception ex)
 2110                {
 22111                    _scope.Failed(ex);
 22112                    throw;
 2113                }
 2114                finally
 2115                {
 62116                    _scope.Dispose();
 2117                }
 42118            }
 2119
 2120            /// <summary>
 2121            /// Create the Share.GetStatisticsAsync request.
 2122            /// </summary>
 2123            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2124            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2125            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2126            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2127            /// <returns>The Share.GetStatisticsAsync Message.</returns>
 2128            internal static Azure.Core.HttpMessage GetStatisticsAsync_CreateMessage(
 2129                Azure.Core.Pipeline.HttpPipeline pipeline,
 2130                System.Uri resourceUri,
 2131                string version,
 2132                int? timeout = default)
 2133            {
 2134                // Validation
 62135                if (resourceUri == null)
 2136                {
 02137                    throw new System.ArgumentNullException(nameof(resourceUri));
 2138                }
 62139                if (version == null)
 2140                {
 02141                    throw new System.ArgumentNullException(nameof(version));
 2142                }
 2143
 2144                // Create the request
 62145                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 62146                Azure.Core.Request _request = _message.Request;
 2147
 2148                // Set the endpoint
 62149                _request.Method = Azure.Core.RequestMethod.Get;
 62150                _request.Uri.Reset(resourceUri);
 62151                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 62152                _request.Uri.AppendQuery("comp", "stats", escapeValue: false);
 02153                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 2154
 2155                // Add request headers
 62156                _request.Headers.SetValue("x-ms-version", version);
 2157
 62158                return _message;
 2159            }
 2160
 2161            /// <summary>
 2162            /// Create the Share.GetStatisticsAsync response or throw a failure exception.
 2163            /// </summary>
 2164            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 2165            /// <param name="response">The raw Response.</param>
 2166            /// <returns>The Share.GetStatisticsAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareStatistics}.
 2167            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareStatistics> GetStatisticsAsync_CreateR
 2168                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2169                Azure.Response response)
 2170            {
 2171                // Process the response
 62172                switch (response.Status)
 2173                {
 2174                    case 200:
 2175                    {
 2176                        // Create the result
 42177                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 42178                        Azure.Storage.Files.Shares.Models.ShareStatistics _value = Azure.Storage.Files.Shares.Models.Sha
 2179
 2180                        // Create the response
 42181                        return Response.FromValue(_value, response);
 2182                    }
 2183                    case 304:
 2184                    {
 02185                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.ShareStatistics>(response);
 2186                    }
 2187                    default:
 2188                    {
 2189                        // Create the result
 22190                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 22191                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 2192
 22193                        throw _value.CreateException(clientDiagnostics, response);
 2194                    }
 2195                }
 2196            }
 2197            #endregion Share.GetStatisticsAsync
 2198
 2199            #region Share.RestoreAsync
 2200            /// <summary>
 2201            /// Restores a previously deleted Share.
 2202            /// </summary>
 2203            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 2204            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2205            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2206            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2207            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2208            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 2209            /// <param name="deletedShareName">Specifies the name of the preivously-deleted share.</param>
 2210            /// <param name="deletedShareVersion">Specifies the version of the preivously-deleted share.</param>
 2211            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 2212            /// <param name="operationName">Operation name.</param>
 2213            /// <param name="cancellationToken">Cancellation token.</param>
 2214            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}</returns>
 2215            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareI
 2216                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2217                Azure.Core.Pipeline.HttpPipeline pipeline,
 2218                System.Uri resourceUri,
 2219                string version,
 2220                int? timeout = default,
 2221                string requestId = default,
 2222                string deletedShareName = default,
 2223                string deletedShareVersion = default,
 2224                bool async = true,
 2225                string operationName = "ShareClient.Restore",
 2226                System.Threading.CancellationToken cancellationToken = default)
 2227            {
 42228                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 2229                try
 2230                {
 42231                    _scope.AddAttribute("url", resourceUri);
 42232                    _scope.Start();
 42233                    using (Azure.Core.HttpMessage _message = RestoreAsync_CreateMessage(
 42234                        pipeline,
 42235                        resourceUri,
 42236                        version,
 42237                        timeout,
 42238                        requestId,
 42239                        deletedShareName,
 42240                        deletedShareVersion))
 2241                    {
 42242                        if (async)
 2243                        {
 2244                            // Send the request asynchronously if we're being called via an async path
 22245                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 2246                        }
 2247                        else
 2248                        {
 2249                            // Send the request synchronously through the API that blocks if we're being called via a sy
 2250                            // (this is safe because the Task will complete before the user can call Wait)
 22251                            pipeline.Send(_message, cancellationToken);
 2252                        }
 42253                        Azure.Response _response = _message.Response;
 42254                        cancellationToken.ThrowIfCancellationRequested();
 42255                        return RestoreAsync_CreateResponse(clientDiagnostics, _response);
 2256                    }
 2257                }
 22258                catch (System.Exception ex)
 2259                {
 22260                    _scope.Failed(ex);
 22261                    throw;
 2262                }
 2263                finally
 2264                {
 42265                    _scope.Dispose();
 2266                }
 22267            }
 2268
 2269            /// <summary>
 2270            /// Create the Share.RestoreAsync request.
 2271            /// </summary>
 2272            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2273            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2274            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2275            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2276            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 2277            /// <param name="deletedShareName">Specifies the name of the preivously-deleted share.</param>
 2278            /// <param name="deletedShareVersion">Specifies the version of the preivously-deleted share.</param>
 2279            /// <returns>The Share.RestoreAsync Message.</returns>
 2280            internal static Azure.Core.HttpMessage RestoreAsync_CreateMessage(
 2281                Azure.Core.Pipeline.HttpPipeline pipeline,
 2282                System.Uri resourceUri,
 2283                string version,
 2284                int? timeout = default,
 2285                string requestId = default,
 2286                string deletedShareName = default,
 2287                string deletedShareVersion = default)
 2288            {
 2289                // Validation
 42290                if (resourceUri == null)
 2291                {
 02292                    throw new System.ArgumentNullException(nameof(resourceUri));
 2293                }
 42294                if (version == null)
 2295                {
 02296                    throw new System.ArgumentNullException(nameof(version));
 2297                }
 2298
 2299                // Create the request
 42300                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 42301                Azure.Core.Request _request = _message.Request;
 2302
 2303                // Set the endpoint
 42304                _request.Method = Azure.Core.RequestMethod.Put;
 42305                _request.Uri.Reset(resourceUri);
 42306                _request.Uri.AppendQuery("restype", "share", escapeValue: false);
 42307                _request.Uri.AppendQuery("comp", "undelete", escapeValue: false);
 02308                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 2309
 2310                // Add request headers
 42311                _request.Headers.SetValue("x-ms-version", version);
 02312                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 82313                if (deletedShareName != null) { _request.Headers.SetValue("x-ms-deleted-share-name", deletedShareName); 
 82314                if (deletedShareVersion != null) { _request.Headers.SetValue("x-ms-deleted-share-version", deletedShareV
 2315
 42316                return _message;
 2317            }
 2318
 2319            /// <summary>
 2320            /// Create the Share.RestoreAsync response or throw a failure exception.
 2321            /// </summary>
 2322            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 2323            /// <param name="response">The raw Response.</param>
 2324            /// <returns>The Share.RestoreAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareInfo}.</returns>
 2325            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareInfo> RestoreAsync_CreateResponse(
 2326                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2327                Azure.Response response)
 2328            {
 2329                // Process the response
 42330                switch (response.Status)
 2331                {
 2332                    case 201:
 2333                    {
 2334                        // Create the result
 22335                        Azure.Storage.Files.Shares.Models.ShareInfo _value = new Azure.Storage.Files.Shares.Models.Share
 2336
 2337                        // Get response headers
 2338                        string _header;
 22339                        if (response.Headers.TryGetValue("ETag", out _header))
 2340                        {
 22341                            _value.ETag = new Azure.ETag(_header);
 2342                        }
 22343                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 2344                        {
 22345                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 2346                        }
 2347
 2348                        // Create the response
 22349                        return Response.FromValue(_value, response);
 2350                    }
 2351                    default:
 2352                    {
 2353                        // Create the result
 22354                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 22355                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 2356
 22357                        throw _value.CreateException(clientDiagnostics, response);
 2358                    }
 2359                }
 2360            }
 2361            #endregion Share.RestoreAsync
 2362        }
 2363        #endregion Share operations
 2364
 2365        #region Directory operations
 2366        /// <summary>
 2367        /// Directory operations for Azure File Storage
 2368        /// </summary>
 2369        public static partial class Directory
 2370        {
 2371            #region Directory.CreateAsync
 2372            /// <summary>
 2373            /// Creates a new directory under the specified share or parent directory.
 2374            /// </summary>
 2375            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 2376            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2377            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2378            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2379            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 2380            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 2381            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 2382            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2383            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 2384            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 2385            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 2386            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 2387            /// <param name="operationName">Operation name.</param>
 2388            /// <param name="cancellationToken">Cancellation token.</param>
 2389            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo}</returns>
 2390            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 2391                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2392                Azure.Core.Pipeline.HttpPipeline pipeline,
 2393                System.Uri resourceUri,
 2394                string version,
 2395                string fileAttributes,
 2396                string fileCreationTime,
 2397                string fileLastWriteTime,
 2398                int? timeout = default,
 2399                System.Collections.Generic.IDictionary<string, string> metadata = default,
 2400                string filePermission = default,
 2401                string filePermissionKey = default,
 2402                bool async = true,
 2403                string operationName = "DirectoryClient.Create",
 2404                System.Threading.CancellationToken cancellationToken = default)
 2405            {
 3392406                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 2407                try
 2408                {
 3392409                    _scope.AddAttribute("url", resourceUri);
 3392410                    _scope.Start();
 3392411                    using (Azure.Core.HttpMessage _message = CreateAsync_CreateMessage(
 3392412                        pipeline,
 3392413                        resourceUri,
 3392414                        version,
 3392415                        fileAttributes,
 3392416                        fileCreationTime,
 3392417                        fileLastWriteTime,
 3392418                        timeout,
 3392419                        metadata,
 3392420                        filePermission,
 3392421                        filePermissionKey))
 2422                    {
 3392423                        if (async)
 2424                        {
 2425                            // Send the request asynchronously if we're being called via an async path
 1702426                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 2427                        }
 2428                        else
 2429                        {
 2430                            // Send the request synchronously through the API that blocks if we're being called via a sy
 2431                            // (this is safe because the Task will complete before the user can call Wait)
 1692432                            pipeline.Send(_message, cancellationToken);
 2433                        }
 3392434                        Azure.Response _response = _message.Response;
 3392435                        cancellationToken.ThrowIfCancellationRequested();
 3392436                        return CreateAsync_CreateResponse(clientDiagnostics, _response);
 2437                    }
 2438                }
 62439                catch (System.Exception ex)
 2440                {
 62441                    _scope.Failed(ex);
 62442                    throw;
 2443                }
 2444                finally
 2445                {
 3392446                    _scope.Dispose();
 2447                }
 3332448            }
 2449
 2450            /// <summary>
 2451            /// Create the Directory.CreateAsync request.
 2452            /// </summary>
 2453            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2454            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2455            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2456            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 2457            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 2458            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 2459            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2460            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 2461            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 2462            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 2463            /// <returns>The Directory.CreateAsync Message.</returns>
 2464            internal static Azure.Core.HttpMessage CreateAsync_CreateMessage(
 2465                Azure.Core.Pipeline.HttpPipeline pipeline,
 2466                System.Uri resourceUri,
 2467                string version,
 2468                string fileAttributes,
 2469                string fileCreationTime,
 2470                string fileLastWriteTime,
 2471                int? timeout = default,
 2472                System.Collections.Generic.IDictionary<string, string> metadata = default,
 2473                string filePermission = default,
 2474                string filePermissionKey = default)
 2475            {
 2476                // Validation
 3392477                if (resourceUri == null)
 2478                {
 02479                    throw new System.ArgumentNullException(nameof(resourceUri));
 2480                }
 3392481                if (version == null)
 2482                {
 02483                    throw new System.ArgumentNullException(nameof(version));
 2484                }
 3392485                if (fileAttributes == null)
 2486                {
 02487                    throw new System.ArgumentNullException(nameof(fileAttributes));
 2488                }
 3392489                if (fileCreationTime == null)
 2490                {
 02491                    throw new System.ArgumentNullException(nameof(fileCreationTime));
 2492                }
 3392493                if (fileLastWriteTime == null)
 2494                {
 02495                    throw new System.ArgumentNullException(nameof(fileLastWriteTime));
 2496                }
 2497
 2498                // Create the request
 3392499                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 3392500                Azure.Core.Request _request = _message.Request;
 2501
 2502                // Set the endpoint
 3392503                _request.Method = Azure.Core.RequestMethod.Put;
 3392504                _request.Uri.Reset(resourceUri);
 3392505                _request.Uri.AppendQuery("restype", "directory", escapeValue: false);
 02506                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 2507
 2508                // Add request headers
 3392509                _request.Headers.SetValue("x-ms-version", version);
 3392510                _request.Headers.SetValue("x-ms-file-attributes", fileAttributes);
 3392511                _request.Headers.SetValue("x-ms-file-creation-time", fileCreationTime);
 3392512                _request.Headers.SetValue("x-ms-file-last-write-time", fileLastWriteTime);
 3392513                if (metadata != null) {
 202514                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 2515                    {
 82516                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 2517                    }
 2518                }
 6762519                if (filePermission != null) { _request.Headers.SetValue("x-ms-file-permission", filePermission); }
 3412520                if (filePermissionKey != null) { _request.Headers.SetValue("x-ms-file-permission-key", filePermissionKey
 2521
 3392522                return _message;
 2523            }
 2524
 2525            /// <summary>
 2526            /// Create the Directory.CreateAsync response or throw a failure exception.
 2527            /// </summary>
 2528            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 2529            /// <param name="response">The raw Response.</param>
 2530            /// <returns>The Directory.CreateAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDirectoryI
 2531            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo> CreateAsync_Create
 2532                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2533                Azure.Response response)
 2534            {
 2535                // Process the response
 3392536                switch (response.Status)
 2537                {
 2538                    case 201:
 2539                    {
 2540                        // Create the result
 3332541                        Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo _value = new Azure.Storage.Files.Share
 2542
 2543                        // Get response headers
 2544                        string _header;
 3332545                        if (response.Headers.TryGetValue("ETag", out _header))
 2546                        {
 3332547                            _value.ETag = new Azure.ETag(_header);
 2548                        }
 3332549                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 2550                        {
 3332551                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 2552                        }
 3332553                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 2554                        {
 3332555                            _value.FilePermissionKey = _header;
 2556                        }
 3332557                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 2558                        {
 3332559                            _value.FileAttributes = _header;
 2560                        }
 3332561                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 2562                        {
 3332563                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 2564                        }
 3332565                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 2566                        {
 3332567                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 2568                        }
 3332569                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 2570                        {
 3332571                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 2572                        }
 3332573                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 2574                        {
 3332575                            _value.FileId = _header;
 2576                        }
 3332577                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 2578                        {
 3332579                            _value.FileParentId = _header;
 2580                        }
 2581
 2582                        // Create the response
 3332583                        return Response.FromValue(_value, response);
 2584                    }
 2585                    default:
 2586                    {
 2587                        // Create the result
 62588                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 62589                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 2590
 62591                        throw _value.CreateException(clientDiagnostics, response);
 2592                    }
 2593                }
 2594            }
 2595            #endregion Directory.CreateAsync
 2596
 2597            #region Directory.GetPropertiesAsync
 2598            /// <summary>
 2599            /// Returns all system properties for the specified directory, and can also be used to check the existence o
 2600            /// </summary>
 2601            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 2602            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2603            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2604            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2605            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 2606            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2607            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 2608            /// <param name="operationName">Operation name.</param>
 2609            /// <param name="cancellationToken">Cancellation token.</param>
 2610            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDirectoryProperties}</returns>
 2611            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 2612                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2613                Azure.Core.Pipeline.HttpPipeline pipeline,
 2614                System.Uri resourceUri,
 2615                string version,
 2616                string sharesnapshot = default,
 2617                int? timeout = default,
 2618                bool async = true,
 2619                string operationName = "DirectoryClient.GetProperties",
 2620                System.Threading.CancellationToken cancellationToken = default)
 2621            {
 502622                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 2623                try
 2624                {
 502625                    _scope.AddAttribute("url", resourceUri);
 502626                    _scope.Start();
 502627                    using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage(
 502628                        pipeline,
 502629                        resourceUri,
 502630                        version,
 502631                        sharesnapshot,
 502632                        timeout))
 2633                    {
 502634                        if (async)
 2635                        {
 2636                            // Send the request asynchronously if we're being called via an async path
 412637                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 2638                        }
 2639                        else
 2640                        {
 2641                            // Send the request synchronously through the API that blocks if we're being called via a sy
 2642                            // (this is safe because the Task will complete before the user can call Wait)
 92643                            pipeline.Send(_message, cancellationToken);
 2644                        }
 502645                        Azure.Response _response = _message.Response;
 502646                        cancellationToken.ThrowIfCancellationRequested();
 502647                        return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response);
 2648                    }
 2649                }
 102650                catch (System.Exception ex)
 2651                {
 102652                    _scope.Failed(ex);
 102653                    throw;
 2654                }
 2655                finally
 2656                {
 502657                    _scope.Dispose();
 2658                }
 402659            }
 2660
 2661            /// <summary>
 2662            /// Create the Directory.GetPropertiesAsync request.
 2663            /// </summary>
 2664            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2665            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2666            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2667            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 2668            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2669            /// <returns>The Directory.GetPropertiesAsync Message.</returns>
 2670            internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage(
 2671                Azure.Core.Pipeline.HttpPipeline pipeline,
 2672                System.Uri resourceUri,
 2673                string version,
 2674                string sharesnapshot = default,
 2675                int? timeout = default)
 2676            {
 2677                // Validation
 502678                if (resourceUri == null)
 2679                {
 02680                    throw new System.ArgumentNullException(nameof(resourceUri));
 2681                }
 502682                if (version == null)
 2683                {
 02684                    throw new System.ArgumentNullException(nameof(version));
 2685                }
 2686
 2687                // Create the request
 502688                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 502689                Azure.Core.Request _request = _message.Request;
 2690
 2691                // Set the endpoint
 502692                _request.Method = Azure.Core.RequestMethod.Get;
 502693                _request.Uri.Reset(resourceUri);
 502694                _request.Uri.AppendQuery("restype", "directory", escapeValue: false);
 02695                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 02696                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 2697
 2698                // Add request headers
 502699                _request.Headers.SetValue("x-ms-version", version);
 2700
 502701                return _message;
 2702            }
 2703
 2704            /// <summary>
 2705            /// Create the Directory.GetPropertiesAsync response or throw a failure exception.
 2706            /// </summary>
 2707            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 2708            /// <param name="response">The raw Response.</param>
 2709            /// <returns>The Directory.GetPropertiesAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDir
 2710            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageDirectoryProperties> GetPropertie
 2711                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2712                Azure.Response response)
 2713            {
 2714                // Process the response
 502715                switch (response.Status)
 2716                {
 2717                    case 200:
 2718                    {
 2719                        // Create the result
 402720                        Azure.Storage.Files.Shares.Models.RawStorageDirectoryProperties _value = new Azure.Storage.Files
 2721
 2722                        // Get response headers
 2723                        string _header;
 402724                        _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringCompare
 14202725                        foreach (Azure.Core.HttpHeader _headerPair in response.Headers)
 2726                        {
 6702727                            if (_headerPair.Name.StartsWith("x-ms-meta-", System.StringComparison.InvariantCulture))
 2728                            {
 162729                                _value.Metadata[_headerPair.Name.Substring(10)] = _headerPair.Value;
 2730                            }
 2731                        }
 402732                        if (response.Headers.TryGetValue("ETag", out _header))
 2733                        {
 402734                            _value.ETag = new Azure.ETag(_header);
 2735                        }
 402736                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 2737                        {
 402738                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 2739                        }
 402740                        if (response.Headers.TryGetValue("x-ms-server-encrypted", out _header))
 2741                        {
 402742                            _value.IsServerEncrypted = bool.Parse(_header);
 2743                        }
 402744                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 2745                        {
 402746                            _value.FileAttributes = _header;
 2747                        }
 402748                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 2749                        {
 402750                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 2751                        }
 402752                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 2753                        {
 402754                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 2755                        }
 402756                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 2757                        {
 402758                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 2759                        }
 402760                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 2761                        {
 362762                            _value.FilePermissionKey = _header;
 2763                        }
 402764                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 2765                        {
 402766                            _value.FileId = _header;
 2767                        }
 402768                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 2769                        {
 402770                            _value.FileParentId = _header;
 2771                        }
 2772
 2773                        // Create the response
 402774                        return Response.FromValue(_value, response);
 2775                    }
 2776                    case 304:
 2777                    {
 02778                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.RawStorageDirectoryProperties>
 2779                    }
 2780                    default:
 2781                    {
 2782                        // Create the result
 102783                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 102784                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 2785
 102786                        throw _value.CreateException(clientDiagnostics, response);
 2787                    }
 2788                }
 2789            }
 2790            #endregion Directory.GetPropertiesAsync
 2791
 2792            #region Directory.DeleteAsync
 2793            /// <summary>
 2794            /// Removes the specified empty directory. Note that the directory must be empty before it can be deleted.
 2795            /// </summary>
 2796            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 2797            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2798            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2799            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2800            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2801            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 2802            /// <param name="operationName">Operation name.</param>
 2803            /// <param name="cancellationToken">Cancellation token.</param>
 2804            /// <returns>Azure.Response</returns>
 2805            public static async System.Threading.Tasks.ValueTask<Azure.Response> DeleteAsync(
 2806                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2807                Azure.Core.Pipeline.HttpPipeline pipeline,
 2808                System.Uri resourceUri,
 2809                string version,
 2810                int? timeout = default,
 2811                bool async = true,
 2812                string operationName = "DirectoryClient.Delete",
 2813                System.Threading.CancellationToken cancellationToken = default)
 2814            {
 162815                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 2816                try
 2817                {
 162818                    _scope.AddAttribute("url", resourceUri);
 162819                    _scope.Start();
 162820                    using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage(
 162821                        pipeline,
 162822                        resourceUri,
 162823                        version,
 162824                        timeout))
 2825                    {
 162826                        if (async)
 2827                        {
 2828                            // Send the request asynchronously if we're being called via an async path
 82829                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 2830                        }
 2831                        else
 2832                        {
 2833                            // Send the request synchronously through the API that blocks if we're being called via a sy
 2834                            // (this is safe because the Task will complete before the user can call Wait)
 82835                            pipeline.Send(_message, cancellationToken);
 2836                        }
 162837                        Azure.Response _response = _message.Response;
 162838                        cancellationToken.ThrowIfCancellationRequested();
 162839                        return DeleteAsync_CreateResponse(clientDiagnostics, _response);
 2840                    }
 2841                }
 82842                catch (System.Exception ex)
 2843                {
 82844                    _scope.Failed(ex);
 82845                    throw;
 2846                }
 2847                finally
 2848                {
 162849                    _scope.Dispose();
 2850                }
 82851            }
 2852
 2853            /// <summary>
 2854            /// Create the Directory.DeleteAsync request.
 2855            /// </summary>
 2856            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2857            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2858            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2859            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2860            /// <returns>The Directory.DeleteAsync Message.</returns>
 2861            internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage(
 2862                Azure.Core.Pipeline.HttpPipeline pipeline,
 2863                System.Uri resourceUri,
 2864                string version,
 2865                int? timeout = default)
 2866            {
 2867                // Validation
 162868                if (resourceUri == null)
 2869                {
 02870                    throw new System.ArgumentNullException(nameof(resourceUri));
 2871                }
 162872                if (version == null)
 2873                {
 02874                    throw new System.ArgumentNullException(nameof(version));
 2875                }
 2876
 2877                // Create the request
 162878                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 162879                Azure.Core.Request _request = _message.Request;
 2880
 2881                // Set the endpoint
 162882                _request.Method = Azure.Core.RequestMethod.Delete;
 162883                _request.Uri.Reset(resourceUri);
 162884                _request.Uri.AppendQuery("restype", "directory", escapeValue: false);
 02885                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 2886
 2887                // Add request headers
 162888                _request.Headers.SetValue("x-ms-version", version);
 2889
 162890                return _message;
 2891            }
 2892
 2893            /// <summary>
 2894            /// Create the Directory.DeleteAsync response or throw a failure exception.
 2895            /// </summary>
 2896            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 2897            /// <param name="response">The raw Response.</param>
 2898            /// <returns>The Directory.DeleteAsync Azure.Response.</returns>
 2899            internal static Azure.Response DeleteAsync_CreateResponse(
 2900                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2901                Azure.Response response)
 2902            {
 2903                // Process the response
 162904                switch (response.Status)
 2905                {
 2906                    case 202:
 2907                    {
 82908                        return response;
 2909                    }
 2910                    default:
 2911                    {
 2912                        // Create the result
 82913                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 82914                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 2915
 82916                        throw _value.CreateException(clientDiagnostics, response);
 2917                    }
 2918                }
 2919            }
 2920            #endregion Directory.DeleteAsync
 2921
 2922            #region Directory.SetPropertiesAsync
 2923            /// <summary>
 2924            /// Sets properties on the directory.
 2925            /// </summary>
 2926            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 2927            /// <param name="pipeline">The pipeline used for sending requests.</param>
 2928            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 2929            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 2930            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 2931            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 2932            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 2933            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 2934            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 2935            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 2936            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 2937            /// <param name="operationName">Operation name.</param>
 2938            /// <param name="cancellationToken">Cancellation token.</param>
 2939            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo}</returns>
 2940            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 2941                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 2942                Azure.Core.Pipeline.HttpPipeline pipeline,
 2943                System.Uri resourceUri,
 2944                string version,
 2945                string fileAttributes,
 2946                string fileCreationTime,
 2947                string fileLastWriteTime,
 2948                int? timeout = default,
 2949                string filePermission = default,
 2950                string filePermissionKey = default,
 2951                bool async = true,
 2952                string operationName = "DirectoryClient.SetProperties",
 2953                System.Threading.CancellationToken cancellationToken = default)
 2954            {
 42955                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 2956                try
 2957                {
 42958                    _scope.AddAttribute("url", resourceUri);
 42959                    _scope.Start();
 42960                    using (Azure.Core.HttpMessage _message = SetPropertiesAsync_CreateMessage(
 42961                        pipeline,
 42962                        resourceUri,
 42963                        version,
 42964                        fileAttributes,
 42965                        fileCreationTime,
 42966                        fileLastWriteTime,
 42967                        timeout,
 42968                        filePermission,
 42969                        filePermissionKey))
 2970                    {
 42971                        if (async)
 2972                        {
 2973                            // Send the request asynchronously if we're being called via an async path
 22974                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 2975                        }
 2976                        else
 2977                        {
 2978                            // Send the request synchronously through the API that blocks if we're being called via a sy
 2979                            // (this is safe because the Task will complete before the user can call Wait)
 22980                            pipeline.Send(_message, cancellationToken);
 2981                        }
 42982                        Azure.Response _response = _message.Response;
 42983                        cancellationToken.ThrowIfCancellationRequested();
 42984                        return SetPropertiesAsync_CreateResponse(clientDiagnostics, _response);
 2985                    }
 2986                }
 02987                catch (System.Exception ex)
 2988                {
 02989                    _scope.Failed(ex);
 02990                    throw;
 2991                }
 2992                finally
 2993                {
 42994                    _scope.Dispose();
 2995                }
 42996            }
 2997
 2998            /// <summary>
 2999            /// Create the Directory.SetPropertiesAsync request.
 3000            /// </summary>
 3001            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3002            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3003            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3004            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 3005            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 3006            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 3007            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3008            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 3009            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 3010            /// <returns>The Directory.SetPropertiesAsync Message.</returns>
 3011            internal static Azure.Core.HttpMessage SetPropertiesAsync_CreateMessage(
 3012                Azure.Core.Pipeline.HttpPipeline pipeline,
 3013                System.Uri resourceUri,
 3014                string version,
 3015                string fileAttributes,
 3016                string fileCreationTime,
 3017                string fileLastWriteTime,
 3018                int? timeout = default,
 3019                string filePermission = default,
 3020                string filePermissionKey = default)
 3021            {
 3022                // Validation
 43023                if (resourceUri == null)
 3024                {
 03025                    throw new System.ArgumentNullException(nameof(resourceUri));
 3026                }
 43027                if (version == null)
 3028                {
 03029                    throw new System.ArgumentNullException(nameof(version));
 3030                }
 43031                if (fileAttributes == null)
 3032                {
 03033                    throw new System.ArgumentNullException(nameof(fileAttributes));
 3034                }
 43035                if (fileCreationTime == null)
 3036                {
 03037                    throw new System.ArgumentNullException(nameof(fileCreationTime));
 3038                }
 43039                if (fileLastWriteTime == null)
 3040                {
 03041                    throw new System.ArgumentNullException(nameof(fileLastWriteTime));
 3042                }
 3043
 3044                // Create the request
 43045                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 43046                Azure.Core.Request _request = _message.Request;
 3047
 3048                // Set the endpoint
 43049                _request.Method = Azure.Core.RequestMethod.Put;
 43050                _request.Uri.Reset(resourceUri);
 43051                _request.Uri.AppendQuery("restype", "directory", escapeValue: false);
 43052                _request.Uri.AppendQuery("comp", "properties", escapeValue: false);
 03053                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 3054
 3055                // Add request headers
 43056                _request.Headers.SetValue("x-ms-version", version);
 43057                _request.Headers.SetValue("x-ms-file-attributes", fileAttributes);
 43058                _request.Headers.SetValue("x-ms-file-creation-time", fileCreationTime);
 43059                _request.Headers.SetValue("x-ms-file-last-write-time", fileLastWriteTime);
 63060                if (filePermission != null) { _request.Headers.SetValue("x-ms-file-permission", filePermission); }
 63061                if (filePermissionKey != null) { _request.Headers.SetValue("x-ms-file-permission-key", filePermissionKey
 3062
 43063                return _message;
 3064            }
 3065
 3066            /// <summary>
 3067            /// Create the Directory.SetPropertiesAsync response or throw a failure exception.
 3068            /// </summary>
 3069            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 3070            /// <param name="response">The raw Response.</param>
 3071            /// <returns>The Directory.SetPropertiesAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDir
 3072            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo> SetPropertiesAsync
 3073                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3074                Azure.Response response)
 3075            {
 3076                // Process the response
 43077                switch (response.Status)
 3078                {
 3079                    case 200:
 3080                    {
 3081                        // Create the result
 43082                        Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo _value = new Azure.Storage.Files.Share
 3083
 3084                        // Get response headers
 3085                        string _header;
 43086                        if (response.Headers.TryGetValue("ETag", out _header))
 3087                        {
 43088                            _value.ETag = new Azure.ETag(_header);
 3089                        }
 43090                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 3091                        {
 43092                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 3093                        }
 43094                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 3095                        {
 43096                            _value.FilePermissionKey = _header;
 3097                        }
 43098                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 3099                        {
 43100                            _value.FileAttributes = _header;
 3101                        }
 43102                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 3103                        {
 43104                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 3105                        }
 43106                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 3107                        {
 43108                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 3109                        }
 43110                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 3111                        {
 43112                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 3113                        }
 43114                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 3115                        {
 43116                            _value.FileId = _header;
 3117                        }
 43118                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 3119                        {
 43120                            _value.FileParentId = _header;
 3121                        }
 3122
 3123                        // Create the response
 43124                        return Response.FromValue(_value, response);
 3125                    }
 3126                    default:
 3127                    {
 3128                        // Create the result
 03129                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 03130                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 3131
 03132                        throw _value.CreateException(clientDiagnostics, response);
 3133                    }
 3134                }
 3135            }
 3136            #endregion Directory.SetPropertiesAsync
 3137
 3138            #region Directory.SetMetadataAsync
 3139            /// <summary>
 3140            /// Updates user defined metadata for the specified directory.
 3141            /// </summary>
 3142            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 3143            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3144            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3145            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3146            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3147            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 3148            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 3149            /// <param name="operationName">Operation name.</param>
 3150            /// <param name="cancellationToken">Cancellation token.</param>
 3151            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo}</returns>
 3152            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 3153                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3154                Azure.Core.Pipeline.HttpPipeline pipeline,
 3155                System.Uri resourceUri,
 3156                string version,
 3157                int? timeout = default,
 3158                System.Collections.Generic.IDictionary<string, string> metadata = default,
 3159                bool async = true,
 3160                string operationName = "DirectoryClient.SetMetadata",
 3161                System.Threading.CancellationToken cancellationToken = default)
 3162            {
 43163                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 3164                try
 3165                {
 43166                    _scope.AddAttribute("url", resourceUri);
 43167                    _scope.Start();
 43168                    using (Azure.Core.HttpMessage _message = SetMetadataAsync_CreateMessage(
 43169                        pipeline,
 43170                        resourceUri,
 43171                        version,
 43172                        timeout,
 43173                        metadata))
 3174                    {
 43175                        if (async)
 3176                        {
 3177                            // Send the request asynchronously if we're being called via an async path
 23178                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 3179                        }
 3180                        else
 3181                        {
 3182                            // Send the request synchronously through the API that blocks if we're being called via a sy
 3183                            // (this is safe because the Task will complete before the user can call Wait)
 23184                            pipeline.Send(_message, cancellationToken);
 3185                        }
 43186                        Azure.Response _response = _message.Response;
 43187                        cancellationToken.ThrowIfCancellationRequested();
 43188                        return SetMetadataAsync_CreateResponse(clientDiagnostics, _response);
 3189                    }
 3190                }
 23191                catch (System.Exception ex)
 3192                {
 23193                    _scope.Failed(ex);
 23194                    throw;
 3195                }
 3196                finally
 3197                {
 43198                    _scope.Dispose();
 3199                }
 23200            }
 3201
 3202            /// <summary>
 3203            /// Create the Directory.SetMetadataAsync request.
 3204            /// </summary>
 3205            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3206            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3207            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3208            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3209            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 3210            /// <returns>The Directory.SetMetadataAsync Message.</returns>
 3211            internal static Azure.Core.HttpMessage SetMetadataAsync_CreateMessage(
 3212                Azure.Core.Pipeline.HttpPipeline pipeline,
 3213                System.Uri resourceUri,
 3214                string version,
 3215                int? timeout = default,
 3216                System.Collections.Generic.IDictionary<string, string> metadata = default)
 3217            {
 3218                // Validation
 43219                if (resourceUri == null)
 3220                {
 03221                    throw new System.ArgumentNullException(nameof(resourceUri));
 3222                }
 43223                if (version == null)
 3224                {
 03225                    throw new System.ArgumentNullException(nameof(version));
 3226                }
 3227
 3228                // Create the request
 43229                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 43230                Azure.Core.Request _request = _message.Request;
 3231
 3232                // Set the endpoint
 43233                _request.Method = Azure.Core.RequestMethod.Put;
 43234                _request.Uri.Reset(resourceUri);
 43235                _request.Uri.AppendQuery("restype", "directory", escapeValue: false);
 43236                _request.Uri.AppendQuery("comp", "metadata", escapeValue: false);
 03237                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 3238
 3239                // Add request headers
 43240                _request.Headers.SetValue("x-ms-version", version);
 43241                if (metadata != null) {
 403242                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 3243                    {
 163244                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 3245                    }
 3246                }
 3247
 43248                return _message;
 3249            }
 3250
 3251            /// <summary>
 3252            /// Create the Directory.SetMetadataAsync response or throw a failure exception.
 3253            /// </summary>
 3254            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 3255            /// <param name="response">The raw Response.</param>
 3256            /// <returns>The Directory.SetMetadataAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageDirec
 3257            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo> SetMetadataAsync_C
 3258                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3259                Azure.Response response)
 3260            {
 3261                // Process the response
 43262                switch (response.Status)
 3263                {
 3264                    case 200:
 3265                    {
 3266                        // Create the result
 23267                        Azure.Storage.Files.Shares.Models.RawStorageDirectoryInfo _value = new Azure.Storage.Files.Share
 3268
 3269                        // Get response headers
 3270                        string _header;
 23271                        if (response.Headers.TryGetValue("ETag", out _header))
 3272                        {
 23273                            _value.ETag = new Azure.ETag(_header);
 3274                        }
 23275                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 3276                        {
 23277                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 3278                        }
 3279
 3280                        // Create the response
 23281                        return Response.FromValue(_value, response);
 3282                    }
 3283                    default:
 3284                    {
 3285                        // Create the result
 23286                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 23287                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 3288
 23289                        throw _value.CreateException(clientDiagnostics, response);
 3290                    }
 3291                }
 3292            }
 3293            #endregion Directory.SetMetadataAsync
 3294
 3295            #region Directory.ListFilesAndDirectoriesSegmentAsync
 3296            /// <summary>
 3297            /// Returns a list of files or directories under the specified share or directory. It lists the contents onl
 3298            /// </summary>
 3299            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 3300            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3301            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3302            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3303            /// <param name="prefix">Filters the results to return only entries whose name begins with the specified pre
 3304            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 3305            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 3306            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 3307            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3308            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 3309            /// <param name="operationName">Operation name.</param>
 3310            /// <param name="cancellationToken">Cancellation token.</param>
 3311            /// <returns>An enumeration of directories and files.</returns>
 3312            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.FilesA
 3313                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3314                Azure.Core.Pipeline.HttpPipeline pipeline,
 3315                System.Uri resourceUri,
 3316                string version,
 3317                string prefix = default,
 3318                string sharesnapshot = default,
 3319                string marker = default,
 3320                int? maxresults = default,
 3321                int? timeout = default,
 3322                bool async = true,
 3323                string operationName = "DirectoryClient.ListFilesAndDirectoriesSegment",
 3324                System.Threading.CancellationToken cancellationToken = default)
 3325            {
 543326                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 3327                try
 3328                {
 543329                    _scope.AddAttribute("url", resourceUri);
 543330                    _scope.Start();
 543331                    using (Azure.Core.HttpMessage _message = ListFilesAndDirectoriesSegmentAsync_CreateMessage(
 543332                        pipeline,
 543333                        resourceUri,
 543334                        version,
 543335                        prefix,
 543336                        sharesnapshot,
 543337                        marker,
 543338                        maxresults,
 543339                        timeout))
 3340                    {
 543341                        if (async)
 3342                        {
 3343                            // Send the request asynchronously if we're being called via an async path
 273344                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 3345                        }
 3346                        else
 3347                        {
 3348                            // Send the request synchronously through the API that blocks if we're being called via a sy
 3349                            // (this is safe because the Task will complete before the user can call Wait)
 273350                            pipeline.Send(_message, cancellationToken);
 3351                        }
 543352                        Azure.Response _response = _message.Response;
 543353                        cancellationToken.ThrowIfCancellationRequested();
 543354                        return ListFilesAndDirectoriesSegmentAsync_CreateResponse(clientDiagnostics, _response);
 3355                    }
 3356                }
 23357                catch (System.Exception ex)
 3358                {
 23359                    _scope.Failed(ex);
 23360                    throw;
 3361                }
 3362                finally
 3363                {
 543364                    _scope.Dispose();
 3365                }
 523366            }
 3367
 3368            /// <summary>
 3369            /// Create the Directory.ListFilesAndDirectoriesSegmentAsync request.
 3370            /// </summary>
 3371            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3372            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3373            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3374            /// <param name="prefix">Filters the results to return only entries whose name begins with the specified pre
 3375            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 3376            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 3377            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 3378            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3379            /// <returns>The Directory.ListFilesAndDirectoriesSegmentAsync Message.</returns>
 3380            internal static Azure.Core.HttpMessage ListFilesAndDirectoriesSegmentAsync_CreateMessage(
 3381                Azure.Core.Pipeline.HttpPipeline pipeline,
 3382                System.Uri resourceUri,
 3383                string version,
 3384                string prefix = default,
 3385                string sharesnapshot = default,
 3386                string marker = default,
 3387                int? maxresults = default,
 3388                int? timeout = default)
 3389            {
 3390                // Validation
 543391                if (resourceUri == null)
 3392                {
 03393                    throw new System.ArgumentNullException(nameof(resourceUri));
 3394                }
 543395                if (version == null)
 3396                {
 03397                    throw new System.ArgumentNullException(nameof(version));
 3398                }
 3399
 3400                // Create the request
 543401                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 543402                Azure.Core.Request _request = _message.Request;
 3403
 3404                // Set the endpoint
 543405                _request.Method = Azure.Core.RequestMethod.Get;
 543406                _request.Uri.Reset(resourceUri);
 543407                _request.Uri.AppendQuery("restype", "directory", escapeValue: false);
 543408                _request.Uri.AppendQuery("comp", "list", escapeValue: false);
 03409                if (prefix != null) { _request.Uri.AppendQuery("prefix", prefix); }
 03410                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 03411                if (marker != null) { _request.Uri.AppendQuery("marker", marker); }
 03412                if (maxresults != null) { _request.Uri.AppendQuery("maxresults", maxresults.Value.ToString(System.Global
 03413                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 3414
 3415                // Add request headers
 543416                _request.Headers.SetValue("x-ms-version", version);
 3417
 543418                return _message;
 3419            }
 3420
 3421            /// <summary>
 3422            /// Create the Directory.ListFilesAndDirectoriesSegmentAsync response or throw a failure exception.
 3423            /// </summary>
 3424            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 3425            /// <param name="response">The raw Response.</param>
 3426            /// <returns>The Directory.ListFilesAndDirectoriesSegmentAsync Azure.Response{Azure.Storage.Files.Shares.Mod
 3427            internal static Azure.Response<Azure.Storage.Files.Shares.Models.FilesAndDirectoriesSegment> ListFilesAndDir
 3428                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3429                Azure.Response response)
 3430            {
 3431                // Process the response
 543432                switch (response.Status)
 3433                {
 3434                    case 200:
 3435                    {
 3436                        // Create the result
 523437                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 523438                        Azure.Storage.Files.Shares.Models.FilesAndDirectoriesSegment _value = Azure.Storage.Files.Shares
 3439
 3440                        // Create the response
 523441                        return Response.FromValue(_value, response);
 3442                    }
 3443                    case 304:
 3444                    {
 03445                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.FilesAndDirectoriesSegment>(re
 3446                    }
 3447                    default:
 3448                    {
 3449                        // Create the result
 23450                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 23451                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 3452
 23453                        throw _value.CreateException(clientDiagnostics, response);
 3454                    }
 3455                }
 3456            }
 3457            #endregion Directory.ListFilesAndDirectoriesSegmentAsync
 3458
 3459            #region Directory.ListHandlesAsync
 3460            /// <summary>
 3461            /// Lists handles for directory.
 3462            /// </summary>
 3463            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 3464            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3465            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3466            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3467            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 3468            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 3469            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3470            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 3471            /// <param name="recursive">Specifies operation should apply to the directory specified in the URI, its file
 3472            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 3473            /// <param name="operationName">Operation name.</param>
 3474            /// <param name="cancellationToken">Cancellation token.</param>
 3475            /// <returns>An enumeration of handles.</returns>
 3476            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.Storag
 3477                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3478                Azure.Core.Pipeline.HttpPipeline pipeline,
 3479                System.Uri resourceUri,
 3480                string version,
 3481                string marker = default,
 3482                int? maxresults = default,
 3483                int? timeout = default,
 3484                string sharesnapshot = default,
 3485                bool? recursive = default,
 3486                bool async = true,
 3487                string operationName = "DirectoryClient.ListHandles",
 3488                System.Threading.CancellationToken cancellationToken = default)
 3489            {
 53490                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 3491                try
 3492                {
 53493                    _scope.AddAttribute("url", resourceUri);
 53494                    _scope.Start();
 53495                    using (Azure.Core.HttpMessage _message = ListHandlesAsync_CreateMessage(
 53496                        pipeline,
 53497                        resourceUri,
 53498                        version,
 53499                        marker,
 53500                        maxresults,
 53501                        timeout,
 53502                        sharesnapshot,
 53503                        recursive))
 3504                    {
 53505                        if (async)
 3506                        {
 3507                            // Send the request asynchronously if we're being called via an async path
 33508                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 3509                        }
 3510                        else
 3511                        {
 3512                            // Send the request synchronously through the API that blocks if we're being called via a sy
 3513                            // (this is safe because the Task will complete before the user can call Wait)
 23514                            pipeline.Send(_message, cancellationToken);
 3515                        }
 53516                        Azure.Response _response = _message.Response;
 53517                        cancellationToken.ThrowIfCancellationRequested();
 53518                        return ListHandlesAsync_CreateResponse(clientDiagnostics, _response);
 3519                    }
 3520                }
 23521                catch (System.Exception ex)
 3522                {
 23523                    _scope.Failed(ex);
 23524                    throw;
 3525                }
 3526                finally
 3527                {
 53528                    _scope.Dispose();
 3529                }
 33530            }
 3531
 3532            /// <summary>
 3533            /// Create the Directory.ListHandlesAsync request.
 3534            /// </summary>
 3535            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3536            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3537            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3538            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 3539            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 3540            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3541            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 3542            /// <param name="recursive">Specifies operation should apply to the directory specified in the URI, its file
 3543            /// <returns>The Directory.ListHandlesAsync Message.</returns>
 3544            internal static Azure.Core.HttpMessage ListHandlesAsync_CreateMessage(
 3545                Azure.Core.Pipeline.HttpPipeline pipeline,
 3546                System.Uri resourceUri,
 3547                string version,
 3548                string marker = default,
 3549                int? maxresults = default,
 3550                int? timeout = default,
 3551                string sharesnapshot = default,
 3552                bool? recursive = default)
 3553            {
 3554                // Validation
 53555                if (resourceUri == null)
 3556                {
 03557                    throw new System.ArgumentNullException(nameof(resourceUri));
 3558                }
 53559                if (version == null)
 3560                {
 03561                    throw new System.ArgumentNullException(nameof(version));
 3562                }
 3563
 3564                // Create the request
 53565                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 53566                Azure.Core.Request _request = _message.Request;
 3567
 3568                // Set the endpoint
 53569                _request.Method = Azure.Core.RequestMethod.Get;
 53570                _request.Uri.Reset(resourceUri);
 53571                _request.Uri.AppendQuery("comp", "listhandles", escapeValue: false);
 03572                if (marker != null) { _request.Uri.AppendQuery("marker", marker); }
 63573                if (maxresults != null) { _request.Uri.AppendQuery("maxresults", maxresults.Value.ToString(System.Global
 03574                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 03575                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 3576
 3577                // Add request headers
 53578                _request.Headers.SetValue("x-ms-version", version);
 53579                if (recursive != null) {
 3580                #pragma warning disable CA1308 // Normalize strings to uppercase
 13581                _request.Headers.SetValue("x-ms-recursive", recursive.Value.ToString(System.Globalization.CultureInfo.In
 3582                #pragma warning restore CA1308 // Normalize strings to uppercase
 3583                }
 3584
 53585                return _message;
 3586            }
 3587
 3588            /// <summary>
 3589            /// Create the Directory.ListHandlesAsync response or throw a failure exception.
 3590            /// </summary>
 3591            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 3592            /// <param name="response">The raw Response.</param>
 3593            /// <returns>The Directory.ListHandlesAsync Azure.Response{Azure.Storage.Files.Shares.Models.StorageHandlesS
 3594            internal static Azure.Response<Azure.Storage.Files.Shares.Models.StorageHandlesSegment> ListHandlesAsync_Cre
 3595                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3596                Azure.Response response)
 3597            {
 3598                // Process the response
 53599                switch (response.Status)
 3600                {
 3601                    case 200:
 3602                    {
 3603                        // Create the result
 33604                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 33605                        Azure.Storage.Files.Shares.Models.StorageHandlesSegment _value = Azure.Storage.Files.Shares.Mode
 3606
 3607                        // Create the response
 33608                        return Response.FromValue(_value, response);
 3609                    }
 3610                    case 304:
 3611                    {
 03612                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.StorageHandlesSegment>(respons
 3613                    }
 3614                    default:
 3615                    {
 3616                        // Create the result
 23617                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 23618                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 3619
 23620                        throw _value.CreateException(clientDiagnostics, response);
 3621                    }
 3622                }
 3623            }
 3624            #endregion Directory.ListHandlesAsync
 3625
 3626            #region Directory.ForceCloseHandlesAsync
 3627            /// <summary>
 3628            /// Closes all handles open for given directory.
 3629            /// </summary>
 3630            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 3631            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3632            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3633            /// <param name="handleId">Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) 
 3634            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3635            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3636            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 3637            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 3638            /// <param name="recursive">Specifies operation should apply to the directory specified in the URI, its file
 3639            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 3640            /// <param name="operationName">Operation name.</param>
 3641            /// <param name="cancellationToken">Cancellation token.</param>
 3642            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.StorageClosedHandlesSegment}</returns>
 3643            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.Storag
 3644                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3645                Azure.Core.Pipeline.HttpPipeline pipeline,
 3646                System.Uri resourceUri,
 3647                string handleId,
 3648                string version,
 3649                int? timeout = default,
 3650                string marker = default,
 3651                string sharesnapshot = default,
 3652                bool? recursive = default,
 3653                bool async = true,
 3654                string operationName = "DirectoryClient.ForceCloseHandles",
 3655                System.Threading.CancellationToken cancellationToken = default)
 3656            {
 83657                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 3658                try
 3659                {
 83660                    _scope.AddAttribute("url", resourceUri);
 83661                    _scope.Start();
 83662                    using (Azure.Core.HttpMessage _message = ForceCloseHandlesAsync_CreateMessage(
 83663                        pipeline,
 83664                        resourceUri,
 83665                        handleId,
 83666                        version,
 83667                        timeout,
 83668                        marker,
 83669                        sharesnapshot,
 83670                        recursive))
 3671                    {
 83672                        if (async)
 3673                        {
 3674                            // Send the request asynchronously if we're being called via an async path
 43675                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 3676                        }
 3677                        else
 3678                        {
 3679                            // Send the request synchronously through the API that blocks if we're being called via a sy
 3680                            // (this is safe because the Task will complete before the user can call Wait)
 43681                            pipeline.Send(_message, cancellationToken);
 3682                        }
 83683                        Azure.Response _response = _message.Response;
 83684                        cancellationToken.ThrowIfCancellationRequested();
 83685                        return ForceCloseHandlesAsync_CreateResponse(clientDiagnostics, _response);
 3686                    }
 3687                }
 43688                catch (System.Exception ex)
 3689                {
 43690                    _scope.Failed(ex);
 43691                    throw;
 3692                }
 3693                finally
 3694                {
 83695                    _scope.Dispose();
 3696                }
 43697            }
 3698
 3699            /// <summary>
 3700            /// Create the Directory.ForceCloseHandlesAsync request.
 3701            /// </summary>
 3702            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3703            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3704            /// <param name="handleId">Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) 
 3705            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3706            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3707            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 3708            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 3709            /// <param name="recursive">Specifies operation should apply to the directory specified in the URI, its file
 3710            /// <returns>The Directory.ForceCloseHandlesAsync Message.</returns>
 3711            internal static Azure.Core.HttpMessage ForceCloseHandlesAsync_CreateMessage(
 3712                Azure.Core.Pipeline.HttpPipeline pipeline,
 3713                System.Uri resourceUri,
 3714                string handleId,
 3715                string version,
 3716                int? timeout = default,
 3717                string marker = default,
 3718                string sharesnapshot = default,
 3719                bool? recursive = default)
 3720            {
 3721                // Validation
 83722                if (resourceUri == null)
 3723                {
 03724                    throw new System.ArgumentNullException(nameof(resourceUri));
 3725                }
 83726                if (handleId == null)
 3727                {
 03728                    throw new System.ArgumentNullException(nameof(handleId));
 3729                }
 83730                if (version == null)
 3731                {
 03732                    throw new System.ArgumentNullException(nameof(version));
 3733                }
 3734
 3735                // Create the request
 83736                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 83737                Azure.Core.Request _request = _message.Request;
 3738
 3739                // Set the endpoint
 83740                _request.Method = Azure.Core.RequestMethod.Put;
 83741                _request.Uri.Reset(resourceUri);
 83742                _request.Uri.AppendQuery("comp", "forceclosehandles", escapeValue: false);
 03743                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 03744                if (marker != null) { _request.Uri.AppendQuery("marker", marker); }
 03745                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 3746
 3747                // Add request headers
 83748                _request.Headers.SetValue("x-ms-handle-id", handleId);
 83749                _request.Headers.SetValue("x-ms-version", version);
 83750                if (recursive != null) {
 3751                #pragma warning disable CA1308 // Normalize strings to uppercase
 23752                _request.Headers.SetValue("x-ms-recursive", recursive.Value.ToString(System.Globalization.CultureInfo.In
 3753                #pragma warning restore CA1308 // Normalize strings to uppercase
 3754                }
 3755
 83756                return _message;
 3757            }
 3758
 3759            /// <summary>
 3760            /// Create the Directory.ForceCloseHandlesAsync response or throw a failure exception.
 3761            /// </summary>
 3762            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 3763            /// <param name="response">The raw Response.</param>
 3764            /// <returns>The Directory.ForceCloseHandlesAsync Azure.Response{Azure.Storage.Files.Shares.Models.StorageCl
 3765            internal static Azure.Response<Azure.Storage.Files.Shares.Models.StorageClosedHandlesSegment> ForceCloseHand
 3766                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3767                Azure.Response response)
 3768            {
 3769                // Process the response
 83770                switch (response.Status)
 3771                {
 3772                    case 200:
 3773                    {
 3774                        // Create the result
 43775                        Azure.Storage.Files.Shares.Models.StorageClosedHandlesSegment _value = new Azure.Storage.Files.S
 3776
 3777                        // Get response headers
 3778                        string _header;
 43779                        if (response.Headers.TryGetValue("x-ms-marker", out _header))
 3780                        {
 03781                            _value.Marker = _header;
 3782                        }
 43783                        if (response.Headers.TryGetValue("x-ms-number-of-handles-closed", out _header))
 3784                        {
 43785                            _value.NumberOfHandlesClosed = int.Parse(_header, System.Globalization.CultureInfo.Invariant
 3786                        }
 43787                        if (response.Headers.TryGetValue("x-ms-number-of-handles-failed", out _header))
 3788                        {
 43789                            _value.NumberOfHandlesFailedToClose = int.Parse(_header, System.Globalization.CultureInfo.In
 3790                        }
 3791
 3792                        // Create the response
 43793                        return Response.FromValue(_value, response);
 3794                    }
 3795                    default:
 3796                    {
 3797                        // Create the result
 43798                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 43799                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 3800
 43801                        throw _value.CreateException(clientDiagnostics, response);
 3802                    }
 3803                }
 3804            }
 3805            #endregion Directory.ForceCloseHandlesAsync
 3806        }
 3807        #endregion Directory operations
 3808
 3809        #region File operations
 3810        /// <summary>
 3811        /// File operations for Azure File Storage
 3812        /// </summary>
 3813        public static partial class File
 3814        {
 3815            #region File.CreateAsync
 3816            /// <summary>
 3817            /// Creates a new file or replaces a file. Note it only initializes the file with no content.
 3818            /// </summary>
 3819            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 3820            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3821            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3822            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3823            /// <param name="fileContentLength">Specifies the maximum size for the file, up to 1 TB.</param>
 3824            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 3825            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 3826            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 3827            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3828            /// <param name="fileContentType">Sets the MIME content type of the file. The default type is 'application/o
 3829            /// <param name="fileContentEncoding">Specifies which content encodings have been applied to the file.</para
 3830            /// <param name="fileContentLanguage">Specifies the natural languages used by this resource.</param>
 3831            /// <param name="fileCacheControl">Sets the file's cache control. The File service stores this value but doe
 3832            /// <param name="fileContentHash">Sets the file's MD5 hash.</param>
 3833            /// <param name="fileContentDisposition">Sets the file's Content-Disposition header.</param>
 3834            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 3835            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 3836            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 3837            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 3838            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 3839            /// <param name="operationName">Operation name.</param>
 3840            /// <param name="cancellationToken">Cancellation token.</param>
 3841            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileInfo}</returns>
 3842            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 3843                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 3844                Azure.Core.Pipeline.HttpPipeline pipeline,
 3845                System.Uri resourceUri,
 3846                string version,
 3847                long fileContentLength,
 3848                string fileAttributes,
 3849                string fileCreationTime,
 3850                string fileLastWriteTime,
 3851                int? timeout = default,
 3852                string fileContentType = default,
 3853                System.Collections.Generic.IEnumerable<string> fileContentEncoding = default,
 3854                System.Collections.Generic.IEnumerable<string> fileContentLanguage = default,
 3855                string fileCacheControl = default,
 3856                byte[] fileContentHash = default,
 3857                string fileContentDisposition = default,
 3858                System.Collections.Generic.IDictionary<string, string> metadata = default,
 3859                string filePermission = default,
 3860                string filePermissionKey = default,
 3861                string leaseId = default,
 3862                bool async = true,
 3863                string operationName = "FileClient.Create",
 3864                System.Threading.CancellationToken cancellationToken = default)
 3865            {
 2463866                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 3867                try
 3868                {
 2463869                    _scope.AddAttribute("url", resourceUri);
 2463870                    _scope.Start();
 2463871                    using (Azure.Core.HttpMessage _message = CreateAsync_CreateMessage(
 2463872                        pipeline,
 2463873                        resourceUri,
 2463874                        version,
 2463875                        fileContentLength,
 2463876                        fileAttributes,
 2463877                        fileCreationTime,
 2463878                        fileLastWriteTime,
 2463879                        timeout,
 2463880                        fileContentType,
 2463881                        fileContentEncoding,
 2463882                        fileContentLanguage,
 2463883                        fileCacheControl,
 2463884                        fileContentHash,
 2463885                        fileContentDisposition,
 2463886                        metadata,
 2463887                        filePermission,
 2463888                        filePermissionKey,
 2463889                        leaseId))
 3890                    {
 2463891                        if (async)
 3892                        {
 3893                            // Send the request asynchronously if we're being called via an async path
 1233894                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 3895                        }
 3896                        else
 3897                        {
 3898                            // Send the request synchronously through the API that blocks if we're being called via a sy
 3899                            // (this is safe because the Task will complete before the user can call Wait)
 1233900                            pipeline.Send(_message, cancellationToken);
 3901                        }
 2463902                        Azure.Response _response = _message.Response;
 2463903                        cancellationToken.ThrowIfCancellationRequested();
 2463904                        return CreateAsync_CreateResponse(clientDiagnostics, _response);
 3905                    }
 3906                }
 43907                catch (System.Exception ex)
 3908                {
 43909                    _scope.Failed(ex);
 43910                    throw;
 3911                }
 3912                finally
 3913                {
 2463914                    _scope.Dispose();
 3915                }
 2423916            }
 3917
 3918            /// <summary>
 3919            /// Create the File.CreateAsync request.
 3920            /// </summary>
 3921            /// <param name="pipeline">The pipeline used for sending requests.</param>
 3922            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 3923            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 3924            /// <param name="fileContentLength">Specifies the maximum size for the file, up to 1 TB.</param>
 3925            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 3926            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 3927            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 3928            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 3929            /// <param name="fileContentType">Sets the MIME content type of the file. The default type is 'application/o
 3930            /// <param name="fileContentEncoding">Specifies which content encodings have been applied to the file.</para
 3931            /// <param name="fileContentLanguage">Specifies the natural languages used by this resource.</param>
 3932            /// <param name="fileCacheControl">Sets the file's cache control. The File service stores this value but doe
 3933            /// <param name="fileContentHash">Sets the file's MD5 hash.</param>
 3934            /// <param name="fileContentDisposition">Sets the file's Content-Disposition header.</param>
 3935            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 3936            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 3937            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 3938            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 3939            /// <returns>The File.CreateAsync Message.</returns>
 3940            internal static Azure.Core.HttpMessage CreateAsync_CreateMessage(
 3941                Azure.Core.Pipeline.HttpPipeline pipeline,
 3942                System.Uri resourceUri,
 3943                string version,
 3944                long fileContentLength,
 3945                string fileAttributes,
 3946                string fileCreationTime,
 3947                string fileLastWriteTime,
 3948                int? timeout = default,
 3949                string fileContentType = default,
 3950                System.Collections.Generic.IEnumerable<string> fileContentEncoding = default,
 3951                System.Collections.Generic.IEnumerable<string> fileContentLanguage = default,
 3952                string fileCacheControl = default,
 3953                byte[] fileContentHash = default,
 3954                string fileContentDisposition = default,
 3955                System.Collections.Generic.IDictionary<string, string> metadata = default,
 3956                string filePermission = default,
 3957                string filePermissionKey = default,
 3958                string leaseId = default)
 3959            {
 3960                // Validation
 2463961                if (resourceUri == null)
 3962                {
 03963                    throw new System.ArgumentNullException(nameof(resourceUri));
 3964                }
 2463965                if (version == null)
 3966                {
 03967                    throw new System.ArgumentNullException(nameof(version));
 3968                }
 2463969                if (fileAttributes == null)
 3970                {
 03971                    throw new System.ArgumentNullException(nameof(fileAttributes));
 3972                }
 2463973                if (fileCreationTime == null)
 3974                {
 03975                    throw new System.ArgumentNullException(nameof(fileCreationTime));
 3976                }
 2463977                if (fileLastWriteTime == null)
 3978                {
 03979                    throw new System.ArgumentNullException(nameof(fileLastWriteTime));
 3980                }
 3981
 3982                // Create the request
 2463983                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 2463984                Azure.Core.Request _request = _message.Request;
 3985
 3986                // Set the endpoint
 2463987                _request.Method = Azure.Core.RequestMethod.Put;
 2463988                _request.Uri.Reset(resourceUri);
 03989                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 3990
 3991                // Add request headers
 2463992                _request.Headers.SetValue("x-ms-version", version);
 2463993                _request.Headers.SetValue("x-ms-content-length", fileContentLength.ToString(System.Globalization.Culture
 2463994                _request.Headers.SetValue("x-ms-type", "file");
 2463995                _request.Headers.SetValue("x-ms-file-attributes", fileAttributes);
 2463996                _request.Headers.SetValue("x-ms-file-creation-time", fileCreationTime);
 2463997                _request.Headers.SetValue("x-ms-file-last-write-time", fileLastWriteTime);
 2483998                if (fileContentType != null) { _request.Headers.SetValue("x-ms-content-type", fileContentType); }
 2463999                if (fileContentEncoding != null) {
 84000                    foreach (string _item in fileContentEncoding)
 4001                    {
 24002                        _request.Headers.SetValue("x-ms-content-encoding", _item);
 4003                    }
 4004                }
 2464005                if (fileContentLanguage != null) {
 84006                    foreach (string _item in fileContentLanguage)
 4007                    {
 24008                        _request.Headers.SetValue("x-ms-content-language", _item);
 4009                    }
 4010                }
 2484011                if (fileCacheControl != null) { _request.Headers.SetValue("x-ms-cache-control", fileCacheControl); }
 2484012                if (fileContentHash != null) { _request.Headers.SetValue("x-ms-content-md5", System.Convert.ToBase64Stri
 2484013                if (fileContentDisposition != null) { _request.Headers.SetValue("x-ms-content-disposition", fileContentD
 2464014                if (metadata != null) {
 204015                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 4016                    {
 84017                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 4018                    }
 4019                }
 4904020                if (filePermission != null) { _request.Headers.SetValue("x-ms-file-permission", filePermission); }
 2484021                if (filePermissionKey != null) { _request.Headers.SetValue("x-ms-file-permission-key", filePermissionKey
 2504022                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 4023
 2464024                return _message;
 4025            }
 4026
 4027            /// <summary>
 4028            /// Create the File.CreateAsync response or throw a failure exception.
 4029            /// </summary>
 4030            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 4031            /// <param name="response">The raw Response.</param>
 4032            /// <returns>The File.CreateAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileInfo}.</ret
 4033            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageFileInfo> CreateAsync_CreateRespo
 4034                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4035                Azure.Response response)
 4036            {
 4037                // Process the response
 2464038                switch (response.Status)
 4039                {
 4040                    case 201:
 4041                    {
 4042                        // Create the result
 2424043                        Azure.Storage.Files.Shares.Models.RawStorageFileInfo _value = new Azure.Storage.Files.Shares.Mod
 4044
 4045                        // Get response headers
 4046                        string _header;
 2424047                        if (response.Headers.TryGetValue("ETag", out _header))
 4048                        {
 2424049                            _value.ETag = new Azure.ETag(_header);
 4050                        }
 2424051                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 4052                        {
 2424053                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 4054                        }
 2424055                        if (response.Headers.TryGetValue("x-ms-request-server-encrypted", out _header))
 4056                        {
 2424057                            _value.IsServerEncrypted = bool.Parse(_header);
 4058                        }
 2424059                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 4060                        {
 2424061                            _value.FilePermissionKey = _header;
 4062                        }
 2424063                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 4064                        {
 2424065                            _value.FileAttributes = _header;
 4066                        }
 2424067                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 4068                        {
 2424069                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 4070                        }
 2424071                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 4072                        {
 2424073                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 4074                        }
 2424075                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 4076                        {
 2424077                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 4078                        }
 2424079                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 4080                        {
 2424081                            _value.FileId = _header;
 4082                        }
 2424083                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 4084                        {
 2424085                            _value.FileParentId = _header;
 4086                        }
 4087
 4088                        // Create the response
 2424089                        return Response.FromValue(_value, response);
 4090                    }
 4091                    default:
 4092                    {
 4093                        // Create the result
 44094                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 44095                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 4096
 44097                        throw _value.CreateException(clientDiagnostics, response);
 4098                    }
 4099                }
 4100            }
 4101            #endregion File.CreateAsync
 4102
 4103            #region File.DownloadAsync
 4104            /// <summary>
 4105            /// Reads or downloads a file from the system, including its metadata and properties.
 4106            /// </summary>
 4107            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 4108            /// <param name="pipeline">The pipeline used for sending requests.</param>
 4109            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 4110            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 4111            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 4112            /// <param name="range">Return file data only from the specified byte range.</param>
 4113            /// <param name="rangeGetContentHash">When this header is set to true and specified together with the Range 
 4114            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 4115            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 4116            /// <param name="operationName">Operation name.</param>
 4117            /// <param name="cancellationToken">Cancellation token.</param>
 4118            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.FlattenedStorageFileProperties}</returns>
 4119            public static async System.Threading.Tasks.ValueTask<(Azure.Response<Azure.Storage.Files.Shares.Models.Flatt
 4120                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4121                Azure.Core.Pipeline.HttpPipeline pipeline,
 4122                System.Uri resourceUri,
 4123                string version,
 4124                int? timeout = default,
 4125                string range = default,
 4126                bool? rangeGetContentHash = default,
 4127                string leaseId = default,
 4128                bool async = true,
 4129                string operationName = "FileClient.Download",
 4130                System.Threading.CancellationToken cancellationToken = default)
 4131            {
 684132                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 4133                try
 4134                {
 684135                    _scope.AddAttribute("url", resourceUri);
 684136                    _scope.Start();
 684137                    using (Azure.Core.HttpMessage _message = DownloadAsync_CreateMessage(
 684138                        pipeline,
 684139                        resourceUri,
 684140                        version,
 684141                        timeout,
 684142                        range,
 684143                        rangeGetContentHash,
 684144                        leaseId))
 4145                    {
 4146                        // Avoid buffering if stream is going to be returned to the caller
 684147                        _message.BufferResponse = false;
 684148                        if (async)
 4149                        {
 4150                            // Send the request asynchronously if we're being called via an async path
 504151                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 4152                        }
 4153                        else
 4154                        {
 4155                            // Send the request synchronously through the API that blocks if we're being called via a sy
 4156                            // (this is safe because the Task will complete before the user can call Wait)
 184157                            pipeline.Send(_message, cancellationToken);
 4158                        }
 684159                        Azure.Response _response = _message.Response;
 684160                        cancellationToken.ThrowIfCancellationRequested();
 684161                        return (DownloadAsync_CreateResponse(clientDiagnostics, _response), _message.ExtractResponseCont
 4162                    }
 4163                }
 64164                catch (System.Exception ex)
 4165                {
 64166                    _scope.Failed(ex);
 64167                    throw;
 4168                }
 4169                finally
 4170                {
 684171                    _scope.Dispose();
 4172                }
 624173            }
 4174
 4175            /// <summary>
 4176            /// Create the File.DownloadAsync request.
 4177            /// </summary>
 4178            /// <param name="pipeline">The pipeline used for sending requests.</param>
 4179            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 4180            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 4181            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 4182            /// <param name="range">Return file data only from the specified byte range.</param>
 4183            /// <param name="rangeGetContentHash">When this header is set to true and specified together with the Range 
 4184            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 4185            /// <returns>The File.DownloadAsync Message.</returns>
 4186            internal static Azure.Core.HttpMessage DownloadAsync_CreateMessage(
 4187                Azure.Core.Pipeline.HttpPipeline pipeline,
 4188                System.Uri resourceUri,
 4189                string version,
 4190                int? timeout = default,
 4191                string range = default,
 4192                bool? rangeGetContentHash = default,
 4193                string leaseId = default)
 4194            {
 4195                // Validation
 684196                if (resourceUri == null)
 4197                {
 04198                    throw new System.ArgumentNullException(nameof(resourceUri));
 4199                }
 684200                if (version == null)
 4201                {
 04202                    throw new System.ArgumentNullException(nameof(version));
 4203                }
 4204
 4205                // Create the request
 684206                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 684207                Azure.Core.Request _request = _message.Request;
 4208
 4209                // Set the endpoint
 684210                _request.Method = Azure.Core.RequestMethod.Get;
 684211                _request.Uri.Reset(resourceUri);
 04212                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 4213
 4214                // Add request headers
 684215                _request.Headers.SetValue("x-ms-version", version);
 1364216                if (range != null) { _request.Headers.SetValue("x-ms-range", range); }
 684217                if (rangeGetContentHash != null) {
 4218                #pragma warning disable CA1308 // Normalize strings to uppercase
 04219                _request.Headers.SetValue("x-ms-range-get-content-md5", rangeGetContentHash.Value.ToString(System.Global
 4220                #pragma warning restore CA1308 // Normalize strings to uppercase
 4221                }
 764222                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 4223
 684224                return _message;
 4225            }
 4226
 4227            /// <summary>
 4228            /// Create the File.DownloadAsync response or throw a failure exception.
 4229            /// </summary>
 4230            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 4231            /// <param name="response">The raw Response.</param>
 4232            /// <returns>The File.DownloadAsync Azure.Response{Azure.Storage.Files.Shares.Models.FlattenedStorageFilePro
 4233            internal static Azure.Response<Azure.Storage.Files.Shares.Models.FlattenedStorageFileProperties> DownloadAsy
 4234                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4235                Azure.Response response)
 4236            {
 4237                // Process the response
 684238                switch (response.Status)
 4239                {
 4240                    case 200:
 4241                    {
 4242                        // Create the result
 04243                        Azure.Storage.Files.Shares.Models.FlattenedStorageFileProperties _value = new Azure.Storage.File
 04244                        _value.Content = response.ContentStream; // You should manually wrap with RetriableStream!
 4245
 4246                        // Get response headers
 4247                        string _header;
 04248                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 4249                        {
 04250                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 4251                        }
 04252                        _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringCompare
 04253                        foreach (Azure.Core.HttpHeader _headerPair in response.Headers)
 4254                        {
 04255                            if (_headerPair.Name.StartsWith("x-ms-meta-", System.StringComparison.InvariantCulture))
 4256                            {
 04257                                _value.Metadata[_headerPair.Name.Substring(10)] = _headerPair.Value;
 4258                            }
 4259                        }
 04260                        if (response.Headers.TryGetValue("Content-Length", out _header))
 4261                        {
 04262                            _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture
 4263                        }
 04264                        if (response.Headers.TryGetValue("Content-Type", out _header))
 4265                        {
 04266                            _value.ContentType = _header;
 4267                        }
 04268                        if (response.Headers.TryGetValue("Content-Range", out _header))
 4269                        {
 04270                            _value.ContentRange = _header;
 4271                        }
 04272                        if (response.Headers.TryGetValue("ETag", out _header))
 4273                        {
 04274                            _value.ETag = new Azure.ETag(_header);
 4275                        }
 04276                        if (response.Headers.TryGetValue("Content-MD5", out _header))
 4277                        {
 04278                            _value.ContentHash = System.Convert.FromBase64String(_header);
 4279                        }
 04280                        if (response.Headers.TryGetValue("Content-Encoding", out _header))
 4281                        {
 04282                            _value.ContentEncoding = (_header ?? "").Split(',');
 4283                        }
 04284                        if (response.Headers.TryGetValue("Cache-Control", out _header))
 4285                        {
 04286                            _value.CacheControl = _header;
 4287                        }
 04288                        if (response.Headers.TryGetValue("Content-Disposition", out _header))
 4289                        {
 04290                            _value.ContentDisposition = _header;
 4291                        }
 04292                        if (response.Headers.TryGetValue("Content-Language", out _header))
 4293                        {
 04294                            _value.ContentLanguage = (_header ?? "").Split(',');
 4295                        }
 04296                        if (response.Headers.TryGetValue("Accept-Ranges", out _header))
 4297                        {
 04298                            _value.AcceptRanges = _header;
 4299                        }
 04300                        if (response.Headers.TryGetValue("x-ms-copy-completion-time", out _header))
 4301                        {
 04302                            _value.CopyCompletionTime = System.DateTimeOffset.Parse(_header, System.Globalization.Cultur
 4303                        }
 04304                        if (response.Headers.TryGetValue("x-ms-copy-status-description", out _header))
 4305                        {
 04306                            _value.CopyStatusDescription = _header;
 4307                        }
 04308                        if (response.Headers.TryGetValue("x-ms-copy-id", out _header))
 4309                        {
 04310                            _value.CopyId = _header;
 4311                        }
 04312                        if (response.Headers.TryGetValue("x-ms-copy-progress", out _header))
 4313                        {
 04314                            _value.CopyProgress = _header;
 4315                        }
 04316                        if (response.Headers.TryGetValue("x-ms-copy-source", out _header))
 4317                        {
 04318                            _value.CopySource = new System.Uri(_header);
 4319                        }
 04320                        if (response.Headers.TryGetValue("x-ms-copy-status", out _header))
 4321                        {
 04322                            _value.CopyStatus = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseCopyStatus(
 4323                        }
 04324                        if (response.Headers.TryGetValue("x-ms-content-md5", out _header))
 4325                        {
 04326                            _value.FileContentHash = System.Convert.FromBase64String(_header);
 4327                        }
 04328                        if (response.Headers.TryGetValue("x-ms-server-encrypted", out _header))
 4329                        {
 04330                            _value.IsServerEncrypted = bool.Parse(_header);
 4331                        }
 04332                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 4333                        {
 04334                            _value.FileAttributes = _header;
 4335                        }
 04336                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 4337                        {
 04338                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 4339                        }
 04340                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 4341                        {
 04342                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 4343                        }
 04344                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 4345                        {
 04346                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 4347                        }
 04348                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 4349                        {
 04350                            _value.FilePermissionKey = _header;
 4351                        }
 04352                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 4353                        {
 04354                            _value.FileId = _header;
 4355                        }
 04356                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 4357                        {
 04358                            _value.FileParentId = _header;
 4359                        }
 04360                        if (response.Headers.TryGetValue("x-ms-lease-duration", out _header))
 4361                        {
 04362                            _value.LeaseDuration = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLea
 4363                        }
 04364                        if (response.Headers.TryGetValue("x-ms-lease-state", out _header))
 4365                        {
 04366                            _value.LeaseState = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLeaseS
 4367                        }
 04368                        if (response.Headers.TryGetValue("x-ms-lease-status", out _header))
 4369                        {
 04370                            _value.LeaseStatus = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLease
 4371                        }
 4372
 4373                        // Create the response
 04374                        return Response.FromValue(_value, response);
 4375                    }
 4376                    case 206:
 4377                    {
 4378                        // Create the result
 624379                        Azure.Storage.Files.Shares.Models.FlattenedStorageFileProperties _value = new Azure.Storage.File
 624380                        _value.Content = response.ContentStream; // You should manually wrap with RetriableStream!
 4381
 4382                        // Get response headers
 4383                        string _header;
 624384                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 4385                        {
 624386                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 4387                        }
 624388                        _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringCompare
 29924389                        foreach (Azure.Core.HttpHeader _headerPair in response.Headers)
 4390                        {
 14344391                            if (_headerPair.Name.StartsWith("x-ms-meta-", System.StringComparison.InvariantCulture))
 4392                            {
 04393                                _value.Metadata[_headerPair.Name.Substring(10)] = _headerPair.Value;
 4394                            }
 4395                        }
 624396                        if (response.Headers.TryGetValue("Content-Length", out _header))
 4397                        {
 624398                            _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture
 4399                        }
 624400                        if (response.Headers.TryGetValue("Content-Type", out _header))
 4401                        {
 624402                            _value.ContentType = _header;
 4403                        }
 624404                        if (response.Headers.TryGetValue("Content-Range", out _header))
 4405                        {
 624406                            _value.ContentRange = _header;
 4407                        }
 624408                        if (response.Headers.TryGetValue("ETag", out _header))
 4409                        {
 624410                            _value.ETag = new Azure.ETag(_header);
 4411                        }
 624412                        if (response.Headers.TryGetValue("Content-MD5", out _header))
 4413                        {
 04414                            _value.ContentHash = System.Convert.FromBase64String(_header);
 4415                        }
 624416                        if (response.Headers.TryGetValue("Content-Encoding", out _header))
 4417                        {
 04418                            _value.ContentEncoding = (_header ?? "").Split(',');
 4419                        }
 624420                        if (response.Headers.TryGetValue("Cache-Control", out _header))
 4421                        {
 04422                            _value.CacheControl = _header;
 4423                        }
 624424                        if (response.Headers.TryGetValue("Content-Disposition", out _header))
 4425                        {
 04426                            _value.ContentDisposition = _header;
 4427                        }
 624428                        if (response.Headers.TryGetValue("Content-Language", out _header))
 4429                        {
 04430                            _value.ContentLanguage = (_header ?? "").Split(',');
 4431                        }
 624432                        if (response.Headers.TryGetValue("Accept-Ranges", out _header))
 4433                        {
 624434                            _value.AcceptRanges = _header;
 4435                        }
 624436                        if (response.Headers.TryGetValue("x-ms-copy-completion-time", out _header))
 4437                        {
 04438                            _value.CopyCompletionTime = System.DateTimeOffset.Parse(_header, System.Globalization.Cultur
 4439                        }
 624440                        if (response.Headers.TryGetValue("x-ms-copy-status-description", out _header))
 4441                        {
 04442                            _value.CopyStatusDescription = _header;
 4443                        }
 624444                        if (response.Headers.TryGetValue("x-ms-copy-id", out _header))
 4445                        {
 04446                            _value.CopyId = _header;
 4447                        }
 624448                        if (response.Headers.TryGetValue("x-ms-copy-progress", out _header))
 4449                        {
 04450                            _value.CopyProgress = _header;
 4451                        }
 624452                        if (response.Headers.TryGetValue("x-ms-copy-source", out _header))
 4453                        {
 04454                            _value.CopySource = new System.Uri(_header);
 4455                        }
 624456                        if (response.Headers.TryGetValue("x-ms-copy-status", out _header))
 4457                        {
 04458                            _value.CopyStatus = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseCopyStatus(
 4459                        }
 624460                        if (response.Headers.TryGetValue("x-ms-content-md5", out _header))
 4461                        {
 04462                            _value.FileContentHash = System.Convert.FromBase64String(_header);
 4463                        }
 624464                        if (response.Headers.TryGetValue("x-ms-server-encrypted", out _header))
 4465                        {
 624466                            _value.IsServerEncrypted = bool.Parse(_header);
 4467                        }
 624468                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 4469                        {
 624470                            _value.FileAttributes = _header;
 4471                        }
 624472                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 4473                        {
 624474                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 4475                        }
 624476                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 4477                        {
 624478                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 4479                        }
 624480                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 4481                        {
 624482                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 4483                        }
 624484                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 4485                        {
 624486                            _value.FilePermissionKey = _header;
 4487                        }
 624488                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 4489                        {
 624490                            _value.FileId = _header;
 4491                        }
 624492                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 4493                        {
 624494                            _value.FileParentId = _header;
 4495                        }
 624496                        if (response.Headers.TryGetValue("x-ms-lease-duration", out _header))
 4497                        {
 84498                            _value.LeaseDuration = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLea
 4499                        }
 624500                        if (response.Headers.TryGetValue("x-ms-lease-state", out _header))
 4501                        {
 624502                            _value.LeaseState = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLeaseS
 4503                        }
 624504                        if (response.Headers.TryGetValue("x-ms-lease-status", out _header))
 4505                        {
 624506                            _value.LeaseStatus = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLease
 4507                        }
 4508
 4509                        // Create the response
 624510                        return Response.FromValue(_value, response);
 4511                    }
 4512                    case 304:
 4513                    {
 04514                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.FlattenedStorageFileProperties
 4515                    }
 4516                    default:
 4517                    {
 4518                        // Create the result
 64519                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 64520                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 4521
 64522                        throw _value.CreateException(clientDiagnostics, response);
 4523                    }
 4524                }
 4525            }
 4526            #endregion File.DownloadAsync
 4527
 4528            #region File.GetPropertiesAsync
 4529            /// <summary>
 4530            /// Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does
 4531            /// </summary>
 4532            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 4533            /// <param name="pipeline">The pipeline used for sending requests.</param>
 4534            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 4535            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 4536            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 4537            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 4538            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 4539            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 4540            /// <param name="operationName">Operation name.</param>
 4541            /// <param name="cancellationToken">Cancellation token.</param>
 4542            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileProperties}</returns>
 4543            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 4544                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4545                Azure.Core.Pipeline.HttpPipeline pipeline,
 4546                System.Uri resourceUri,
 4547                string version,
 4548                string sharesnapshot = default,
 4549                int? timeout = default,
 4550                string leaseId = default,
 4551                bool async = true,
 4552                string operationName = "FileClient.GetProperties",
 4553                System.Threading.CancellationToken cancellationToken = default)
 4554            {
 884555                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 4556                try
 4557                {
 884558                    _scope.AddAttribute("url", resourceUri);
 884559                    _scope.Start();
 884560                    using (Azure.Core.HttpMessage _message = GetPropertiesAsync_CreateMessage(
 884561                        pipeline,
 884562                        resourceUri,
 884563                        version,
 884564                        sharesnapshot,
 884565                        timeout,
 884566                        leaseId))
 4567                    {
 884568                        if (async)
 4569                        {
 4570                            // Send the request asynchronously if we're being called via an async path
 554571                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 4572                        }
 4573                        else
 4574                        {
 4575                            // Send the request synchronously through the API that blocks if we're being called via a sy
 4576                            // (this is safe because the Task will complete before the user can call Wait)
 334577                            pipeline.Send(_message, cancellationToken);
 4578                        }
 884579                        Azure.Response _response = _message.Response;
 884580                        cancellationToken.ThrowIfCancellationRequested();
 884581                        return GetPropertiesAsync_CreateResponse(clientDiagnostics, _response);
 4582                    }
 4583                }
 144584                catch (System.Exception ex)
 4585                {
 144586                    _scope.Failed(ex);
 144587                    throw;
 4588                }
 4589                finally
 4590                {
 884591                    _scope.Dispose();
 4592                }
 744593            }
 4594
 4595            /// <summary>
 4596            /// Create the File.GetPropertiesAsync request.
 4597            /// </summary>
 4598            /// <param name="pipeline">The pipeline used for sending requests.</param>
 4599            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 4600            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 4601            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 4602            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 4603            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 4604            /// <returns>The File.GetPropertiesAsync Message.</returns>
 4605            internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage(
 4606                Azure.Core.Pipeline.HttpPipeline pipeline,
 4607                System.Uri resourceUri,
 4608                string version,
 4609                string sharesnapshot = default,
 4610                int? timeout = default,
 4611                string leaseId = default)
 4612            {
 4613                // Validation
 884614                if (resourceUri == null)
 4615                {
 04616                    throw new System.ArgumentNullException(nameof(resourceUri));
 4617                }
 884618                if (version == null)
 4619                {
 04620                    throw new System.ArgumentNullException(nameof(version));
 4621                }
 4622
 4623                // Create the request
 884624                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 884625                Azure.Core.Request _request = _message.Request;
 4626
 4627                // Set the endpoint
 884628                _request.Method = Azure.Core.RequestMethod.Head;
 884629                _request.Uri.Reset(resourceUri);
 04630                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 04631                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 4632
 4633                // Add request headers
 884634                _request.Headers.SetValue("x-ms-version", version);
 924635                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 4636
 884637                return _message;
 4638            }
 4639
 4640            /// <summary>
 4641            /// Create the File.GetPropertiesAsync response or throw a failure exception.
 4642            /// </summary>
 4643            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 4644            /// <param name="response">The raw Response.</param>
 4645            /// <returns>The File.GetPropertiesAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileProp
 4646            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageFileProperties> GetPropertiesAsyn
 4647                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4648                Azure.Response response)
 4649            {
 4650                // Process the response
 884651                switch (response.Status)
 4652                {
 4653                    case 200:
 4654                    {
 4655                        // Create the result
 744656                        Azure.Storage.Files.Shares.Models.RawStorageFileProperties _value = new Azure.Storage.Files.Shar
 4657
 4658                        // Get response headers
 4659                        string _header;
 744660                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 4661                        {
 744662                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 4663                        }
 744664                        _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringCompare
 33804665                        foreach (Azure.Core.HttpHeader _headerPair in response.Headers)
 4666                        {
 16164667                            if (_headerPair.Name.StartsWith("x-ms-meta-", System.StringComparison.InvariantCulture))
 4668                            {
 404669                                _value.Metadata[_headerPair.Name.Substring(10)] = _headerPair.Value;
 4670                            }
 4671                        }
 744672                        if (response.Headers.TryGetValue("Content-Length", out _header))
 4673                        {
 744674                            _value.ContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture
 4675                        }
 744676                        if (response.Headers.TryGetValue("Content-Type", out _header))
 4677                        {
 744678                            _value.ContentType = _header;
 4679                        }
 744680                        if (response.Headers.TryGetValue("ETag", out _header))
 4681                        {
 744682                            _value.ETag = new Azure.ETag(_header);
 4683                        }
 744684                        if (response.Headers.TryGetValue("Content-MD5", out _header))
 4685                        {
 44686                            _value.ContentHash = System.Convert.FromBase64String(_header);
 4687                        }
 744688                        if (response.Headers.TryGetValue("Content-Encoding", out _header))
 4689                        {
 44690                            _value.ContentEncoding = (_header ?? "").Split(',');
 4691                        }
 744692                        if (response.Headers.TryGetValue("Cache-Control", out _header))
 4693                        {
 44694                            _value.CacheControl = _header;
 4695                        }
 744696                        if (response.Headers.TryGetValue("Content-Disposition", out _header))
 4697                        {
 44698                            _value.ContentDisposition = _header;
 4699                        }
 744700                        if (response.Headers.TryGetValue("Content-Language", out _header))
 4701                        {
 44702                            _value.ContentLanguage = (_header ?? "").Split(',');
 4703                        }
 744704                        if (response.Headers.TryGetValue("x-ms-copy-completion-time", out _header))
 4705                        {
 84706                            _value.CopyCompletionTime = System.DateTimeOffset.Parse(_header, System.Globalization.Cultur
 4707                        }
 744708                        if (response.Headers.TryGetValue("x-ms-copy-status-description", out _header))
 4709                        {
 04710                            _value.CopyStatusDescription = _header;
 4711                        }
 744712                        if (response.Headers.TryGetValue("x-ms-copy-id", out _header))
 4713                        {
 84714                            _value.CopyId = _header;
 4715                        }
 744716                        if (response.Headers.TryGetValue("x-ms-copy-progress", out _header))
 4717                        {
 84718                            _value.CopyProgress = _header;
 4719                        }
 744720                        if (response.Headers.TryGetValue("x-ms-copy-source", out _header))
 4721                        {
 84722                            _value.CopySource = _header;
 4723                        }
 744724                        if (response.Headers.TryGetValue("x-ms-copy-status", out _header))
 4725                        {
 84726                            _value.CopyStatus = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseCopyStatus(
 4727                        }
 744728                        if (response.Headers.TryGetValue("x-ms-server-encrypted", out _header))
 4729                        {
 744730                            _value.IsServerEncrypted = bool.Parse(_header);
 4731                        }
 744732                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 4733                        {
 744734                            _value.FileAttributes = _header;
 4735                        }
 744736                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 4737                        {
 744738                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 4739                        }
 744740                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 4741                        {
 744742                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 4743                        }
 744744                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 4745                        {
 744746                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 4747                        }
 744748                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 4749                        {
 744750                            _value.FilePermissionKey = _header;
 4751                        }
 744752                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 4753                        {
 744754                            _value.FileId = _header;
 4755                        }
 744756                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 4757                        {
 744758                            _value.FileParentId = _header;
 4759                        }
 744760                        if (response.Headers.TryGetValue("x-ms-lease-duration", out _header))
 4761                        {
 84762                            _value.LeaseDuration = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLea
 4763                        }
 744764                        if (response.Headers.TryGetValue("x-ms-lease-state", out _header))
 4765                        {
 724766                            _value.LeaseState = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLeaseS
 4767                        }
 744768                        if (response.Headers.TryGetValue("x-ms-lease-status", out _header))
 4769                        {
 724770                            _value.LeaseStatus = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseShareLease
 4771                        }
 4772
 4773                        // Create the response
 744774                        return Response.FromValue(_value, response);
 4775                    }
 4776                    case 304:
 4777                    {
 04778                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.RawStorageFileProperties>(resp
 4779                    }
 4780                    default:
 4781                    {
 4782                        // Create the result
 144783                        Azure.Storage.Files.Shares.Models.FailureNoContent _value = new Azure.Storage.Files.Shares.Model
 4784
 4785                        // Get response headers
 4786                        string _header;
 144787                        if (response.Headers.TryGetValue("x-ms-error-code", out _header))
 4788                        {
 144789                            _value.ErrorCode = _header;
 4790                        }
 4791
 144792                        throw _value.CreateException(clientDiagnostics, response);
 4793                    }
 4794                }
 4795            }
 4796            #endregion File.GetPropertiesAsync
 4797
 4798            #region File.DeleteAsync
 4799            /// <summary>
 4800            /// removes the file from the storage account.
 4801            /// </summary>
 4802            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 4803            /// <param name="pipeline">The pipeline used for sending requests.</param>
 4804            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 4805            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 4806            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 4807            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 4808            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 4809            /// <param name="operationName">Operation name.</param>
 4810            /// <param name="cancellationToken">Cancellation token.</param>
 4811            /// <returns>Azure.Response</returns>
 4812            public static async System.Threading.Tasks.ValueTask<Azure.Response> DeleteAsync(
 4813                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4814                Azure.Core.Pipeline.HttpPipeline pipeline,
 4815                System.Uri resourceUri,
 4816                string version,
 4817                int? timeout = default,
 4818                string leaseId = default,
 4819                bool async = true,
 4820                string operationName = "FileClient.Delete",
 4821                System.Threading.CancellationToken cancellationToken = default)
 4822            {
 184823                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 4824                try
 4825                {
 184826                    _scope.AddAttribute("url", resourceUri);
 184827                    _scope.Start();
 184828                    using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage(
 184829                        pipeline,
 184830                        resourceUri,
 184831                        version,
 184832                        timeout,
 184833                        leaseId))
 4834                    {
 184835                        if (async)
 4836                        {
 4837                            // Send the request asynchronously if we're being called via an async path
 94838                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 4839                        }
 4840                        else
 4841                        {
 4842                            // Send the request synchronously through the API that blocks if we're being called via a sy
 4843                            // (this is safe because the Task will complete before the user can call Wait)
 94844                            pipeline.Send(_message, cancellationToken);
 4845                        }
 184846                        Azure.Response _response = _message.Response;
 184847                        cancellationToken.ThrowIfCancellationRequested();
 184848                        return DeleteAsync_CreateResponse(clientDiagnostics, _response);
 4849                    }
 4850                }
 104851                catch (System.Exception ex)
 4852                {
 104853                    _scope.Failed(ex);
 104854                    throw;
 4855                }
 4856                finally
 4857                {
 184858                    _scope.Dispose();
 4859                }
 84860            }
 4861
 4862            /// <summary>
 4863            /// Create the File.DeleteAsync request.
 4864            /// </summary>
 4865            /// <param name="pipeline">The pipeline used for sending requests.</param>
 4866            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 4867            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 4868            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 4869            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 4870            /// <returns>The File.DeleteAsync Message.</returns>
 4871            internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage(
 4872                Azure.Core.Pipeline.HttpPipeline pipeline,
 4873                System.Uri resourceUri,
 4874                string version,
 4875                int? timeout = default,
 4876                string leaseId = default)
 4877            {
 4878                // Validation
 184879                if (resourceUri == null)
 4880                {
 04881                    throw new System.ArgumentNullException(nameof(resourceUri));
 4882                }
 184883                if (version == null)
 4884                {
 04885                    throw new System.ArgumentNullException(nameof(version));
 4886                }
 4887
 4888                // Create the request
 184889                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 184890                Azure.Core.Request _request = _message.Request;
 4891
 4892                // Set the endpoint
 184893                _request.Method = Azure.Core.RequestMethod.Delete;
 184894                _request.Uri.Reset(resourceUri);
 04895                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 4896
 4897                // Add request headers
 184898                _request.Headers.SetValue("x-ms-version", version);
 224899                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 4900
 184901                return _message;
 4902            }
 4903
 4904            /// <summary>
 4905            /// Create the File.DeleteAsync response or throw a failure exception.
 4906            /// </summary>
 4907            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 4908            /// <param name="response">The raw Response.</param>
 4909            /// <returns>The File.DeleteAsync Azure.Response.</returns>
 4910            internal static Azure.Response DeleteAsync_CreateResponse(
 4911                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4912                Azure.Response response)
 4913            {
 4914                // Process the response
 184915                switch (response.Status)
 4916                {
 4917                    case 202:
 4918                    {
 84919                        return response;
 4920                    }
 4921                    default:
 4922                    {
 4923                        // Create the result
 104924                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 104925                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 4926
 104927                        throw _value.CreateException(clientDiagnostics, response);
 4928                    }
 4929                }
 4930            }
 4931            #endregion File.DeleteAsync
 4932
 4933            #region File.SetPropertiesAsync
 4934            /// <summary>
 4935            /// Sets HTTP headers on the file.
 4936            /// </summary>
 4937            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 4938            /// <param name="pipeline">The pipeline used for sending requests.</param>
 4939            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 4940            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 4941            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 4942            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 4943            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 4944            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 4945            /// <param name="fileContentLength">Resizes a file to the specified size. If the specified byte value is les
 4946            /// <param name="fileContentType">Sets the MIME content type of the file. The default type is 'application/o
 4947            /// <param name="fileContentEncoding">Specifies which content encodings have been applied to the file.</para
 4948            /// <param name="fileContentLanguage">Specifies the natural languages used by this resource.</param>
 4949            /// <param name="fileCacheControl">Sets the file's cache control. The File service stores this value but doe
 4950            /// <param name="fileContentHash">Sets the file's MD5 hash.</param>
 4951            /// <param name="fileContentDisposition">Sets the file's Content-Disposition header.</param>
 4952            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 4953            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 4954            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 4955            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 4956            /// <param name="operationName">Operation name.</param>
 4957            /// <param name="cancellationToken">Cancellation token.</param>
 4958            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileInfo}</returns>
 4959            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 4960                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 4961                Azure.Core.Pipeline.HttpPipeline pipeline,
 4962                System.Uri resourceUri,
 4963                string version,
 4964                string fileAttributes,
 4965                string fileCreationTime,
 4966                string fileLastWriteTime,
 4967                int? timeout = default,
 4968                long? fileContentLength = default,
 4969                string fileContentType = default,
 4970                System.Collections.Generic.IEnumerable<string> fileContentEncoding = default,
 4971                System.Collections.Generic.IEnumerable<string> fileContentLanguage = default,
 4972                string fileCacheControl = default,
 4973                byte[] fileContentHash = default,
 4974                string fileContentDisposition = default,
 4975                string filePermission = default,
 4976                string filePermissionKey = default,
 4977                string leaseId = default,
 4978                bool async = true,
 4979                string operationName = "FileClient.SetProperties",
 4980                System.Threading.CancellationToken cancellationToken = default)
 4981            {
 124982                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 4983                try
 4984                {
 124985                    _scope.AddAttribute("url", resourceUri);
 124986                    _scope.Start();
 124987                    using (Azure.Core.HttpMessage _message = SetPropertiesAsync_CreateMessage(
 124988                        pipeline,
 124989                        resourceUri,
 124990                        version,
 124991                        fileAttributes,
 124992                        fileCreationTime,
 124993                        fileLastWriteTime,
 124994                        timeout,
 124995                        fileContentLength,
 124996                        fileContentType,
 124997                        fileContentEncoding,
 124998                        fileContentLanguage,
 124999                        fileCacheControl,
 125000                        fileContentHash,
 125001                        fileContentDisposition,
 125002                        filePermission,
 125003                        filePermissionKey,
 125004                        leaseId))
 5005                    {
 125006                        if (async)
 5007                        {
 5008                            // Send the request asynchronously if we're being called via an async path
 65009                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 5010                        }
 5011                        else
 5012                        {
 5013                            // Send the request synchronously through the API that blocks if we're being called via a sy
 5014                            // (this is safe because the Task will complete before the user can call Wait)
 65015                            pipeline.Send(_message, cancellationToken);
 5016                        }
 125017                        Azure.Response _response = _message.Response;
 125018                        cancellationToken.ThrowIfCancellationRequested();
 125019                        return SetPropertiesAsync_CreateResponse(clientDiagnostics, _response);
 5020                    }
 5021                }
 45022                catch (System.Exception ex)
 5023                {
 45024                    _scope.Failed(ex);
 45025                    throw;
 5026                }
 5027                finally
 5028                {
 125029                    _scope.Dispose();
 5030                }
 85031            }
 5032
 5033            /// <summary>
 5034            /// Create the File.SetPropertiesAsync request.
 5035            /// </summary>
 5036            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5037            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5038            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5039            /// <param name="fileAttributes">If specified, the provided file attributes shall be set. Default value: â€˜Ar
 5040            /// <param name="fileCreationTime">Creation time for the file/directory. Default value: Now.</param>
 5041            /// <param name="fileLastWriteTime">Last write time for the file/directory. Default value: Now.</param>
 5042            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5043            /// <param name="fileContentLength">Resizes a file to the specified size. If the specified byte value is les
 5044            /// <param name="fileContentType">Sets the MIME content type of the file. The default type is 'application/o
 5045            /// <param name="fileContentEncoding">Specifies which content encodings have been applied to the file.</para
 5046            /// <param name="fileContentLanguage">Specifies the natural languages used by this resource.</param>
 5047            /// <param name="fileCacheControl">Sets the file's cache control. The File service stores this value but doe
 5048            /// <param name="fileContentHash">Sets the file's MD5 hash.</param>
 5049            /// <param name="fileContentDisposition">Sets the file's Content-Disposition header.</param>
 5050            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 5051            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 5052            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 5053            /// <returns>The File.SetPropertiesAsync Message.</returns>
 5054            internal static Azure.Core.HttpMessage SetPropertiesAsync_CreateMessage(
 5055                Azure.Core.Pipeline.HttpPipeline pipeline,
 5056                System.Uri resourceUri,
 5057                string version,
 5058                string fileAttributes,
 5059                string fileCreationTime,
 5060                string fileLastWriteTime,
 5061                int? timeout = default,
 5062                long? fileContentLength = default,
 5063                string fileContentType = default,
 5064                System.Collections.Generic.IEnumerable<string> fileContentEncoding = default,
 5065                System.Collections.Generic.IEnumerable<string> fileContentLanguage = default,
 5066                string fileCacheControl = default,
 5067                byte[] fileContentHash = default,
 5068                string fileContentDisposition = default,
 5069                string filePermission = default,
 5070                string filePermissionKey = default,
 5071                string leaseId = default)
 5072            {
 5073                // Validation
 125074                if (resourceUri == null)
 5075                {
 05076                    throw new System.ArgumentNullException(nameof(resourceUri));
 5077                }
 125078                if (version == null)
 5079                {
 05080                    throw new System.ArgumentNullException(nameof(version));
 5081                }
 125082                if (fileAttributes == null)
 5083                {
 05084                    throw new System.ArgumentNullException(nameof(fileAttributes));
 5085                }
 125086                if (fileCreationTime == null)
 5087                {
 05088                    throw new System.ArgumentNullException(nameof(fileCreationTime));
 5089                }
 125090                if (fileLastWriteTime == null)
 5091                {
 05092                    throw new System.ArgumentNullException(nameof(fileLastWriteTime));
 5093                }
 5094
 5095                // Create the request
 125096                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 125097                Azure.Core.Request _request = _message.Request;
 5098
 5099                // Set the endpoint
 125100                _request.Method = Azure.Core.RequestMethod.Put;
 125101                _request.Uri.Reset(resourceUri);
 125102                _request.Uri.AppendQuery("comp", "properties", escapeValue: false);
 05103                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 5104
 5105                // Add request headers
 125106                _request.Headers.SetValue("x-ms-version", version);
 125107                _request.Headers.SetValue("x-ms-file-attributes", fileAttributes);
 125108                _request.Headers.SetValue("x-ms-file-creation-time", fileCreationTime);
 125109                _request.Headers.SetValue("x-ms-file-last-write-time", fileLastWriteTime);
 05110                if (fileContentLength != null) { _request.Headers.SetValue("x-ms-content-length", fileContentLength.Valu
 205111                if (fileContentType != null) { _request.Headers.SetValue("x-ms-content-type", fileContentType); }
 125112                if (fileContentEncoding != null) {
 165113                    foreach (string _item in fileContentEncoding)
 5114                    {
 45115                        _request.Headers.SetValue("x-ms-content-encoding", _item);
 5116                    }
 5117                }
 125118                if (fileContentLanguage != null) {
 165119                    foreach (string _item in fileContentLanguage)
 5120                    {
 45121                        _request.Headers.SetValue("x-ms-content-language", _item);
 5122                    }
 5123                }
 165124                if (fileCacheControl != null) { _request.Headers.SetValue("x-ms-cache-control", fileCacheControl); }
 165125                if (fileContentHash != null) { _request.Headers.SetValue("x-ms-content-md5", System.Convert.ToBase64Stri
 165126                if (fileContentDisposition != null) { _request.Headers.SetValue("x-ms-content-disposition", fileContentD
 225127                if (filePermission != null) { _request.Headers.SetValue("x-ms-file-permission", filePermission); }
 145128                if (filePermissionKey != null) { _request.Headers.SetValue("x-ms-file-permission-key", filePermissionKey
 165129                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 5130
 125131                return _message;
 5132            }
 5133
 5134            /// <summary>
 5135            /// Create the File.SetPropertiesAsync response or throw a failure exception.
 5136            /// </summary>
 5137            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 5138            /// <param name="response">The raw Response.</param>
 5139            /// <returns>The File.SetPropertiesAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileInfo
 5140            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageFileInfo> SetPropertiesAsync_Crea
 5141                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5142                Azure.Response response)
 5143            {
 5144                // Process the response
 125145                switch (response.Status)
 5146                {
 5147                    case 200:
 5148                    {
 5149                        // Create the result
 85150                        Azure.Storage.Files.Shares.Models.RawStorageFileInfo _value = new Azure.Storage.Files.Shares.Mod
 5151
 5152                        // Get response headers
 5153                        string _header;
 85154                        if (response.Headers.TryGetValue("ETag", out _header))
 5155                        {
 85156                            _value.ETag = new Azure.ETag(_header);
 5157                        }
 85158                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 5159                        {
 85160                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 5161                        }
 85162                        if (response.Headers.TryGetValue("x-ms-request-server-encrypted", out _header))
 5163                        {
 85164                            _value.IsServerEncrypted = bool.Parse(_header);
 5165                        }
 85166                        if (response.Headers.TryGetValue("x-ms-file-permission-key", out _header))
 5167                        {
 85168                            _value.FilePermissionKey = _header;
 5169                        }
 85170                        if (response.Headers.TryGetValue("x-ms-file-attributes", out _header))
 5171                        {
 85172                            _value.FileAttributes = _header;
 5173                        }
 85174                        if (response.Headers.TryGetValue("x-ms-file-creation-time", out _header))
 5175                        {
 85176                            _value.FileCreationTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureI
 5177                        }
 85178                        if (response.Headers.TryGetValue("x-ms-file-last-write-time", out _header))
 5179                        {
 85180                            _value.FileLastWriteTime = System.DateTimeOffset.Parse(_header, System.Globalization.Culture
 5181                        }
 85182                        if (response.Headers.TryGetValue("x-ms-file-change-time", out _header))
 5183                        {
 85184                            _value.FileChangeTime = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInf
 5185                        }
 85186                        if (response.Headers.TryGetValue("x-ms-file-id", out _header))
 5187                        {
 85188                            _value.FileId = _header;
 5189                        }
 85190                        if (response.Headers.TryGetValue("x-ms-file-parent-id", out _header))
 5191                        {
 85192                            _value.FileParentId = _header;
 5193                        }
 5194
 5195                        // Create the response
 85196                        return Response.FromValue(_value, response);
 5197                    }
 5198                    default:
 5199                    {
 5200                        // Create the result
 45201                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 45202                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 5203
 45204                        throw _value.CreateException(clientDiagnostics, response);
 5205                    }
 5206                }
 5207            }
 5208            #endregion File.SetPropertiesAsync
 5209
 5210            #region File.SetMetadataAsync
 5211            /// <summary>
 5212            /// Updates user-defined metadata for the specified file.
 5213            /// </summary>
 5214            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 5215            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5216            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5217            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5218            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5219            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 5220            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 5221            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 5222            /// <param name="operationName">Operation name.</param>
 5223            /// <param name="cancellationToken">Cancellation token.</param>
 5224            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileInfo}</returns>
 5225            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.RawSto
 5226                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5227                Azure.Core.Pipeline.HttpPipeline pipeline,
 5228                System.Uri resourceUri,
 5229                string version,
 5230                int? timeout = default,
 5231                System.Collections.Generic.IDictionary<string, string> metadata = default,
 5232                string leaseId = default,
 5233                bool async = true,
 5234                string operationName = "FileClient.SetMetadata",
 5235                System.Threading.CancellationToken cancellationToken = default)
 5236            {
 85237                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 5238                try
 5239                {
 85240                    _scope.AddAttribute("url", resourceUri);
 85241                    _scope.Start();
 85242                    using (Azure.Core.HttpMessage _message = SetMetadataAsync_CreateMessage(
 85243                        pipeline,
 85244                        resourceUri,
 85245                        version,
 85246                        timeout,
 85247                        metadata,
 85248                        leaseId))
 5249                    {
 85250                        if (async)
 5251                        {
 5252                            // Send the request asynchronously if we're being called via an async path
 45253                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 5254                        }
 5255                        else
 5256                        {
 5257                            // Send the request synchronously through the API that blocks if we're being called via a sy
 5258                            // (this is safe because the Task will complete before the user can call Wait)
 45259                            pipeline.Send(_message, cancellationToken);
 5260                        }
 85261                        Azure.Response _response = _message.Response;
 85262                        cancellationToken.ThrowIfCancellationRequested();
 85263                        return SetMetadataAsync_CreateResponse(clientDiagnostics, _response);
 5264                    }
 5265                }
 45266                catch (System.Exception ex)
 5267                {
 45268                    _scope.Failed(ex);
 45269                    throw;
 5270                }
 5271                finally
 5272                {
 85273                    _scope.Dispose();
 5274                }
 45275            }
 5276
 5277            /// <summary>
 5278            /// Create the File.SetMetadataAsync request.
 5279            /// </summary>
 5280            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5281            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5282            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5283            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5284            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 5285            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 5286            /// <returns>The File.SetMetadataAsync Message.</returns>
 5287            internal static Azure.Core.HttpMessage SetMetadataAsync_CreateMessage(
 5288                Azure.Core.Pipeline.HttpPipeline pipeline,
 5289                System.Uri resourceUri,
 5290                string version,
 5291                int? timeout = default,
 5292                System.Collections.Generic.IDictionary<string, string> metadata = default,
 5293                string leaseId = default)
 5294            {
 5295                // Validation
 85296                if (resourceUri == null)
 5297                {
 05298                    throw new System.ArgumentNullException(nameof(resourceUri));
 5299                }
 85300                if (version == null)
 5301                {
 05302                    throw new System.ArgumentNullException(nameof(version));
 5303                }
 5304
 5305                // Create the request
 85306                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 85307                Azure.Core.Request _request = _message.Request;
 5308
 5309                // Set the endpoint
 85310                _request.Method = Azure.Core.RequestMethod.Put;
 85311                _request.Uri.Reset(resourceUri);
 85312                _request.Uri.AppendQuery("comp", "metadata", escapeValue: false);
 05313                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 5314
 5315                // Add request headers
 85316                _request.Headers.SetValue("x-ms-version", version);
 85317                if (metadata != null) {
 805318                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 5319                    {
 325320                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 5321                    }
 5322                }
 125323                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 5324
 85325                return _message;
 5326            }
 5327
 5328            /// <summary>
 5329            /// Create the File.SetMetadataAsync response or throw a failure exception.
 5330            /// </summary>
 5331            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 5332            /// <param name="response">The raw Response.</param>
 5333            /// <returns>The File.SetMetadataAsync Azure.Response{Azure.Storage.Files.Shares.Models.RawStorageFileInfo}.
 5334            internal static Azure.Response<Azure.Storage.Files.Shares.Models.RawStorageFileInfo> SetMetadataAsync_Create
 5335                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5336                Azure.Response response)
 5337            {
 5338                // Process the response
 85339                switch (response.Status)
 5340                {
 5341                    case 200:
 5342                    {
 5343                        // Create the result
 45344                        Azure.Storage.Files.Shares.Models.RawStorageFileInfo _value = new Azure.Storage.Files.Shares.Mod
 5345
 5346                        // Get response headers
 5347                        string _header;
 45348                        if (response.Headers.TryGetValue("ETag", out _header))
 5349                        {
 45350                            _value.ETag = new Azure.ETag(_header);
 5351                        }
 45352                        if (response.Headers.TryGetValue("x-ms-request-server-encrypted", out _header))
 5353                        {
 45354                            _value.IsServerEncrypted = bool.Parse(_header);
 5355                        }
 45356                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 5357                        {
 45358                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 5359                        }
 5360
 5361                        // Create the response
 45362                        return Response.FromValue(_value, response);
 5363                    }
 5364                    default:
 5365                    {
 5366                        // Create the result
 45367                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 45368                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 5369
 45370                        throw _value.CreateException(clientDiagnostics, response);
 5371                    }
 5372                }
 5373            }
 5374            #endregion File.SetMetadataAsync
 5375
 5376            #region File.AcquireLeaseAsync
 5377            /// <summary>
 5378            /// [Update] The Lease File operation establishes and manages a lock on a file for write and delete operatio
 5379            /// </summary>
 5380            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 5381            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5382            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5383            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5384            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5385            /// <param name="duration">Specifies the duration of the lease, in seconds, or negative one (-1) for a lease
 5386            /// <param name="proposedLeaseId">Proposed lease ID, in a GUID string format. The File service returns 400 (
 5387            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5388            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 5389            /// <param name="operationName">Operation name.</param>
 5390            /// <param name="cancellationToken">Cancellation token.</param>
 5391            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileLease}</returns>
 5392            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareF
 5393                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5394                Azure.Core.Pipeline.HttpPipeline pipeline,
 5395                System.Uri resourceUri,
 5396                string version,
 5397                int? timeout = default,
 5398                int? duration = default,
 5399                string proposedLeaseId = default,
 5400                string requestId = default,
 5401                bool async = true,
 5402                string operationName = "FileClient.AcquireLease",
 5403                System.Threading.CancellationToken cancellationToken = default)
 5404            {
 425405                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 5406                try
 5407                {
 425408                    _scope.AddAttribute("url", resourceUri);
 425409                    _scope.Start();
 425410                    using (Azure.Core.HttpMessage _message = AcquireLeaseAsync_CreateMessage(
 425411                        pipeline,
 425412                        resourceUri,
 425413                        version,
 425414                        timeout,
 425415                        duration,
 425416                        proposedLeaseId,
 425417                        requestId))
 5418                    {
 425419                        if (async)
 5420                        {
 5421                            // Send the request asynchronously if we're being called via an async path
 215422                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 5423                        }
 5424                        else
 5425                        {
 5426                            // Send the request synchronously through the API that blocks if we're being called via a sy
 5427                            // (this is safe because the Task will complete before the user can call Wait)
 215428                            pipeline.Send(_message, cancellationToken);
 5429                        }
 425430                        Azure.Response _response = _message.Response;
 425431                        cancellationToken.ThrowIfCancellationRequested();
 425432                        return AcquireLeaseAsync_CreateResponse(clientDiagnostics, _response);
 5433                    }
 5434                }
 25435                catch (System.Exception ex)
 5436                {
 25437                    _scope.Failed(ex);
 25438                    throw;
 5439                }
 5440                finally
 5441                {
 425442                    _scope.Dispose();
 5443                }
 405444            }
 5445
 5446            /// <summary>
 5447            /// Create the File.AcquireLeaseAsync request.
 5448            /// </summary>
 5449            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5450            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5451            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5452            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5453            /// <param name="duration">Specifies the duration of the lease, in seconds, or negative one (-1) for a lease
 5454            /// <param name="proposedLeaseId">Proposed lease ID, in a GUID string format. The File service returns 400 (
 5455            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5456            /// <returns>The File.AcquireLeaseAsync Message.</returns>
 5457            internal static Azure.Core.HttpMessage AcquireLeaseAsync_CreateMessage(
 5458                Azure.Core.Pipeline.HttpPipeline pipeline,
 5459                System.Uri resourceUri,
 5460                string version,
 5461                int? timeout = default,
 5462                int? duration = default,
 5463                string proposedLeaseId = default,
 5464                string requestId = default)
 5465            {
 5466                // Validation
 425467                if (resourceUri == null)
 5468                {
 05469                    throw new System.ArgumentNullException(nameof(resourceUri));
 5470                }
 425471                if (version == null)
 5472                {
 05473                    throw new System.ArgumentNullException(nameof(version));
 5474                }
 5475
 5476                // Create the request
 425477                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 425478                Azure.Core.Request _request = _message.Request;
 5479
 5480                // Set the endpoint
 425481                _request.Method = Azure.Core.RequestMethod.Put;
 425482                _request.Uri.Reset(resourceUri);
 425483                _request.Uri.AppendQuery("comp", "lease", escapeValue: false);
 05484                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 5485
 5486                // Add request headers
 425487                _request.Headers.SetValue("x-ms-lease-action", "acquire");
 425488                _request.Headers.SetValue("x-ms-version", version);
 845489                if (duration != null) { _request.Headers.SetValue("x-ms-lease-duration", duration.Value.ToString(System.
 845490                if (proposedLeaseId != null) { _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); }
 05491                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 5492
 425493                return _message;
 5494            }
 5495
 5496            /// <summary>
 5497            /// Create the File.AcquireLeaseAsync response or throw a failure exception.
 5498            /// </summary>
 5499            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 5500            /// <param name="response">The raw Response.</param>
 5501            /// <returns>The File.AcquireLeaseAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileLease}.</r
 5502            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileLease> AcquireLeaseAsync_CreateRes
 5503                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5504                Azure.Response response)
 5505            {
 5506                // Process the response
 425507                switch (response.Status)
 5508                {
 5509                    case 201:
 5510                    {
 5511                        // Create the result
 405512                        Azure.Storage.Files.Shares.Models.ShareFileLease _value = new Azure.Storage.Files.Shares.Models.
 5513
 5514                        // Get response headers
 5515                        string _header;
 405516                        if (response.Headers.TryGetValue("ETag", out _header))
 5517                        {
 405518                            _value.ETag = new Azure.ETag(_header);
 5519                        }
 405520                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 5521                        {
 405522                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 5523                        }
 405524                        if (response.Headers.TryGetValue("x-ms-lease-id", out _header))
 5525                        {
 405526                            _value.LeaseId = _header;
 5527                        }
 5528
 5529                        // Create the response
 405530                        return Response.FromValue(_value, response);
 5531                    }
 5532                    default:
 5533                    {
 5534                        // Create the result
 25535                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 25536                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 5537
 25538                        throw _value.CreateException(clientDiagnostics, response);
 5539                    }
 5540                }
 5541            }
 5542            #endregion File.AcquireLeaseAsync
 5543
 5544            #region File.ReleaseLeaseAsync
 5545            /// <summary>
 5546            /// [Update] The Lease File operation establishes and manages a lock on a file for write and delete operatio
 5547            /// </summary>
 5548            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 5549            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5550            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5551            /// <param name="leaseId">Specifies the current lease ID on the resource.</param>
 5552            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5553            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5554            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5555            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 5556            /// <param name="operationName">Operation name.</param>
 5557            /// <param name="cancellationToken">Cancellation token.</param>
 5558            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.FileLeaseReleaseInfo}</returns>
 5559            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.FileLe
 5560                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5561                Azure.Core.Pipeline.HttpPipeline pipeline,
 5562                System.Uri resourceUri,
 5563                string leaseId,
 5564                string version,
 5565                int? timeout = default,
 5566                string requestId = default,
 5567                bool async = true,
 5568                string operationName = "FileClient.ReleaseLease",
 5569                System.Threading.CancellationToken cancellationToken = default)
 5570            {
 45571                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 5572                try
 5573                {
 45574                    _scope.AddAttribute("url", resourceUri);
 45575                    _scope.Start();
 45576                    using (Azure.Core.HttpMessage _message = ReleaseLeaseAsync_CreateMessage(
 45577                        pipeline,
 45578                        resourceUri,
 45579                        leaseId,
 45580                        version,
 45581                        timeout,
 45582                        requestId))
 5583                    {
 45584                        if (async)
 5585                        {
 5586                            // Send the request asynchronously if we're being called via an async path
 25587                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 5588                        }
 5589                        else
 5590                        {
 5591                            // Send the request synchronously through the API that blocks if we're being called via a sy
 5592                            // (this is safe because the Task will complete before the user can call Wait)
 25593                            pipeline.Send(_message, cancellationToken);
 5594                        }
 45595                        Azure.Response _response = _message.Response;
 45596                        cancellationToken.ThrowIfCancellationRequested();
 45597                        return ReleaseLeaseAsync_CreateResponse(clientDiagnostics, _response);
 5598                    }
 5599                }
 25600                catch (System.Exception ex)
 5601                {
 25602                    _scope.Failed(ex);
 25603                    throw;
 5604                }
 5605                finally
 5606                {
 45607                    _scope.Dispose();
 5608                }
 25609            }
 5610
 5611            /// <summary>
 5612            /// Create the File.ReleaseLeaseAsync request.
 5613            /// </summary>
 5614            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5615            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5616            /// <param name="leaseId">Specifies the current lease ID on the resource.</param>
 5617            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5618            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5619            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5620            /// <returns>The File.ReleaseLeaseAsync Message.</returns>
 5621            internal static Azure.Core.HttpMessage ReleaseLeaseAsync_CreateMessage(
 5622                Azure.Core.Pipeline.HttpPipeline pipeline,
 5623                System.Uri resourceUri,
 5624                string leaseId,
 5625                string version,
 5626                int? timeout = default,
 5627                string requestId = default)
 5628            {
 5629                // Validation
 45630                if (resourceUri == null)
 5631                {
 05632                    throw new System.ArgumentNullException(nameof(resourceUri));
 5633                }
 45634                if (leaseId == null)
 5635                {
 05636                    throw new System.ArgumentNullException(nameof(leaseId));
 5637                }
 45638                if (version == null)
 5639                {
 05640                    throw new System.ArgumentNullException(nameof(version));
 5641                }
 5642
 5643                // Create the request
 45644                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 45645                Azure.Core.Request _request = _message.Request;
 5646
 5647                // Set the endpoint
 45648                _request.Method = Azure.Core.RequestMethod.Put;
 45649                _request.Uri.Reset(resourceUri);
 45650                _request.Uri.AppendQuery("comp", "lease", escapeValue: false);
 05651                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 5652
 5653                // Add request headers
 45654                _request.Headers.SetValue("x-ms-lease-action", "release");
 45655                _request.Headers.SetValue("x-ms-lease-id", leaseId);
 45656                _request.Headers.SetValue("x-ms-version", version);
 05657                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 5658
 45659                return _message;
 5660            }
 5661
 5662            /// <summary>
 5663            /// Create the File.ReleaseLeaseAsync response or throw a failure exception.
 5664            /// </summary>
 5665            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 5666            /// <param name="response">The raw Response.</param>
 5667            /// <returns>The File.ReleaseLeaseAsync Azure.Response{Azure.Storage.Files.Shares.Models.FileLeaseReleaseInf
 5668            internal static Azure.Response<Azure.Storage.Files.Shares.Models.FileLeaseReleaseInfo> ReleaseLeaseAsync_Cre
 5669                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5670                Azure.Response response)
 5671            {
 5672                // Process the response
 45673                switch (response.Status)
 5674                {
 5675                    case 200:
 5676                    {
 5677                        // Create the result
 25678                        Azure.Storage.Files.Shares.Models.FileLeaseReleaseInfo _value = new Azure.Storage.Files.Shares.M
 5679
 5680                        // Get response headers
 5681                        string _header;
 25682                        if (response.Headers.TryGetValue("ETag", out _header))
 5683                        {
 25684                            _value.ETag = new Azure.ETag(_header);
 5685                        }
 25686                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 5687                        {
 25688                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 5689                        }
 5690
 5691                        // Create the response
 25692                        return Response.FromValue(_value, response);
 5693                    }
 5694                    default:
 5695                    {
 5696                        // Create the result
 25697                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 25698                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 5699
 25700                        throw _value.CreateException(clientDiagnostics, response);
 5701                    }
 5702                }
 5703            }
 5704            #endregion File.ReleaseLeaseAsync
 5705
 5706            #region File.ChangeLeaseAsync
 5707            /// <summary>
 5708            /// [Update] The Lease File operation establishes and manages a lock on a file for write and delete operatio
 5709            /// </summary>
 5710            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 5711            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5712            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5713            /// <param name="leaseId">Specifies the current lease ID on the resource.</param>
 5714            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5715            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5716            /// <param name="proposedLeaseId">Proposed lease ID, in a GUID string format. The File service returns 400 (
 5717            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5718            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 5719            /// <param name="operationName">Operation name.</param>
 5720            /// <param name="cancellationToken">Cancellation token.</param>
 5721            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileLease}</returns>
 5722            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareF
 5723                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5724                Azure.Core.Pipeline.HttpPipeline pipeline,
 5725                System.Uri resourceUri,
 5726                string leaseId,
 5727                string version,
 5728                int? timeout = default,
 5729                string proposedLeaseId = default,
 5730                string requestId = default,
 5731                bool async = true,
 5732                string operationName = "FileClient.ChangeLease",
 5733                System.Threading.CancellationToken cancellationToken = default)
 5734            {
 45735                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 5736                try
 5737                {
 45738                    _scope.AddAttribute("url", resourceUri);
 45739                    _scope.Start();
 45740                    using (Azure.Core.HttpMessage _message = ChangeLeaseAsync_CreateMessage(
 45741                        pipeline,
 45742                        resourceUri,
 45743                        leaseId,
 45744                        version,
 45745                        timeout,
 45746                        proposedLeaseId,
 45747                        requestId))
 5748                    {
 45749                        if (async)
 5750                        {
 5751                            // Send the request asynchronously if we're being called via an async path
 25752                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 5753                        }
 5754                        else
 5755                        {
 5756                            // Send the request synchronously through the API that blocks if we're being called via a sy
 5757                            // (this is safe because the Task will complete before the user can call Wait)
 25758                            pipeline.Send(_message, cancellationToken);
 5759                        }
 45760                        Azure.Response _response = _message.Response;
 45761                        cancellationToken.ThrowIfCancellationRequested();
 45762                        return ChangeLeaseAsync_CreateResponse(clientDiagnostics, _response);
 5763                    }
 5764                }
 25765                catch (System.Exception ex)
 5766                {
 25767                    _scope.Failed(ex);
 25768                    throw;
 5769                }
 5770                finally
 5771                {
 45772                    _scope.Dispose();
 5773                }
 25774            }
 5775
 5776            /// <summary>
 5777            /// Create the File.ChangeLeaseAsync request.
 5778            /// </summary>
 5779            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5780            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5781            /// <param name="leaseId">Specifies the current lease ID on the resource.</param>
 5782            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5783            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5784            /// <param name="proposedLeaseId">Proposed lease ID, in a GUID string format. The File service returns 400 (
 5785            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5786            /// <returns>The File.ChangeLeaseAsync Message.</returns>
 5787            internal static Azure.Core.HttpMessage ChangeLeaseAsync_CreateMessage(
 5788                Azure.Core.Pipeline.HttpPipeline pipeline,
 5789                System.Uri resourceUri,
 5790                string leaseId,
 5791                string version,
 5792                int? timeout = default,
 5793                string proposedLeaseId = default,
 5794                string requestId = default)
 5795            {
 5796                // Validation
 45797                if (resourceUri == null)
 5798                {
 05799                    throw new System.ArgumentNullException(nameof(resourceUri));
 5800                }
 45801                if (leaseId == null)
 5802                {
 05803                    throw new System.ArgumentNullException(nameof(leaseId));
 5804                }
 45805                if (version == null)
 5806                {
 05807                    throw new System.ArgumentNullException(nameof(version));
 5808                }
 5809
 5810                // Create the request
 45811                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 45812                Azure.Core.Request _request = _message.Request;
 5813
 5814                // Set the endpoint
 45815                _request.Method = Azure.Core.RequestMethod.Put;
 45816                _request.Uri.Reset(resourceUri);
 45817                _request.Uri.AppendQuery("comp", "lease", escapeValue: false);
 05818                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 5819
 5820                // Add request headers
 45821                _request.Headers.SetValue("x-ms-lease-action", "change");
 45822                _request.Headers.SetValue("x-ms-lease-id", leaseId);
 45823                _request.Headers.SetValue("x-ms-version", version);
 85824                if (proposedLeaseId != null) { _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); }
 05825                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 5826
 45827                return _message;
 5828            }
 5829
 5830            /// <summary>
 5831            /// Create the File.ChangeLeaseAsync response or throw a failure exception.
 5832            /// </summary>
 5833            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 5834            /// <param name="response">The raw Response.</param>
 5835            /// <returns>The File.ChangeLeaseAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileLease}.</re
 5836            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileLease> ChangeLeaseAsync_CreateResp
 5837                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5838                Azure.Response response)
 5839            {
 5840                // Process the response
 45841                switch (response.Status)
 5842                {
 5843                    case 200:
 5844                    {
 5845                        // Create the result
 25846                        Azure.Storage.Files.Shares.Models.ShareFileLease _value = new Azure.Storage.Files.Shares.Models.
 5847
 5848                        // Get response headers
 5849                        string _header;
 25850                        if (response.Headers.TryGetValue("ETag", out _header))
 5851                        {
 25852                            _value.ETag = new Azure.ETag(_header);
 5853                        }
 25854                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 5855                        {
 25856                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 5857                        }
 25858                        if (response.Headers.TryGetValue("x-ms-lease-id", out _header))
 5859                        {
 25860                            _value.LeaseId = _header;
 5861                        }
 5862
 5863                        // Create the response
 25864                        return Response.FromValue(_value, response);
 5865                    }
 5866                    default:
 5867                    {
 5868                        // Create the result
 25869                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 25870                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 5871
 25872                        throw _value.CreateException(clientDiagnostics, response);
 5873                    }
 5874                }
 5875            }
 5876            #endregion File.ChangeLeaseAsync
 5877
 5878            #region File.BreakLeaseAsync
 5879            /// <summary>
 5880            /// [Update] The Lease File operation establishes and manages a lock on a file for write and delete operatio
 5881            /// </summary>
 5882            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 5883            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5884            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5885            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5886            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5887            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 5888            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5889            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 5890            /// <param name="operationName">Operation name.</param>
 5891            /// <param name="cancellationToken">Cancellation token.</param>
 5892            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.BrokenLease}</returns>
 5893            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.Broken
 5894                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 5895                Azure.Core.Pipeline.HttpPipeline pipeline,
 5896                System.Uri resourceUri,
 5897                string version,
 5898                int? timeout = default,
 5899                string leaseId = default,
 5900                string requestId = default,
 5901                bool async = true,
 5902                string operationName = "FileClient.BreakLease",
 5903                System.Threading.CancellationToken cancellationToken = default)
 5904            {
 45905                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 5906                try
 5907                {
 45908                    _scope.AddAttribute("url", resourceUri);
 45909                    _scope.Start();
 45910                    using (Azure.Core.HttpMessage _message = BreakLeaseAsync_CreateMessage(
 45911                        pipeline,
 45912                        resourceUri,
 45913                        version,
 45914                        timeout,
 45915                        leaseId,
 45916                        requestId))
 5917                    {
 45918                        if (async)
 5919                        {
 5920                            // Send the request asynchronously if we're being called via an async path
 25921                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 5922                        }
 5923                        else
 5924                        {
 5925                            // Send the request synchronously through the API that blocks if we're being called via a sy
 5926                            // (this is safe because the Task will complete before the user can call Wait)
 25927                            pipeline.Send(_message, cancellationToken);
 5928                        }
 45929                        Azure.Response _response = _message.Response;
 45930                        cancellationToken.ThrowIfCancellationRequested();
 45931                        return BreakLeaseAsync_CreateResponse(clientDiagnostics, _response);
 5932                    }
 5933                }
 25934                catch (System.Exception ex)
 5935                {
 25936                    _scope.Failed(ex);
 25937                    throw;
 5938                }
 5939                finally
 5940                {
 45941                    _scope.Dispose();
 5942                }
 25943            }
 5944
 5945            /// <summary>
 5946            /// Create the File.BreakLeaseAsync request.
 5947            /// </summary>
 5948            /// <param name="pipeline">The pipeline used for sending requests.</param>
 5949            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 5950            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 5951            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 5952            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 5953            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 5954            /// <returns>The File.BreakLeaseAsync Message.</returns>
 5955            internal static Azure.Core.HttpMessage BreakLeaseAsync_CreateMessage(
 5956                Azure.Core.Pipeline.HttpPipeline pipeline,
 5957                System.Uri resourceUri,
 5958                string version,
 5959                int? timeout = default,
 5960                string leaseId = default,
 5961                string requestId = default)
 5962            {
 5963                // Validation
 45964                if (resourceUri == null)
 5965                {
 05966                    throw new System.ArgumentNullException(nameof(resourceUri));
 5967                }
 45968                if (version == null)
 5969                {
 05970                    throw new System.ArgumentNullException(nameof(version));
 5971                }
 5972
 5973                // Create the request
 45974                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 45975                Azure.Core.Request _request = _message.Request;
 5976
 5977                // Set the endpoint
 45978                _request.Method = Azure.Core.RequestMethod.Put;
 45979                _request.Uri.Reset(resourceUri);
 45980                _request.Uri.AppendQuery("comp", "lease", escapeValue: false);
 05981                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 5982
 5983                // Add request headers
 45984                _request.Headers.SetValue("x-ms-lease-action", "break");
 45985                _request.Headers.SetValue("x-ms-version", version);
 85986                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 05987                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 5988
 45989                return _message;
 5990            }
 5991
 5992            /// <summary>
 5993            /// Create the File.BreakLeaseAsync response or throw a failure exception.
 5994            /// </summary>
 5995            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 5996            /// <param name="response">The raw Response.</param>
 5997            /// <returns>The File.BreakLeaseAsync Azure.Response{Azure.Storage.Files.Shares.Models.BrokenLease}.</return
 5998            internal static Azure.Response<Azure.Storage.Files.Shares.Models.BrokenLease> BreakLeaseAsync_CreateResponse
 5999                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6000                Azure.Response response)
 6001            {
 6002                // Process the response
 46003                switch (response.Status)
 6004                {
 6005                    case 202:
 6006                    {
 6007                        // Create the result
 26008                        Azure.Storage.Files.Shares.Models.BrokenLease _value = new Azure.Storage.Files.Shares.Models.Bro
 6009
 6010                        // Get response headers
 6011                        string _header;
 26012                        if (response.Headers.TryGetValue("ETag", out _header))
 6013                        {
 26014                            _value.ETag = new Azure.ETag(_header);
 6015                        }
 26016                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 6017                        {
 26018                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 6019                        }
 26020                        if (response.Headers.TryGetValue("x-ms-lease-id", out _header))
 6021                        {
 06022                            _value.LeaseId = _header;
 6023                        }
 6024
 6025                        // Create the response
 26026                        return Response.FromValue(_value, response);
 6027                    }
 6028                    default:
 6029                    {
 6030                        // Create the result
 26031                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 26032                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 6033
 26034                        throw _value.CreateException(clientDiagnostics, response);
 6035                    }
 6036                }
 6037            }
 6038            #endregion File.BreakLeaseAsync
 6039
 6040            #region File.UploadRangeAsync
 6041            /// <summary>
 6042            /// Upload a range of bytes to a file.
 6043            /// </summary>
 6044            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 6045            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6046            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6047            /// <param name="range">Specifies the range of bytes to be written. Both the start and end of the range must
 6048            /// <param name="fileRangeWrite">Specify one of the following options: - Update: Writes the bytes specified 
 6049            /// <param name="contentLength">Specifies the number of bytes being transmitted in the request body. When th
 6050            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6051            /// <param name="optionalbody">Initial data.</param>
 6052            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6053            /// <param name="contentHash">An MD5 hash of the content. This hash is used to verify the integrity of the d
 6054            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6055            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 6056            /// <param name="operationName">Operation name.</param>
 6057            /// <param name="cancellationToken">Cancellation token.</param>
 6058            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileUploadInfo}</returns>
 6059            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareF
 6060                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6061                Azure.Core.Pipeline.HttpPipeline pipeline,
 6062                System.Uri resourceUri,
 6063                string range,
 6064                Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType fileRangeWrite,
 6065                long contentLength,
 6066                string version,
 6067                System.IO.Stream optionalbody = default,
 6068                int? timeout = default,
 6069                byte[] contentHash = default,
 6070                string leaseId = default,
 6071                bool async = true,
 6072                string operationName = "FileClient.UploadRange",
 6073                System.Threading.CancellationToken cancellationToken = default)
 6074            {
 13046075                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 6076                try
 6077                {
 13046078                    _scope.AddAttribute("url", resourceUri);
 13046079                    _scope.Start();
 13046080                    using (Azure.Core.HttpMessage _message = UploadRangeAsync_CreateMessage(
 13046081                        pipeline,
 13046082                        resourceUri,
 13046083                        range,
 13046084                        fileRangeWrite,
 13046085                        contentLength,
 13046086                        version,
 13046087                        optionalbody,
 13046088                        timeout,
 13046089                        contentHash,
 13046090                        leaseId))
 6091                    {
 13046092                        if (async)
 6093                        {
 6094                            // Send the request asynchronously if we're being called via an async path
 12756095                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 6096                        }
 6097                        else
 6098                        {
 6099                            // Send the request synchronously through the API that blocks if we're being called via a sy
 6100                            // (this is safe because the Task will complete before the user can call Wait)
 296101                            pipeline.Send(_message, cancellationToken);
 6102                        }
 13046103                        Azure.Response _response = _message.Response;
 13046104                        cancellationToken.ThrowIfCancellationRequested();
 13046105                        return UploadRangeAsync_CreateResponse(clientDiagnostics, _response);
 6106                    }
 6107                }
 106108                catch (System.Exception ex)
 6109                {
 106110                    _scope.Failed(ex);
 106111                    throw;
 6112                }
 6113                finally
 6114                {
 13046115                    _scope.Dispose();
 6116                }
 12946117            }
 6118
 6119            /// <summary>
 6120            /// Create the File.UploadRangeAsync request.
 6121            /// </summary>
 6122            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6123            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6124            /// <param name="range">Specifies the range of bytes to be written. Both the start and end of the range must
 6125            /// <param name="fileRangeWrite">Specify one of the following options: - Update: Writes the bytes specified 
 6126            /// <param name="contentLength">Specifies the number of bytes being transmitted in the request body. When th
 6127            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6128            /// <param name="optionalbody">Initial data.</param>
 6129            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6130            /// <param name="contentHash">An MD5 hash of the content. This hash is used to verify the integrity of the d
 6131            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6132            /// <returns>The File.UploadRangeAsync Message.</returns>
 6133            internal static Azure.Core.HttpMessage UploadRangeAsync_CreateMessage(
 6134                Azure.Core.Pipeline.HttpPipeline pipeline,
 6135                System.Uri resourceUri,
 6136                string range,
 6137                Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType fileRangeWrite,
 6138                long contentLength,
 6139                string version,
 6140                System.IO.Stream optionalbody = default,
 6141                int? timeout = default,
 6142                byte[] contentHash = default,
 6143                string leaseId = default)
 6144            {
 6145                // Validation
 13046146                if (resourceUri == null)
 6147                {
 06148                    throw new System.ArgumentNullException(nameof(resourceUri));
 6149                }
 13046150                if (range == null)
 6151                {
 06152                    throw new System.ArgumentNullException(nameof(range));
 6153                }
 13046154                if (version == null)
 6155                {
 06156                    throw new System.ArgumentNullException(nameof(version));
 6157                }
 6158
 6159                // Create the request
 13046160                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 13046161                Azure.Core.Request _request = _message.Request;
 6162
 6163                // Set the endpoint
 13046164                _request.Method = Azure.Core.RequestMethod.Put;
 13046165                _request.Uri.Reset(resourceUri);
 13046166                _request.Uri.AppendQuery("comp", "range", escapeValue: false);
 06167                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 6168
 6169                // Add request headers
 13046170                _request.Headers.SetValue("x-ms-range", range);
 13046171                _request.Headers.SetValue("x-ms-write", Azure.Storage.Files.Shares.FileRestClient.Serialization.ToString
 13046172                _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.Inva
 13046173                _request.Headers.SetValue("x-ms-version", version);
 06174                if (contentHash != null) { _request.Headers.SetValue("Content-MD5", System.Convert.ToBase64String(conten
 13146175                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 6176
 6177                // Create the body
 13046178                if (optionalbody != null)
 6179                {
 13006180                    _request.Content = Azure.Core.RequestContent.Create(optionalbody);
 6181                }
 6182
 13046183                return _message;
 6184            }
 6185
 6186            /// <summary>
 6187            /// Create the File.UploadRangeAsync response or throw a failure exception.
 6188            /// </summary>
 6189            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 6190            /// <param name="response">The raw Response.</param>
 6191            /// <returns>The File.UploadRangeAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileUploadInfo}
 6192            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileUploadInfo> UploadRangeAsync_Creat
 6193                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6194                Azure.Response response)
 6195            {
 6196                // Process the response
 13046197                switch (response.Status)
 6198                {
 6199                    case 201:
 6200                    {
 6201                        // Create the result
 12946202                        Azure.Storage.Files.Shares.Models.ShareFileUploadInfo _value = new Azure.Storage.Files.Shares.Mo
 6203
 6204                        // Get response headers
 6205                        string _header;
 12946206                        if (response.Headers.TryGetValue("ETag", out _header))
 6207                        {
 12946208                            _value.ETag = new Azure.ETag(_header);
 6209                        }
 12946210                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 6211                        {
 12946212                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 6213                        }
 12946214                        if (response.Headers.TryGetValue("Content-MD5", out _header))
 6215                        {
 12926216                            _value.ContentHash = System.Convert.FromBase64String(_header);
 6217                        }
 12946218                        if (response.Headers.TryGetValue("x-ms-request-server-encrypted", out _header))
 6219                        {
 12926220                            _value.IsServerEncrypted = bool.Parse(_header);
 6221                        }
 6222
 6223                        // Create the response
 12946224                        return Response.FromValue(_value, response);
 6225                    }
 6226                    default:
 6227                    {
 6228                        // Create the result
 106229                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 106230                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 6231
 106232                        throw _value.CreateException(clientDiagnostics, response);
 6233                    }
 6234                }
 6235            }
 6236            #endregion File.UploadRangeAsync
 6237
 6238            #region File.UploadRangeFromURLAsync
 6239            /// <summary>
 6240            /// Upload a range of bytes to a file where the contents are read from a URL.
 6241            /// </summary>
 6242            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 6243            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6244            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6245            /// <param name="range">Writes data to the specified byte range in the file.</param>
 6246            /// <param name="copySource">Specifies the URL of the source file or blob, up to 2 KB in length. To copy a f
 6247            /// <param name="contentLength">Specifies the number of bytes being transmitted in the request body. When th
 6248            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6249            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6250            /// <param name="sourceRange">Bytes of source data in the specified range.</param>
 6251            /// <param name="sourceContentCrc64">Specify the crc64 calculated for the range of bytes that must be read f
 6252            /// <param name="sourceIfMatchCrc64">Specify the crc64 value to operate only on range with a matching crc64 
 6253            /// <param name="sourceIfNoneMatchCrc64">Specify the crc64 value to operate only on range without a matching
 6254            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6255            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 6256            /// <param name="operationName">Operation name.</param>
 6257            /// <param name="cancellationToken">Cancellation token.</param>
 6258            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.FileUploadRangeFromURLResult}</returns>
 6259            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.FileUp
 6260                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6261                Azure.Core.Pipeline.HttpPipeline pipeline,
 6262                System.Uri resourceUri,
 6263                string range,
 6264                System.Uri copySource,
 6265                long contentLength,
 6266                string version,
 6267                int? timeout = default,
 6268                string sourceRange = default,
 6269                byte[] sourceContentCrc64 = default,
 6270                byte[] sourceIfMatchCrc64 = default,
 6271                byte[] sourceIfNoneMatchCrc64 = default,
 6272                string leaseId = default,
 6273                bool async = true,
 6274                string operationName = "FileClient.UploadRangeFromURL",
 6275                System.Threading.CancellationToken cancellationToken = default)
 6276            {
 26277                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 6278                try
 6279                {
 26280                    _scope.AddAttribute("url", resourceUri);
 26281                    _scope.Start();
 26282                    using (Azure.Core.HttpMessage _message = UploadRangeFromURLAsync_CreateMessage(
 26283                        pipeline,
 26284                        resourceUri,
 26285                        range,
 26286                        copySource,
 26287                        contentLength,
 26288                        version,
 26289                        timeout,
 26290                        sourceRange,
 26291                        sourceContentCrc64,
 26292                        sourceIfMatchCrc64,
 26293                        sourceIfNoneMatchCrc64,
 26294                        leaseId))
 6295                    {
 26296                        if (async)
 6297                        {
 6298                            // Send the request asynchronously if we're being called via an async path
 16299                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 6300                        }
 6301                        else
 6302                        {
 6303                            // Send the request synchronously through the API that blocks if we're being called via a sy
 6304                            // (this is safe because the Task will complete before the user can call Wait)
 16305                            pipeline.Send(_message, cancellationToken);
 6306                        }
 26307                        Azure.Response _response = _message.Response;
 26308                        cancellationToken.ThrowIfCancellationRequested();
 26309                        return UploadRangeFromURLAsync_CreateResponse(clientDiagnostics, _response);
 6310                    }
 6311                }
 26312                catch (System.Exception ex)
 6313                {
 26314                    _scope.Failed(ex);
 26315                    throw;
 6316                }
 6317                finally
 6318                {
 26319                    _scope.Dispose();
 6320                }
 06321            }
 6322
 6323            /// <summary>
 6324            /// Create the File.UploadRangeFromURLAsync request.
 6325            /// </summary>
 6326            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6327            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6328            /// <param name="range">Writes data to the specified byte range in the file.</param>
 6329            /// <param name="copySource">Specifies the URL of the source file or blob, up to 2 KB in length. To copy a f
 6330            /// <param name="contentLength">Specifies the number of bytes being transmitted in the request body. When th
 6331            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6332            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6333            /// <param name="sourceRange">Bytes of source data in the specified range.</param>
 6334            /// <param name="sourceContentCrc64">Specify the crc64 calculated for the range of bytes that must be read f
 6335            /// <param name="sourceIfMatchCrc64">Specify the crc64 value to operate only on range with a matching crc64 
 6336            /// <param name="sourceIfNoneMatchCrc64">Specify the crc64 value to operate only on range without a matching
 6337            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6338            /// <returns>The File.UploadRangeFromURLAsync Message.</returns>
 6339            internal static Azure.Core.HttpMessage UploadRangeFromURLAsync_CreateMessage(
 6340                Azure.Core.Pipeline.HttpPipeline pipeline,
 6341                System.Uri resourceUri,
 6342                string range,
 6343                System.Uri copySource,
 6344                long contentLength,
 6345                string version,
 6346                int? timeout = default,
 6347                string sourceRange = default,
 6348                byte[] sourceContentCrc64 = default,
 6349                byte[] sourceIfMatchCrc64 = default,
 6350                byte[] sourceIfNoneMatchCrc64 = default,
 6351                string leaseId = default)
 6352            {
 6353                // Validation
 26354                if (resourceUri == null)
 6355                {
 06356                    throw new System.ArgumentNullException(nameof(resourceUri));
 6357                }
 26358                if (range == null)
 6359                {
 06360                    throw new System.ArgumentNullException(nameof(range));
 6361                }
 26362                if (copySource == null)
 6363                {
 06364                    throw new System.ArgumentNullException(nameof(copySource));
 6365                }
 26366                if (version == null)
 6367                {
 06368                    throw new System.ArgumentNullException(nameof(version));
 6369                }
 6370
 6371                // Create the request
 26372                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 26373                Azure.Core.Request _request = _message.Request;
 6374
 6375                // Set the endpoint
 26376                _request.Method = Azure.Core.RequestMethod.Put;
 26377                _request.Uri.Reset(resourceUri);
 26378                _request.Uri.AppendQuery("comp", "range", escapeValue: false);
 06379                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 6380
 6381                // Add request headers
 26382                _request.Headers.SetValue("x-ms-range", range);
 26383                _request.Headers.SetValue("x-ms-copy-source", copySource.AbsoluteUri);
 26384                _request.Headers.SetValue("x-ms-write", "update");
 26385                _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.Inva
 26386                _request.Headers.SetValue("x-ms-version", version);
 46387                if (sourceRange != null) { _request.Headers.SetValue("x-ms-source-range", sourceRange); }
 06388                if (sourceContentCrc64 != null) { _request.Headers.SetValue("x-ms-source-content-crc64", System.Convert.
 06389                if (sourceIfMatchCrc64 != null) { _request.Headers.SetValue("x-ms-source-if-match-crc64", System.Convert
 06390                if (sourceIfNoneMatchCrc64 != null) { _request.Headers.SetValue("x-ms-source-if-none-match-crc64", Syste
 06391                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 6392
 26393                return _message;
 6394            }
 6395
 6396            /// <summary>
 6397            /// Create the File.UploadRangeFromURLAsync response or throw a failure exception.
 6398            /// </summary>
 6399            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 6400            /// <param name="response">The raw Response.</param>
 6401            /// <returns>The File.UploadRangeFromURLAsync Azure.Response{Azure.Storage.Files.Shares.Models.FileUploadRan
 6402            internal static Azure.Response<Azure.Storage.Files.Shares.Models.FileUploadRangeFromURLResult> UploadRangeFr
 6403                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6404                Azure.Response response)
 6405            {
 6406                // Process the response
 26407                switch (response.Status)
 6408                {
 6409                    case 201:
 6410                    {
 6411                        // Create the result
 06412                        Azure.Storage.Files.Shares.Models.FileUploadRangeFromURLResult _value = new Azure.Storage.Files.
 6413
 6414                        // Get response headers
 6415                        string _header;
 06416                        if (response.Headers.TryGetValue("ETag", out _header))
 6417                        {
 06418                            _value.ETag = new Azure.ETag(_header);
 6419                        }
 06420                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 6421                        {
 06422                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 6423                        }
 06424                        if (response.Headers.TryGetValue("x-ms-content-crc64", out _header))
 6425                        {
 06426                            _value.XMSContentCrc64 = System.Convert.FromBase64String(_header);
 6427                        }
 06428                        if (response.Headers.TryGetValue("x-ms-request-server-encrypted", out _header))
 6429                        {
 06430                            _value.IsServerEncrypted = bool.Parse(_header);
 6431                        }
 6432
 6433                        // Create the response
 06434                        return Response.FromValue(_value, response);
 6435                    }
 6436                    default:
 6437                    {
 6438                        // Create the result
 26439                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 26440                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 6441
 26442                        throw _value.CreateException(clientDiagnostics, response);
 6443                    }
 6444                }
 6445            }
 6446            #endregion File.UploadRangeFromURLAsync
 6447
 6448            #region File.GetRangeListAsync
 6449            /// <summary>
 6450            /// Returns the list of valid ranges for a file.
 6451            /// </summary>
 6452            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 6453            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6454            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6455            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6456            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 6457            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6458            /// <param name="range">Specifies the range of bytes over which to list ranges, inclusively.</param>
 6459            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6460            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 6461            /// <param name="operationName">Operation name.</param>
 6462            /// <param name="cancellationToken">Cancellation token.</param>
 6463            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileRangeInfoInternal}</returns>
 6464            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareF
 6465                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6466                Azure.Core.Pipeline.HttpPipeline pipeline,
 6467                System.Uri resourceUri,
 6468                string version,
 6469                string sharesnapshot = default,
 6470                int? timeout = default,
 6471                string range = default,
 6472                string leaseId = default,
 6473                bool async = true,
 6474                string operationName = "FileClient.GetRangeList",
 6475                System.Threading.CancellationToken cancellationToken = default)
 6476            {
 106477                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 6478                try
 6479                {
 106480                    _scope.AddAttribute("url", resourceUri);
 106481                    _scope.Start();
 106482                    using (Azure.Core.HttpMessage _message = GetRangeListAsync_CreateMessage(
 106483                        pipeline,
 106484                        resourceUri,
 106485                        version,
 106486                        sharesnapshot,
 106487                        timeout,
 106488                        range,
 106489                        leaseId))
 6490                    {
 106491                        if (async)
 6492                        {
 6493                            // Send the request asynchronously if we're being called via an async path
 56494                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 6495                        }
 6496                        else
 6497                        {
 6498                            // Send the request synchronously through the API that blocks if we're being called via a sy
 6499                            // (this is safe because the Task will complete before the user can call Wait)
 56500                            pipeline.Send(_message, cancellationToken);
 6501                        }
 106502                        Azure.Response _response = _message.Response;
 106503                        cancellationToken.ThrowIfCancellationRequested();
 106504                        return GetRangeListAsync_CreateResponse(clientDiagnostics, _response);
 6505                    }
 6506                }
 46507                catch (System.Exception ex)
 6508                {
 46509                    _scope.Failed(ex);
 46510                    throw;
 6511                }
 6512                finally
 6513                {
 106514                    _scope.Dispose();
 6515                }
 66516            }
 6517
 6518            /// <summary>
 6519            /// Create the File.GetRangeListAsync request.
 6520            /// </summary>
 6521            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6522            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6523            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6524            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 6525            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6526            /// <param name="range">Specifies the range of bytes over which to list ranges, inclusively.</param>
 6527            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6528            /// <returns>The File.GetRangeListAsync Message.</returns>
 6529            internal static Azure.Core.HttpMessage GetRangeListAsync_CreateMessage(
 6530                Azure.Core.Pipeline.HttpPipeline pipeline,
 6531                System.Uri resourceUri,
 6532                string version,
 6533                string sharesnapshot = default,
 6534                int? timeout = default,
 6535                string range = default,
 6536                string leaseId = default)
 6537            {
 6538                // Validation
 106539                if (resourceUri == null)
 6540                {
 06541                    throw new System.ArgumentNullException(nameof(resourceUri));
 6542                }
 106543                if (version == null)
 6544                {
 06545                    throw new System.ArgumentNullException(nameof(version));
 6546                }
 6547
 6548                // Create the request
 106549                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 106550                Azure.Core.Request _request = _message.Request;
 6551
 6552                // Set the endpoint
 106553                _request.Method = Azure.Core.RequestMethod.Get;
 106554                _request.Uri.Reset(resourceUri);
 106555                _request.Uri.AppendQuery("comp", "rangelist", escapeValue: false);
 06556                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 06557                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 6558
 6559                // Add request headers
 106560                _request.Headers.SetValue("x-ms-version", version);
 206561                if (range != null) { _request.Headers.SetValue("x-ms-range", range); }
 146562                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 6563
 106564                return _message;
 6565            }
 6566
 6567            /// <summary>
 6568            /// Create the File.GetRangeListAsync response or throw a failure exception.
 6569            /// </summary>
 6570            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 6571            /// <param name="response">The raw Response.</param>
 6572            /// <returns>The File.GetRangeListAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileRangeInfoI
 6573            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileRangeInfoInternal> GetRangeListAsy
 6574                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6575                Azure.Response response)
 6576            {
 6577                // Process the response
 106578                switch (response.Status)
 6579                {
 6580                    case 200:
 6581                    {
 6582                        // Create the result
 66583                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 66584                        Azure.Storage.Files.Shares.Models.ShareFileRangeInfoInternal _value = new Azure.Storage.Files.Sh
 66585                        _value.Ranges =
 66586                            System.Linq.Enumerable.ToList(
 66587                                System.Linq.Enumerable.Select(
 66588                                    _xml.Element(System.Xml.Linq.XName.Get("Ranges", "")).Elements(System.Xml.Linq.XName
 66589                                    Azure.Storage.Files.Shares.Models.Range.FromXml));
 6590
 6591                        // Get response headers
 6592                        string _header;
 66593                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 6594                        {
 66595                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 6596                        }
 66597                        if (response.Headers.TryGetValue("ETag", out _header))
 6598                        {
 66599                            _value.ETag = new Azure.ETag(_header);
 6600                        }
 66601                        if (response.Headers.TryGetValue("x-ms-content-length", out _header))
 6602                        {
 66603                            _value.FileContentLength = long.Parse(_header, System.Globalization.CultureInfo.InvariantCul
 6604                        }
 6605
 6606                        // Create the response
 66607                        return Response.FromValue(_value, response);
 6608                    }
 6609                    case 304:
 6610                    {
 06611                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.ShareFileRangeInfoInternal>(re
 6612                    }
 6613                    default:
 6614                    {
 6615                        // Create the result
 46616                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 46617                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 6618
 46619                        throw _value.CreateException(clientDiagnostics, response);
 6620                    }
 6621                }
 6622            }
 6623            #endregion File.GetRangeListAsync
 6624
 6625            #region File.StartCopyAsync
 6626            /// <summary>
 6627            /// Copies a blob or file to a destination file within the storage account.
 6628            /// </summary>
 6629            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 6630            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6631            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6632            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6633            /// <param name="copySource">Specifies the URL of the source file or blob, up to 2 KB in length. To copy a f
 6634            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6635            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 6636            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 6637            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 6638            /// <param name="filePermissionCopyMode">Specifies the option to copy file security descriptor from source f
 6639            /// <param name="ignoreReadOnly">Specifies the option to overwrite the target file if it already exists and 
 6640            /// <param name="fileAttributes">Specifies either the option to copy file attributes from a source file(sour
 6641            /// <param name="fileCreationTime">Specifies either the option to copy file creation time from a source file
 6642            /// <param name="fileLastWriteTime">Specifies either the option to copy file last write time from a source f
 6643            /// <param name="setArchiveAttribute">Specifies the option to set archive attribute on a target file. True m
 6644            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6645            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 6646            /// <param name="operationName">Operation name.</param>
 6647            /// <param name="cancellationToken">Cancellation token.</param>
 6648            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileCopyInfo}</returns>
 6649            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.ShareF
 6650                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6651                Azure.Core.Pipeline.HttpPipeline pipeline,
 6652                System.Uri resourceUri,
 6653                string version,
 6654                System.Uri copySource,
 6655                int? timeout = default,
 6656                System.Collections.Generic.IDictionary<string, string> metadata = default,
 6657                string filePermission = default,
 6658                string filePermissionKey = default,
 6659                Azure.Storage.Files.Shares.Models.PermissionCopyMode? filePermissionCopyMode = default,
 6660                bool? ignoreReadOnly = default,
 6661                string fileAttributes = default,
 6662                string fileCreationTime = default,
 6663                string fileLastWriteTime = default,
 6664                bool? setArchiveAttribute = default,
 6665                string leaseId = default,
 6666                bool async = true,
 6667                string operationName = "FileClient.StartCopy",
 6668                System.Threading.CancellationToken cancellationToken = default)
 6669            {
 246670                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 6671                try
 6672                {
 246673                    _scope.AddAttribute("url", resourceUri);
 246674                    _scope.Start();
 246675                    using (Azure.Core.HttpMessage _message = StartCopyAsync_CreateMessage(
 246676                        pipeline,
 246677                        resourceUri,
 246678                        version,
 246679                        copySource,
 246680                        timeout,
 246681                        metadata,
 246682                        filePermission,
 246683                        filePermissionKey,
 246684                        filePermissionCopyMode,
 246685                        ignoreReadOnly,
 246686                        fileAttributes,
 246687                        fileCreationTime,
 246688                        fileLastWriteTime,
 246689                        setArchiveAttribute,
 246690                        leaseId))
 6691                    {
 246692                        if (async)
 6693                        {
 6694                            // Send the request asynchronously if we're being called via an async path
 126695                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 6696                        }
 6697                        else
 6698                        {
 6699                            // Send the request synchronously through the API that blocks if we're being called via a sy
 6700                            // (this is safe because the Task will complete before the user can call Wait)
 126701                            pipeline.Send(_message, cancellationToken);
 6702                        }
 246703                        Azure.Response _response = _message.Response;
 246704                        cancellationToken.ThrowIfCancellationRequested();
 246705                        return StartCopyAsync_CreateResponse(clientDiagnostics, _response);
 6706                    }
 6707                }
 46708                catch (System.Exception ex)
 6709                {
 46710                    _scope.Failed(ex);
 46711                    throw;
 6712                }
 6713                finally
 6714                {
 246715                    _scope.Dispose();
 6716                }
 206717            }
 6718
 6719            /// <summary>
 6720            /// Create the File.StartCopyAsync request.
 6721            /// </summary>
 6722            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6723            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6724            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6725            /// <param name="copySource">Specifies the URL of the source file or blob, up to 2 KB in length. To copy a f
 6726            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6727            /// <param name="metadata">A name-value pair to associate with a file storage object.</param>
 6728            /// <param name="filePermission">If specified the permission (security descriptor) shall be set for the dire
 6729            /// <param name="filePermissionKey">Key of the permission to be set for the directory/file. Note: Only one o
 6730            /// <param name="filePermissionCopyMode">Specifies the option to copy file security descriptor from source f
 6731            /// <param name="ignoreReadOnly">Specifies the option to overwrite the target file if it already exists and 
 6732            /// <param name="fileAttributes">Specifies either the option to copy file attributes from a source file(sour
 6733            /// <param name="fileCreationTime">Specifies either the option to copy file creation time from a source file
 6734            /// <param name="fileLastWriteTime">Specifies either the option to copy file last write time from a source f
 6735            /// <param name="setArchiveAttribute">Specifies the option to set archive attribute on a target file. True m
 6736            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6737            /// <returns>The File.StartCopyAsync Message.</returns>
 6738            internal static Azure.Core.HttpMessage StartCopyAsync_CreateMessage(
 6739                Azure.Core.Pipeline.HttpPipeline pipeline,
 6740                System.Uri resourceUri,
 6741                string version,
 6742                System.Uri copySource,
 6743                int? timeout = default,
 6744                System.Collections.Generic.IDictionary<string, string> metadata = default,
 6745                string filePermission = default,
 6746                string filePermissionKey = default,
 6747                Azure.Storage.Files.Shares.Models.PermissionCopyMode? filePermissionCopyMode = default,
 6748                bool? ignoreReadOnly = default,
 6749                string fileAttributes = default,
 6750                string fileCreationTime = default,
 6751                string fileLastWriteTime = default,
 6752                bool? setArchiveAttribute = default,
 6753                string leaseId = default)
 6754            {
 6755                // Validation
 246756                if (resourceUri == null)
 6757                {
 06758                    throw new System.ArgumentNullException(nameof(resourceUri));
 6759                }
 246760                if (version == null)
 6761                {
 06762                    throw new System.ArgumentNullException(nameof(version));
 6763                }
 246764                if (copySource == null)
 6765                {
 06766                    throw new System.ArgumentNullException(nameof(copySource));
 6767                }
 6768
 6769                // Create the request
 246770                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 246771                Azure.Core.Request _request = _message.Request;
 6772
 6773                // Set the endpoint
 246774                _request.Method = Azure.Core.RequestMethod.Put;
 246775                _request.Uri.Reset(resourceUri);
 06776                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 6777
 6778                // Add request headers
 246779                _request.Headers.SetValue("x-ms-version", version);
 246780                _request.Headers.SetValue("x-ms-copy-source", copySource.AbsoluteUri);
 246781                if (metadata != null) {
 206782                    foreach (System.Collections.Generic.KeyValuePair<string, string> _pair in metadata)
 6783                    {
 86784                        _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value);
 6785                    }
 6786                }
 266787                if (filePermission != null) { _request.Headers.SetValue("x-ms-file-permission", filePermission); }
 266788                if (filePermissionKey != null) { _request.Headers.SetValue("x-ms-file-permission-key", filePermissionKey
 286789                if (filePermissionCopyMode != null) { _request.Headers.SetValue("x-ms-file-permission-copy-mode", Azure.
 246790                if (ignoreReadOnly != null) {
 6791                #pragma warning disable CA1308 // Normalize strings to uppercase
 26792                _request.Headers.SetValue("x-ms-file-copy-ignore-read-only", ignoreReadOnly.Value.ToString(System.Global
 6793                #pragma warning restore CA1308 // Normalize strings to uppercase
 6794                }
 286795                if (fileAttributes != null) { _request.Headers.SetValue("x-ms-file-attributes", fileAttributes); }
 286796                if (fileCreationTime != null) { _request.Headers.SetValue("x-ms-file-creation-time", fileCreationTime); 
 286797                if (fileLastWriteTime != null) { _request.Headers.SetValue("x-ms-file-last-write-time", fileLastWriteTim
 246798                if (setArchiveAttribute != null) {
 6799                #pragma warning disable CA1308 // Normalize strings to uppercase
 26800                _request.Headers.SetValue("x-ms-file-copy-set-archive", setArchiveAttribute.Value.ToString(System.Global
 6801                #pragma warning restore CA1308 // Normalize strings to uppercase
 6802                }
 306803                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 6804
 246805                return _message;
 6806            }
 6807
 6808            /// <summary>
 6809            /// Create the File.StartCopyAsync response or throw a failure exception.
 6810            /// </summary>
 6811            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 6812            /// <param name="response">The raw Response.</param>
 6813            /// <returns>The File.StartCopyAsync Azure.Response{Azure.Storage.Files.Shares.Models.ShareFileCopyInfo}.</r
 6814            internal static Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileCopyInfo> StartCopyAsync_CreateRes
 6815                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6816                Azure.Response response)
 6817            {
 6818                // Process the response
 246819                switch (response.Status)
 6820                {
 6821                    case 202:
 6822                    {
 6823                        // Create the result
 206824                        Azure.Storage.Files.Shares.Models.ShareFileCopyInfo _value = new Azure.Storage.Files.Shares.Mode
 6825
 6826                        // Get response headers
 6827                        string _header;
 206828                        if (response.Headers.TryGetValue("ETag", out _header))
 6829                        {
 206830                            _value.ETag = new Azure.ETag(_header);
 6831                        }
 206832                        if (response.Headers.TryGetValue("Last-Modified", out _header))
 6833                        {
 206834                            _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.
 6835                        }
 206836                        if (response.Headers.TryGetValue("x-ms-copy-id", out _header))
 6837                        {
 206838                            _value.CopyId = _header;
 6839                        }
 206840                        if (response.Headers.TryGetValue("x-ms-copy-status", out _header))
 6841                        {
 206842                            _value.CopyStatus = Azure.Storage.Files.Shares.FileRestClient.Serialization.ParseCopyStatus(
 6843                        }
 6844
 6845                        // Create the response
 206846                        return Response.FromValue(_value, response);
 6847                    }
 6848                    default:
 6849                    {
 6850                        // Create the result
 46851                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 46852                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 6853
 46854                        throw _value.CreateException(clientDiagnostics, response);
 6855                    }
 6856                }
 6857            }
 6858            #endregion File.StartCopyAsync
 6859
 6860            #region File.AbortCopyAsync
 6861            /// <summary>
 6862            /// Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata.
 6863            /// </summary>
 6864            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 6865            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6866            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6867            /// <param name="copyId">The copy identifier provided in the x-ms-copy-id header of the original Copy File o
 6868            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6869            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6870            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6871            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 6872            /// <param name="operationName">Operation name.</param>
 6873            /// <param name="cancellationToken">Cancellation token.</param>
 6874            /// <returns>Azure.Response</returns>
 6875            public static async System.Threading.Tasks.ValueTask<Azure.Response> AbortCopyAsync(
 6876                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6877                Azure.Core.Pipeline.HttpPipeline pipeline,
 6878                System.Uri resourceUri,
 6879                string copyId,
 6880                string version,
 6881                int? timeout = default,
 6882                string leaseId = default,
 6883                bool async = true,
 6884                string operationName = "FileClient.AbortCopy",
 6885                System.Threading.CancellationToken cancellationToken = default)
 6886            {
 86887                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 6888                try
 6889                {
 86890                    _scope.AddAttribute("url", resourceUri);
 86891                    _scope.Start();
 86892                    using (Azure.Core.HttpMessage _message = AbortCopyAsync_CreateMessage(
 86893                        pipeline,
 86894                        resourceUri,
 86895                        copyId,
 86896                        version,
 86897                        timeout,
 86898                        leaseId))
 6899                    {
 86900                        if (async)
 6901                        {
 6902                            // Send the request asynchronously if we're being called via an async path
 46903                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 6904                        }
 6905                        else
 6906                        {
 6907                            // Send the request synchronously through the API that blocks if we're being called via a sy
 6908                            // (this is safe because the Task will complete before the user can call Wait)
 46909                            pipeline.Send(_message, cancellationToken);
 6910                        }
 86911                        Azure.Response _response = _message.Response;
 86912                        cancellationToken.ThrowIfCancellationRequested();
 86913                        return AbortCopyAsync_CreateResponse(clientDiagnostics, _response);
 6914                    }
 6915                }
 86916                catch (System.Exception ex)
 6917                {
 86918                    _scope.Failed(ex);
 86919                    throw;
 6920                }
 6921                finally
 6922                {
 86923                    _scope.Dispose();
 6924                }
 06925            }
 6926
 6927            /// <summary>
 6928            /// Create the File.AbortCopyAsync request.
 6929            /// </summary>
 6930            /// <param name="pipeline">The pipeline used for sending requests.</param>
 6931            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 6932            /// <param name="copyId">The copy identifier provided in the x-ms-copy-id header of the original Copy File o
 6933            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 6934            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 6935            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 6936            /// <returns>The File.AbortCopyAsync Message.</returns>
 6937            internal static Azure.Core.HttpMessage AbortCopyAsync_CreateMessage(
 6938                Azure.Core.Pipeline.HttpPipeline pipeline,
 6939                System.Uri resourceUri,
 6940                string copyId,
 6941                string version,
 6942                int? timeout = default,
 6943                string leaseId = default)
 6944            {
 6945                // Validation
 86946                if (resourceUri == null)
 6947                {
 06948                    throw new System.ArgumentNullException(nameof(resourceUri));
 6949                }
 86950                if (copyId == null)
 6951                {
 06952                    throw new System.ArgumentNullException(nameof(copyId));
 6953                }
 86954                if (version == null)
 6955                {
 06956                    throw new System.ArgumentNullException(nameof(version));
 6957                }
 6958
 6959                // Create the request
 86960                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 86961                Azure.Core.Request _request = _message.Request;
 6962
 6963                // Set the endpoint
 86964                _request.Method = Azure.Core.RequestMethod.Put;
 86965                _request.Uri.Reset(resourceUri);
 86966                _request.Uri.AppendQuery("comp", "copy", escapeValue: false);
 86967                _request.Uri.AppendQuery("copyid", copyId);
 06968                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 6969
 6970                // Add request headers
 86971                _request.Headers.SetValue("x-ms-copy-action", "abort");
 86972                _request.Headers.SetValue("x-ms-version", version);
 126973                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 6974
 86975                return _message;
 6976            }
 6977
 6978            /// <summary>
 6979            /// Create the File.AbortCopyAsync response or throw a failure exception.
 6980            /// </summary>
 6981            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 6982            /// <param name="response">The raw Response.</param>
 6983            /// <returns>The File.AbortCopyAsync Azure.Response.</returns>
 6984            internal static Azure.Response AbortCopyAsync_CreateResponse(
 6985                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 6986                Azure.Response response)
 6987            {
 6988                // Process the response
 86989                switch (response.Status)
 6990                {
 6991                    case 204:
 6992                    {
 06993                        return response;
 6994                    }
 6995                    default:
 6996                    {
 6997                        // Create the result
 86998                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 86999                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 7000
 87001                        throw _value.CreateException(clientDiagnostics, response);
 7002                    }
 7003                }
 7004            }
 7005            #endregion File.AbortCopyAsync
 7006
 7007            #region File.ListHandlesAsync
 7008            /// <summary>
 7009            /// Lists handles for file
 7010            /// </summary>
 7011            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 7012            /// <param name="pipeline">The pipeline used for sending requests.</param>
 7013            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 7014            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 7015            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 7016            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 7017            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 7018            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 7019            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 7020            /// <param name="operationName">Operation name.</param>
 7021            /// <param name="cancellationToken">Cancellation token.</param>
 7022            /// <returns>An enumeration of handles.</returns>
 7023            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.Storag
 7024                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 7025                Azure.Core.Pipeline.HttpPipeline pipeline,
 7026                System.Uri resourceUri,
 7027                string version,
 7028                string marker = default,
 7029                int? maxresults = default,
 7030                int? timeout = default,
 7031                string sharesnapshot = default,
 7032                bool async = true,
 7033                string operationName = "FileClient.ListHandles",
 7034                System.Threading.CancellationToken cancellationToken = default)
 7035            {
 67036                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 7037                try
 7038                {
 67039                    _scope.AddAttribute("url", resourceUri);
 67040                    _scope.Start();
 67041                    using (Azure.Core.HttpMessage _message = ListHandlesAsync_CreateMessage(
 67042                        pipeline,
 67043                        resourceUri,
 67044                        version,
 67045                        marker,
 67046                        maxresults,
 67047                        timeout,
 67048                        sharesnapshot))
 7049                    {
 67050                        if (async)
 7051                        {
 7052                            // Send the request asynchronously if we're being called via an async path
 37053                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 7054                        }
 7055                        else
 7056                        {
 7057                            // Send the request synchronously through the API that blocks if we're being called via a sy
 7058                            // (this is safe because the Task will complete before the user can call Wait)
 37059                            pipeline.Send(_message, cancellationToken);
 7060                        }
 67061                        Azure.Response _response = _message.Response;
 67062                        cancellationToken.ThrowIfCancellationRequested();
 67063                        return ListHandlesAsync_CreateResponse(clientDiagnostics, _response);
 7064                    }
 7065                }
 27066                catch (System.Exception ex)
 7067                {
 27068                    _scope.Failed(ex);
 27069                    throw;
 7070                }
 7071                finally
 7072                {
 67073                    _scope.Dispose();
 7074                }
 47075            }
 7076
 7077            /// <summary>
 7078            /// Create the File.ListHandlesAsync request.
 7079            /// </summary>
 7080            /// <param name="pipeline">The pipeline used for sending requests.</param>
 7081            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 7082            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 7083            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 7084            /// <param name="maxresults">Specifies the maximum number of entries to return. If the request does not spec
 7085            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 7086            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 7087            /// <returns>The File.ListHandlesAsync Message.</returns>
 7088            internal static Azure.Core.HttpMessage ListHandlesAsync_CreateMessage(
 7089                Azure.Core.Pipeline.HttpPipeline pipeline,
 7090                System.Uri resourceUri,
 7091                string version,
 7092                string marker = default,
 7093                int? maxresults = default,
 7094                int? timeout = default,
 7095                string sharesnapshot = default)
 7096            {
 7097                // Validation
 67098                if (resourceUri == null)
 7099                {
 07100                    throw new System.ArgumentNullException(nameof(resourceUri));
 7101                }
 67102                if (version == null)
 7103                {
 07104                    throw new System.ArgumentNullException(nameof(version));
 7105                }
 7106
 7107                // Create the request
 67108                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 67109                Azure.Core.Request _request = _message.Request;
 7110
 7111                // Set the endpoint
 67112                _request.Method = Azure.Core.RequestMethod.Get;
 67113                _request.Uri.Reset(resourceUri);
 67114                _request.Uri.AppendQuery("comp", "listhandles", escapeValue: false);
 07115                if (marker != null) { _request.Uri.AppendQuery("marker", marker); }
 07116                if (maxresults != null) { _request.Uri.AppendQuery("maxresults", maxresults.Value.ToString(System.Global
 07117                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 07118                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 7119
 7120                // Add request headers
 67121                _request.Headers.SetValue("x-ms-version", version);
 7122
 67123                return _message;
 7124            }
 7125
 7126            /// <summary>
 7127            /// Create the File.ListHandlesAsync response or throw a failure exception.
 7128            /// </summary>
 7129            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 7130            /// <param name="response">The raw Response.</param>
 7131            /// <returns>The File.ListHandlesAsync Azure.Response{Azure.Storage.Files.Shares.Models.StorageHandlesSegmen
 7132            internal static Azure.Response<Azure.Storage.Files.Shares.Models.StorageHandlesSegment> ListHandlesAsync_Cre
 7133                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 7134                Azure.Response response)
 7135            {
 7136                // Process the response
 67137                switch (response.Status)
 7138                {
 7139                    case 200:
 7140                    {
 7141                        // Create the result
 47142                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 47143                        Azure.Storage.Files.Shares.Models.StorageHandlesSegment _value = Azure.Storage.Files.Shares.Mode
 7144
 7145                        // Create the response
 47146                        return Response.FromValue(_value, response);
 7147                    }
 7148                    case 304:
 7149                    {
 07150                        return new Azure.NoBodyResponse<Azure.Storage.Files.Shares.Models.StorageHandlesSegment>(respons
 7151                    }
 7152                    default:
 7153                    {
 7154                        // Create the result
 27155                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 27156                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 7157
 27158                        throw _value.CreateException(clientDiagnostics, response);
 7159                    }
 7160                }
 7161            }
 7162            #endregion File.ListHandlesAsync
 7163
 7164            #region File.ForceCloseHandlesAsync
 7165            /// <summary>
 7166            /// Closes all handles open for given file
 7167            /// </summary>
 7168            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 7169            /// <param name="pipeline">The pipeline used for sending requests.</param>
 7170            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 7171            /// <param name="handleId">Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) 
 7172            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 7173            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 7174            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 7175            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 7176            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 7177            /// <param name="operationName">Operation name.</param>
 7178            /// <param name="cancellationToken">Cancellation token.</param>
 7179            /// <returns>Azure.Response{Azure.Storage.Files.Shares.Models.StorageClosedHandlesSegment}</returns>
 7180            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Files.Shares.Models.Storag
 7181                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 7182                Azure.Core.Pipeline.HttpPipeline pipeline,
 7183                System.Uri resourceUri,
 7184                string handleId,
 7185                string version,
 7186                int? timeout = default,
 7187                string marker = default,
 7188                string sharesnapshot = default,
 7189                bool async = true,
 7190                string operationName = "FileClient.ForceCloseHandles",
 7191                System.Threading.CancellationToken cancellationToken = default)
 7192            {
 67193                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 7194                try
 7195                {
 67196                    _scope.AddAttribute("url", resourceUri);
 67197                    _scope.Start();
 67198                    using (Azure.Core.HttpMessage _message = ForceCloseHandlesAsync_CreateMessage(
 67199                        pipeline,
 67200                        resourceUri,
 67201                        handleId,
 67202                        version,
 67203                        timeout,
 67204                        marker,
 67205                        sharesnapshot))
 7206                    {
 67207                        if (async)
 7208                        {
 7209                            // Send the request asynchronously if we're being called via an async path
 37210                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 7211                        }
 7212                        else
 7213                        {
 7214                            // Send the request synchronously through the API that blocks if we're being called via a sy
 7215                            // (this is safe because the Task will complete before the user can call Wait)
 37216                            pipeline.Send(_message, cancellationToken);
 7217                        }
 67218                        Azure.Response _response = _message.Response;
 67219                        cancellationToken.ThrowIfCancellationRequested();
 67220                        return ForceCloseHandlesAsync_CreateResponse(clientDiagnostics, _response);
 7221                    }
 7222                }
 47223                catch (System.Exception ex)
 7224                {
 47225                    _scope.Failed(ex);
 47226                    throw;
 7227                }
 7228                finally
 7229                {
 67230                    _scope.Dispose();
 7231                }
 27232            }
 7233
 7234            /// <summary>
 7235            /// Create the File.ForceCloseHandlesAsync request.
 7236            /// </summary>
 7237            /// <param name="pipeline">The pipeline used for sending requests.</param>
 7238            /// <param name="resourceUri">The URL of the service account, share, directory or file that is the target of
 7239            /// <param name="handleId">Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) 
 7240            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 7241            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 7242            /// <param name="marker">A string value that identifies the portion of the list to be returned with the next
 7243            /// <param name="sharesnapshot">The snapshot parameter is an opaque DateTime value that, when present, speci
 7244            /// <returns>The File.ForceCloseHandlesAsync Message.</returns>
 7245            internal static Azure.Core.HttpMessage ForceCloseHandlesAsync_CreateMessage(
 7246                Azure.Core.Pipeline.HttpPipeline pipeline,
 7247                System.Uri resourceUri,
 7248                string handleId,
 7249                string version,
 7250                int? timeout = default,
 7251                string marker = default,
 7252                string sharesnapshot = default)
 7253            {
 7254                // Validation
 67255                if (resourceUri == null)
 7256                {
 07257                    throw new System.ArgumentNullException(nameof(resourceUri));
 7258                }
 67259                if (handleId == null)
 7260                {
 07261                    throw new System.ArgumentNullException(nameof(handleId));
 7262                }
 67263                if (version == null)
 7264                {
 07265                    throw new System.ArgumentNullException(nameof(version));
 7266                }
 7267
 7268                // Create the request
 67269                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 67270                Azure.Core.Request _request = _message.Request;
 7271
 7272                // Set the endpoint
 67273                _request.Method = Azure.Core.RequestMethod.Put;
 67274                _request.Uri.Reset(resourceUri);
 67275                _request.Uri.AppendQuery("comp", "forceclosehandles", escapeValue: false);
 07276                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 07277                if (marker != null) { _request.Uri.AppendQuery("marker", marker); }
 07278                if (sharesnapshot != null) { _request.Uri.AppendQuery("sharesnapshot", sharesnapshot); }
 7279
 7280                // Add request headers
 67281                _request.Headers.SetValue("x-ms-handle-id", handleId);
 67282                _request.Headers.SetValue("x-ms-version", version);
 7283
 67284                return _message;
 7285            }
 7286
 7287            /// <summary>
 7288            /// Create the File.ForceCloseHandlesAsync response or throw a failure exception.
 7289            /// </summary>
 7290            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 7291            /// <param name="response">The raw Response.</param>
 7292            /// <returns>The File.ForceCloseHandlesAsync Azure.Response{Azure.Storage.Files.Shares.Models.StorageClosedH
 7293            internal static Azure.Response<Azure.Storage.Files.Shares.Models.StorageClosedHandlesSegment> ForceCloseHand
 7294                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 7295                Azure.Response response)
 7296            {
 7297                // Process the response
 67298                switch (response.Status)
 7299                {
 7300                    case 200:
 7301                    {
 7302                        // Create the result
 27303                        Azure.Storage.Files.Shares.Models.StorageClosedHandlesSegment _value = new Azure.Storage.Files.S
 7304
 7305                        // Get response headers
 7306                        string _header;
 27307                        if (response.Headers.TryGetValue("x-ms-marker", out _header))
 7308                        {
 07309                            _value.Marker = _header;
 7310                        }
 27311                        if (response.Headers.TryGetValue("x-ms-number-of-handles-closed", out _header))
 7312                        {
 27313                            _value.NumberOfHandlesClosed = int.Parse(_header, System.Globalization.CultureInfo.Invariant
 7314                        }
 27315                        if (response.Headers.TryGetValue("x-ms-number-of-handles-failed", out _header))
 7316                        {
 27317                            _value.NumberOfHandlesFailedToClose = int.Parse(_header, System.Globalization.CultureInfo.In
 7318                        }
 7319
 7320                        // Create the response
 27321                        return Response.FromValue(_value, response);
 7322                    }
 7323                    default:
 7324                    {
 7325                        // Create the result
 47326                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 47327                        Azure.Storage.Files.Shares.Models.StorageError _value = Azure.Storage.Files.Shares.Models.Storag
 7328
 47329                        throw _value.CreateException(clientDiagnostics, response);
 7330                    }
 7331                }
 7332            }
 7333            #endregion File.ForceCloseHandlesAsync
 7334        }
 7335        #endregion File operations
 7336    }
 7337}
 7338#endregion Service
 7339
 7340#region Models
 7341#region class BrokenLease
 7342namespace Azure.Storage.Files.Shares.Models
 7343{
 7344    /// <summary>
 7345    /// BrokenLease
 7346    /// </summary>
 7347    internal partial class BrokenLease
 7348    {
 7349        /// <summary>
 7350        /// The ETag contains a value that you can use to perform operations conditionally. If the request version is 20
 7351        /// </summary>
 7352        public Azure.ETag ETag { get; internal set; }
 7353
 7354        /// <summary>
 7355        /// Returns the date and time the file was last modified. Any operation that modifies the file, including an upd
 7356        /// </summary>
 7357        public System.DateTimeOffset LastModified { get; internal set; }
 7358
 7359        /// <summary>
 7360        /// Uniquely identifies a file's lease
 7361        /// </summary>
 7362        public string LeaseId { get; internal set; }
 7363
 7364        /// <summary>
 7365        /// Prevent direct instantiation of BrokenLease instances.
 7366        /// You can use ShareModelFactory.BrokenLease instead.
 7367        /// </summary>
 7368        internal BrokenLease() { }
 7369    }
 7370}
 7371#endregion class BrokenLease
 7372
 7373#region enum CopyStatus
 7374namespace Azure.Storage.Files.Shares.Models
 7375{
 7376    /// <summary>
 7377    /// State of the copy operation identified by 'x-ms-copy-id'.
 7378    /// </summary>
 7379    #pragma warning disable CA1717 // Only FlagsAttribute enums should have plural names
 7380    public enum CopyStatus
 7381    #pragma warning restore CA1717 // Only FlagsAttribute enums should have plural names
 7382    {
 7383        /// <summary>
 7384        /// pending
 7385        /// </summary>
 7386        Pending,
 7387
 7388        /// <summary>
 7389        /// success
 7390        /// </summary>
 7391        Success,
 7392
 7393        /// <summary>
 7394        /// aborted
 7395        /// </summary>
 7396        Aborted,
 7397
 7398        /// <summary>
 7399        /// failed
 7400        /// </summary>
 7401        Failed
 7402    }
 7403}
 7404
 7405namespace Azure.Storage.Files.Shares
 7406{
 7407    internal static partial class FileRestClient
 7408    {
 7409        public static partial class Serialization
 7410        {
 7411            public static string ToString(Azure.Storage.Files.Shares.Models.CopyStatus value)
 7412            {
 07413                return value switch
 07414                {
 07415                    Azure.Storage.Files.Shares.Models.CopyStatus.Pending => "pending",
 07416                    Azure.Storage.Files.Shares.Models.CopyStatus.Success => "success",
 07417                    Azure.Storage.Files.Shares.Models.CopyStatus.Aborted => "aborted",
 07418                    Azure.Storage.Files.Shares.Models.CopyStatus.Failed => "failed",
 07419                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 07420                };
 7421            }
 7422
 7423            public static Azure.Storage.Files.Shares.Models.CopyStatus ParseCopyStatus(string value)
 7424            {
 287425                return value switch
 287426                {
 07427                    "pending" => Azure.Storage.Files.Shares.Models.CopyStatus.Pending,
 567428                    "success" => Azure.Storage.Files.Shares.Models.CopyStatus.Success,
 07429                    "aborted" => Azure.Storage.Files.Shares.Models.CopyStatus.Aborted,
 07430                    "failed" => Azure.Storage.Files.Shares.Models.CopyStatus.Failed,
 07431                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 287432                };
 7433            }
 7434        }
 7435    }
 7436}
 7437#endregion enum CopyStatus
 7438
 7439#region enum DeleteSnapshotsOptionType
 7440namespace Azure.Storage.Files.Shares.Models
 7441{
 7442    /// <summary>
 7443    /// Specifies the option include to delete the base share and all of its snapshots.
 7444    /// </summary>
 7445    internal enum DeleteSnapshotsOptionType
 7446    {
 7447        /// <summary>
 7448        /// include
 7449        /// </summary>
 7450        Include
 7451    }
 7452}
 7453
 7454namespace Azure.Storage.Files.Shares
 7455{
 7456    internal static partial class FileRestClient
 7457    {
 7458        public static partial class Serialization
 7459        {
 7460            public static string ToString(Azure.Storage.Files.Shares.Models.DeleteSnapshotsOptionType value)
 7461            {
 4337462                return value switch
 4337463                {
 8667464                    Azure.Storage.Files.Shares.Models.DeleteSnapshotsOptionType.Include => "include",
 07465                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 4337466                };
 7467            }
 7468
 7469            public static Azure.Storage.Files.Shares.Models.DeleteSnapshotsOptionType ParseDeleteSnapshotsOptionType(str
 7470            {
 07471                return value switch
 07472                {
 07473                    "include" => Azure.Storage.Files.Shares.Models.DeleteSnapshotsOptionType.Include,
 07474                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 07475                };
 7476            }
 7477        }
 7478    }
 7479}
 7480#endregion enum DeleteSnapshotsOptionType
 7481
 7482#region class DirectoryItem
 7483namespace Azure.Storage.Files.Shares.Models
 7484{
 7485    /// <summary>
 7486    /// A listed directory item.
 7487    /// </summary>
 7488    internal partial class DirectoryItem
 7489    {
 7490        /// <summary>
 7491        /// Name
 7492        /// </summary>
 7493        public string Name { get; internal set; }
 7494
 7495        /// <summary>
 7496        /// Prevent direct instantiation of DirectoryItem instances.
 7497        /// You can use ShareModelFactory.DirectoryItem instead.
 7498        /// </summary>
 7499        internal DirectoryItem() { }
 7500
 7501        /// <summary>
 7502        /// Deserializes XML into a new DirectoryItem instance.
 7503        /// </summary>
 7504        /// <param name="element">The XML element to deserialize.</param>
 7505        /// <returns>A deserialized DirectoryItem instance.</returns>
 7506        internal static Azure.Storage.Files.Shares.Models.DirectoryItem FromXml(System.Xml.Linq.XElement element)
 7507        {
 7508            System.Diagnostics.Debug.Assert(element != null);
 7509            System.Xml.Linq.XElement _child;
 7510            Azure.Storage.Files.Shares.Models.DirectoryItem _value = new Azure.Storage.Files.Shares.Models.DirectoryItem
 7511            _child = element.Element(System.Xml.Linq.XName.Get("Name", ""));
 7512            if (_child != null)
 7513            {
 7514                _value.Name = _child.Value;
 7515            }
 7516            CustomizeFromXml(element, _value);
 7517            return _value;
 7518        }
 7519
 7520        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.Directo
 7521    }
 7522}
 7523#endregion class DirectoryItem
 7524
 7525#region class FailureNoContent
 7526namespace Azure.Storage.Files.Shares.Models
 7527{
 7528    /// <summary>
 7529    /// FailureNoContent
 7530    /// </summary>
 7531    internal partial class FailureNoContent
 7532    {
 7533        /// <summary>
 7534        /// x-ms-error-code
 7535        /// </summary>
 7536        public string ErrorCode { get; internal set; }
 7537
 7538        /// <summary>
 7539        /// Prevent direct instantiation of FailureNoContent instances.
 7540        /// You can use ShareModelFactory.FailureNoContent instead.
 7541        /// </summary>
 7542        internal FailureNoContent() { }
 7543    }
 7544}
 7545#endregion class FailureNoContent
 7546
 7547#region class FileUploadRangeFromURLResult
 7548namespace Azure.Storage.Files.Shares.Models
 7549{
 7550    /// <summary>
 7551    /// File UploadRangeFromURLResult
 7552    /// </summary>
 7553    internal partial class FileUploadRangeFromURLResult
 7554    {
 7555        /// <summary>
 7556        /// The ETag contains a value which represents the version of the file, in quotes.
 7557        /// </summary>
 7558        public Azure.ETag ETag { get; internal set; }
 7559
 7560        /// <summary>
 7561        /// Returns the date and time the directory was last modified. Any operation that modifies the share or its prop
 7562        /// </summary>
 7563        public System.DateTimeOffset LastModified { get; internal set; }
 7564
 7565        /// <summary>
 7566        /// This header is returned so that the client can check for message content integrity. The value of this header
 7567        /// </summary>
 7568        #pragma warning disable CA1819 // Properties should not return arrays
 7569        public byte[] XMSContentCrc64 { get; internal set; }
 7570        #pragma warning restore CA1819 // Properties should not return arrays
 7571
 7572        /// <summary>
 7573        /// The value of this header is set to true if the contents of the request are successfully encrypted using the 
 7574        /// </summary>
 7575        public bool IsServerEncrypted { get; internal set; }
 7576
 7577        /// <summary>
 7578        /// Prevent direct instantiation of FileUploadRangeFromURLResult instances.
 7579        /// You can use ShareModelFactory.FileUploadRangeFromURLResult instead.
 7580        /// </summary>
 7581        internal FileUploadRangeFromURLResult() { }
 7582    }
 7583}
 7584#endregion class FileUploadRangeFromURLResult
 7585
 7586#region class FileItem
 7587namespace Azure.Storage.Files.Shares.Models
 7588{
 7589    /// <summary>
 7590    /// A listed file item.
 7591    /// </summary>
 7592    internal partial class FileItem
 7593    {
 7594        /// <summary>
 7595        /// Name
 7596        /// </summary>
 7597        public string Name { get; internal set; }
 7598
 7599        /// <summary>
 7600        /// File properties.
 7601        /// </summary>
 7602        public Azure.Storage.Files.Shares.Models.FileProperty Properties { get; internal set; }
 7603
 7604        /// <summary>
 7605        /// Creates a new FileItem instance
 7606        /// </summary>
 7607        public FileItem()
 7608            : this(false)
 7609        {
 7610        }
 7611
 7612        /// <summary>
 7613        /// Creates a new FileItem instance
 7614        /// </summary>
 7615        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 7616        internal FileItem(bool skipInitialization)
 7617        {
 7618            if (!skipInitialization)
 7619            {
 7620                Properties = new Azure.Storage.Files.Shares.Models.FileProperty();
 7621            }
 7622        }
 7623
 7624        /// <summary>
 7625        /// Deserializes XML into a new FileItem instance.
 7626        /// </summary>
 7627        /// <param name="element">The XML element to deserialize.</param>
 7628        /// <returns>A deserialized FileItem instance.</returns>
 7629        internal static Azure.Storage.Files.Shares.Models.FileItem FromXml(System.Xml.Linq.XElement element)
 7630        {
 7631            System.Diagnostics.Debug.Assert(element != null);
 7632            System.Xml.Linq.XElement _child;
 7633            Azure.Storage.Files.Shares.Models.FileItem _value = new Azure.Storage.Files.Shares.Models.FileItem(true);
 7634            _child = element.Element(System.Xml.Linq.XName.Get("Name", ""));
 7635            if (_child != null)
 7636            {
 7637                _value.Name = _child.Value;
 7638            }
 7639            _child = element.Element(System.Xml.Linq.XName.Get("Properties", ""));
 7640            if (_child != null)
 7641            {
 7642                _value.Properties = Azure.Storage.Files.Shares.Models.FileProperty.FromXml(_child);
 7643            }
 7644            CustomizeFromXml(element, _value);
 7645            return _value;
 7646        }
 7647
 7648        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.FileIte
 7649    }
 7650}
 7651#endregion class FileItem
 7652
 7653#region class FileLeaseReleaseInfo
 7654namespace Azure.Storage.Files.Shares.Models
 7655{
 7656    /// <summary>
 7657    /// FileLeaseReleaseInfo
 7658    /// </summary>
 7659    public partial class FileLeaseReleaseInfo
 7660    {
 7661        /// <summary>
 7662        /// The ETag contains a value that you can use to perform operations conditionally. If the request version is 20
 7663        /// </summary>
 7664        public Azure.ETag ETag { get; internal set; }
 7665
 7666        /// <summary>
 7667        /// Returns the date and time the file was last modified. Any operation that modifies the file, including an upd
 7668        /// </summary>
 7669        public System.DateTimeOffset LastModified { get; internal set; }
 7670
 7671        /// <summary>
 7672        /// Prevent direct instantiation of FileLeaseReleaseInfo instances.
 7673        /// You can use ShareModelFactory.FileLeaseReleaseInfo instead.
 7674        /// </summary>
 7675        internal FileLeaseReleaseInfo() { }
 7676    }
 7677
 7678    /// <summary>
 7679    /// ShareModelFactory provides utilities for mocking.
 7680    /// </summary>
 7681    public static partial class ShareModelFactory
 7682    {
 7683        /// <summary>
 7684        /// Creates a new FileLeaseReleaseInfo instance for mocking.
 7685        /// </summary>
 7686        public static FileLeaseReleaseInfo FileLeaseReleaseInfo(
 7687            Azure.ETag eTag,
 7688            System.DateTimeOffset lastModified)
 7689        {
 7690            return new FileLeaseReleaseInfo()
 7691            {
 7692                ETag = eTag,
 7693                LastModified = lastModified,
 7694            };
 7695        }
 7696    }
 7697}
 7698#endregion class FileLeaseReleaseInfo
 7699
 7700#region class FileProperty
 7701namespace Azure.Storage.Files.Shares.Models
 7702{
 7703    /// <summary>
 7704    /// File properties.
 7705    /// </summary>
 7706    internal partial class FileProperty
 7707    {
 7708        /// <summary>
 7709        /// Content length of the file. This value may not be up-to-date since an SMB client may have modified the file 
 7710        /// </summary>
 7711        public long ContentLength { get; internal set; }
 7712
 7713        /// <summary>
 7714        /// Prevent direct instantiation of FileProperty instances.
 7715        /// You can use ShareModelFactory.FileProperty instead.
 7716        /// </summary>
 7717        internal FileProperty() { }
 7718
 7719        /// <summary>
 7720        /// Deserializes XML into a new FileProperty instance.
 7721        /// </summary>
 7722        /// <param name="element">The XML element to deserialize.</param>
 7723        /// <returns>A deserialized FileProperty instance.</returns>
 7724        internal static Azure.Storage.Files.Shares.Models.FileProperty FromXml(System.Xml.Linq.XElement element)
 7725        {
 7726            System.Diagnostics.Debug.Assert(element != null);
 7727            System.Xml.Linq.XElement _child;
 7728            Azure.Storage.Files.Shares.Models.FileProperty _value = new Azure.Storage.Files.Shares.Models.FileProperty()
 7729            _child = element.Element(System.Xml.Linq.XName.Get("Content-Length", ""));
 7730            if (_child != null)
 7731            {
 7732                _value.ContentLength = long.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 7733            }
 7734            CustomizeFromXml(element, _value);
 7735            return _value;
 7736        }
 7737
 7738        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.FilePro
 7739    }
 7740}
 7741#endregion class FileProperty
 7742
 7743#region class FilesAndDirectoriesSegment
 7744namespace Azure.Storage.Files.Shares.Models
 7745{
 7746    /// <summary>
 7747    /// An enumeration of directories and files.
 7748    /// </summary>
 7749    internal partial class FilesAndDirectoriesSegment
 7750    {
 7751        /// <summary>
 7752        /// ServiceEndpoint
 7753        /// </summary>
 7754        public string ServiceEndpoint { get; internal set; }
 7755
 7756        /// <summary>
 7757        /// ShareName
 7758        /// </summary>
 7759        public string ShareName { get; internal set; }
 7760
 7761        /// <summary>
 7762        /// ShareSnapshot
 7763        /// </summary>
 7764        public string ShareSnapshot { get; internal set; }
 7765
 7766        /// <summary>
 7767        /// DirectoryPath
 7768        /// </summary>
 7769        public string DirectoryPath { get; internal set; }
 7770
 7771        /// <summary>
 7772        /// Prefix
 7773        /// </summary>
 7774        public string Prefix { get; internal set; }
 7775
 7776        /// <summary>
 7777        /// Marker
 7778        /// </summary>
 7779        public string Marker { get; internal set; }
 7780
 7781        /// <summary>
 7782        /// MaxResults
 7783        /// </summary>
 7784        public int? MaxResults { get; internal set; }
 7785
 7786        /// <summary>
 7787        /// NextMarker
 7788        /// </summary>
 7789        public string NextMarker { get; internal set; }
 7790
 7791        /// <summary>
 7792        /// DirectoryItems
 7793        /// </summary>
 7794        public System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.DirectoryItem> DirectoryItems { 
 7795
 7796        /// <summary>
 7797        /// FileItems
 7798        /// </summary>
 7799        public System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.FileItem> FileItems { get; inter
 7800
 7801        /// <summary>
 7802        /// Creates a new FilesAndDirectoriesSegment instance
 7803        /// </summary>
 7804        public FilesAndDirectoriesSegment()
 7805            : this(false)
 7806        {
 7807        }
 7808
 7809        /// <summary>
 7810        /// Creates a new FilesAndDirectoriesSegment instance
 7811        /// </summary>
 7812        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 7813        internal FilesAndDirectoriesSegment(bool skipInitialization)
 7814        {
 7815            if (!skipInitialization)
 7816            {
 7817                DirectoryItems = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.DirectoryItem>();
 7818                FileItems = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.FileItem>();
 7819            }
 7820        }
 7821
 7822        /// <summary>
 7823        /// Deserializes XML into a new FilesAndDirectoriesSegment instance.
 7824        /// </summary>
 7825        /// <param name="element">The XML element to deserialize.</param>
 7826        /// <returns>A deserialized FilesAndDirectoriesSegment instance.</returns>
 7827        internal static Azure.Storage.Files.Shares.Models.FilesAndDirectoriesSegment FromXml(System.Xml.Linq.XElement el
 7828        {
 7829            System.Diagnostics.Debug.Assert(element != null);
 7830            System.Xml.Linq.XElement _child;
 7831            System.Xml.Linq.XAttribute _attribute;
 7832            Azure.Storage.Files.Shares.Models.FilesAndDirectoriesSegment _value = new Azure.Storage.Files.Shares.Models.
 7833            _attribute = element.Attribute(System.Xml.Linq.XName.Get("ServiceEndpoint", ""));
 7834            if (_attribute != null)
 7835            {
 7836                _value.ServiceEndpoint = _attribute.Value;
 7837            }
 7838            _attribute = element.Attribute(System.Xml.Linq.XName.Get("ShareName", ""));
 7839            if (_attribute != null)
 7840            {
 7841                _value.ShareName = _attribute.Value;
 7842            }
 7843            _attribute = element.Attribute(System.Xml.Linq.XName.Get("ShareSnapshot", ""));
 7844            if (_attribute != null)
 7845            {
 7846                _value.ShareSnapshot = _attribute.Value;
 7847            }
 7848            _attribute = element.Attribute(System.Xml.Linq.XName.Get("DirectoryPath", ""));
 7849            if (_attribute != null)
 7850            {
 7851                _value.DirectoryPath = _attribute.Value;
 7852            }
 7853            _child = element.Element(System.Xml.Linq.XName.Get("Prefix", ""));
 7854            if (_child != null)
 7855            {
 7856                _value.Prefix = _child.Value;
 7857            }
 7858            _child = element.Element(System.Xml.Linq.XName.Get("Marker", ""));
 7859            if (_child != null)
 7860            {
 7861                _value.Marker = _child.Value;
 7862            }
 7863            _child = element.Element(System.Xml.Linq.XName.Get("MaxResults", ""));
 7864            if (_child != null)
 7865            {
 7866                _value.MaxResults = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 7867            }
 7868            _child = element.Element(System.Xml.Linq.XName.Get("NextMarker", ""));
 7869            if (_child != null)
 7870            {
 7871                _value.NextMarker = _child.Value;
 7872            }
 7873            _child = element.Element(System.Xml.Linq.XName.Get("Entries", ""));
 7874            if (_child != null)
 7875            {
 7876                _value.DirectoryItems = System.Linq.Enumerable.ToList(
 7877                    System.Linq.Enumerable.Select(
 7878                        _child.Elements(System.Xml.Linq.XName.Get("Directory", "")),
 7879                        e => Azure.Storage.Files.Shares.Models.DirectoryItem.FromXml(e)));
 7880            }
 7881            else
 7882            {
 7883                _value.DirectoryItems = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.DirectoryI
 7884            }
 7885            _child = element.Element(System.Xml.Linq.XName.Get("Entries", ""));
 7886            if (_child != null)
 7887            {
 7888                _value.FileItems = System.Linq.Enumerable.ToList(
 7889                    System.Linq.Enumerable.Select(
 7890                        _child.Elements(System.Xml.Linq.XName.Get("File", "")),
 7891                        e => Azure.Storage.Files.Shares.Models.FileItem.FromXml(e)));
 7892            }
 7893            else
 7894            {
 7895                _value.FileItems = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.FileItem>();
 7896            }
 7897            CustomizeFromXml(element, _value);
 7898            return _value;
 7899        }
 7900
 7901        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.FilesAn
 7902    }
 7903}
 7904#endregion class FilesAndDirectoriesSegment
 7905
 7906#region class FlattenedStorageFileProperties
 7907namespace Azure.Storage.Files.Shares.Models
 7908{
 7909    /// <summary>
 7910    /// FlattenedStorageFileProperties
 7911    /// </summary>
 7912    internal partial class FlattenedStorageFileProperties
 7913    {
 7914        /// <summary>
 7915        /// Returns the date and time the file was last modified. Any operation that modifies the file or its properties
 7916        /// </summary>
 7917        public System.DateTimeOffset LastModified { get; internal set; }
 7918
 7919        /// <summary>
 7920        /// A set of name-value pairs associated with this file as user-defined metadata.
 7921        /// </summary>
 7922        public System.Collections.Generic.IDictionary<string, string> Metadata { get; internal set; }
 7923
 7924        /// <summary>
 7925        /// The number of bytes present in the response body.
 7926        /// </summary>
 7927        public long ContentLength { get; internal set; }
 7928
 7929        /// <summary>
 7930        /// The content type specified for the file. The default content type is 'application/octet-stream'
 7931        /// </summary>
 7932        public string ContentType { get; internal set; }
 7933
 7934        /// <summary>
 7935        /// Indicates the range of bytes returned if the client requested a subset of the file by setting the Range requ
 7936        /// </summary>
 7937        public string ContentRange { get; internal set; }
 7938
 7939        /// <summary>
 7940        /// The ETag contains a value that you can use to perform operations conditionally, in quotes.
 7941        /// </summary>
 7942        public Azure.ETag ETag { get; internal set; }
 7943
 7944        /// <summary>
 7945        /// If the file has an MD5 hash and the request is to read the full file, this response header is returned so th
 7946        /// </summary>
 7947        #pragma warning disable CA1819 // Properties should not return arrays
 7948        public byte[] ContentHash { get; internal set; }
 7949        #pragma warning restore CA1819 // Properties should not return arrays
 7950
 7951        /// <summary>
 7952        /// Returns the value that was specified for the Content-Encoding request header.
 7953        /// </summary>
 7954        public System.Collections.Generic.IEnumerable<string> ContentEncoding { get; internal set; }
 7955
 7956        /// <summary>
 7957        /// Returned if it was previously specified for the file.
 7958        /// </summary>
 7959        public string CacheControl { get; internal set; }
 7960
 7961        /// <summary>
 7962        /// Returns the value that was specified for the 'x-ms-content-disposition' header and specifies how to process 
 7963        /// </summary>
 7964        public string ContentDisposition { get; internal set; }
 7965
 7966        /// <summary>
 7967        /// Returns the value that was specified for the Content-Language request header.
 7968        /// </summary>
 7969        public System.Collections.Generic.IEnumerable<string> ContentLanguage { get; internal set; }
 7970
 7971        /// <summary>
 7972        /// Indicates that the service supports requests for partial file content.
 7973        /// </summary>
 7974        public string AcceptRanges { get; internal set; }
 7975
 7976        /// <summary>
 7977        /// Conclusion time of the last attempted Copy File operation where this file was the destination file. This val
 7978        /// </summary>
 7979        public System.DateTimeOffset CopyCompletionTime { get; internal set; }
 7980
 7981        /// <summary>
 7982        /// Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or non-fatal copy operatio
 7983        /// </summary>
 7984        public string CopyStatusDescription { get; internal set; }
 7985
 7986        /// <summary>
 7987        /// String identifier for the last attempted Copy File operation where this file was the destination file.
 7988        /// </summary>
 7989        public string CopyId { get; internal set; }
 7990
 7991        /// <summary>
 7992        /// Contains the number of bytes copied and the total bytes in the source in the last attempted Copy File operat
 7993        /// </summary>
 7994        public string CopyProgress { get; internal set; }
 7995
 7996        /// <summary>
 7997        /// URL up to 2KB in length that specifies the source file used in the last attempted Copy File operation where 
 7998        /// </summary>
 7999        public System.Uri CopySource { get; internal set; }
 8000
 8001        /// <summary>
 8002        /// State of the copy operation identified by 'x-ms-copy-id'.
 8003        /// </summary>
 8004        public Azure.Storage.Files.Shares.Models.CopyStatus CopyStatus { get; internal set; }
 8005
 8006        /// <summary>
 8007        /// If the file has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header
 8008        /// </summary>
 8009        #pragma warning disable CA1819 // Properties should not return arrays
 8010        public byte[] FileContentHash { get; internal set; }
 8011        #pragma warning restore CA1819 // Properties should not return arrays
 8012
 8013        /// <summary>
 8014        /// The value of this header is set to true if the file data and application metadata are completely encrypted u
 8015        /// </summary>
 8016        public bool IsServerEncrypted { get; internal set; }
 8017
 8018        /// <summary>
 8019        /// Attributes set for the file.
 8020        /// </summary>
 8021        public string FileAttributes { get; internal set; }
 8022
 8023        /// <summary>
 8024        /// Creation time for the file.
 8025        /// </summary>
 8026        public System.DateTimeOffset FileCreationTime { get; internal set; }
 8027
 8028        /// <summary>
 8029        /// Last write time for the file.
 8030        /// </summary>
 8031        public System.DateTimeOffset FileLastWriteTime { get; internal set; }
 8032
 8033        /// <summary>
 8034        /// Change time for the file.
 8035        /// </summary>
 8036        public System.DateTimeOffset FileChangeTime { get; internal set; }
 8037
 8038        /// <summary>
 8039        /// Key of the permission set for the file.
 8040        /// </summary>
 8041        public string FilePermissionKey { get; internal set; }
 8042
 8043        /// <summary>
 8044        /// The fileId of the file.
 8045        /// </summary>
 8046        public string FileId { get; internal set; }
 8047
 8048        /// <summary>
 8049        /// The parent fileId of the file.
 8050        /// </summary>
 8051        public string FileParentId { get; internal set; }
 8052
 8053        /// <summary>
 8054        /// When a file is leased, specifies whether the lease is of infinite or fixed duration.
 8055        /// </summary>
 8056        public Azure.Storage.Files.Shares.Models.ShareLeaseDuration LeaseDuration { get; internal set; }
 8057
 8058        /// <summary>
 8059        /// Lease state of the file.
 8060        /// </summary>
 8061        public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get; internal set; }
 8062
 8063        /// <summary>
 8064        /// The current lease status of the file.
 8065        /// </summary>
 8066        public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get; internal set; }
 8067
 8068        /// <summary>
 8069        /// Content
 8070        /// </summary>
 8071        public System.IO.Stream Content { get; internal set; }
 8072
 8073        /// <summary>
 8074        /// Creates a new FlattenedStorageFileProperties instance
 8075        /// </summary>
 8076        public FlattenedStorageFileProperties()
 8077        {
 8078            Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgnoreCase
 8079            ContentEncoding = new System.Collections.Generic.List<string>();
 8080            ContentLanguage = new System.Collections.Generic.List<string>();
 8081        }
 8082    }
 8083}
 8084#endregion class FlattenedStorageFileProperties
 8085
 8086#region enum ListSharesIncludeType
 8087namespace Azure.Storage.Files.Shares.Models
 8088{
 8089    /// <summary>
 8090    /// ListSharesIncludeType values
 8091    /// </summary>
 8092    internal enum ListSharesIncludeType
 8093    {
 8094        /// <summary>
 8095        /// snapshots
 8096        /// </summary>
 8097        Snapshots,
 8098
 8099        /// <summary>
 8100        /// metadata
 8101        /// </summary>
 8102        Metadata,
 8103
 8104        /// <summary>
 8105        /// deleted
 8106        /// </summary>
 8107        Deleted
 8108    }
 8109}
 8110
 8111namespace Azure.Storage.Files.Shares
 8112{
 8113    internal static partial class FileRestClient
 8114    {
 8115        public static partial class Serialization
 8116        {
 8117            public static string ToString(Azure.Storage.Files.Shares.Models.ListSharesIncludeType value)
 8118            {
 68119                return value switch
 68120                {
 08121                    Azure.Storage.Files.Shares.Models.ListSharesIncludeType.Snapshots => "snapshots",
 88122                    Azure.Storage.Files.Shares.Models.ListSharesIncludeType.Metadata => "metadata",
 108123                    Azure.Storage.Files.Shares.Models.ListSharesIncludeType.Deleted => "deleted",
 08124                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 68125                };
 8126            }
 8127
 8128            public static Azure.Storage.Files.Shares.Models.ListSharesIncludeType ParseListSharesIncludeType(string valu
 8129            {
 08130                return value switch
 08131                {
 08132                    "snapshots" => Azure.Storage.Files.Shares.Models.ListSharesIncludeType.Snapshots,
 08133                    "metadata" => Azure.Storage.Files.Shares.Models.ListSharesIncludeType.Metadata,
 08134                    "deleted" => Azure.Storage.Files.Shares.Models.ListSharesIncludeType.Deleted,
 08135                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 08136                };
 8137            }
 8138        }
 8139    }
 8140}
 8141#endregion enum ListSharesIncludeType
 8142
 8143#region enum PermissionCopyMode
 8144namespace Azure.Storage.Files.Shares.Models
 8145{
 8146    /// <summary>
 8147    /// Specifies the option to copy file security descriptor from source file or to set it using the value which is def
 8148    /// </summary>
 8149    public enum PermissionCopyMode
 8150    {
 8151        /// <summary>
 8152        /// source
 8153        /// </summary>
 8154        Source,
 8155
 8156        /// <summary>
 8157        /// override
 8158        /// </summary>
 8159        Override
 8160    }
 8161}
 8162
 8163namespace Azure.Storage.Files.Shares
 8164{
 8165    internal static partial class FileRestClient
 8166    {
 8167        public static partial class Serialization
 8168        {
 8169            public static string ToString(Azure.Storage.Files.Shares.Models.PermissionCopyMode value)
 8170            {
 48171                return value switch
 48172                {
 08173                    Azure.Storage.Files.Shares.Models.PermissionCopyMode.Source => "source",
 88174                    Azure.Storage.Files.Shares.Models.PermissionCopyMode.Override => "override",
 08175                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 48176                };
 8177            }
 8178
 8179            public static Azure.Storage.Files.Shares.Models.PermissionCopyMode ParsePermissionCopyMode(string value)
 8180            {
 08181                return value switch
 08182                {
 08183                    "source" => Azure.Storage.Files.Shares.Models.PermissionCopyMode.Source,
 08184                    "override" => Azure.Storage.Files.Shares.Models.PermissionCopyMode.Override,
 08185                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 08186                };
 8187            }
 8188        }
 8189    }
 8190}
 8191#endregion enum PermissionCopyMode
 8192
 8193#region class PermissionInfo
 8194namespace Azure.Storage.Files.Shares.Models
 8195{
 8196    /// <summary>
 8197    /// PermissionInfo
 8198    /// </summary>
 8199    public partial class PermissionInfo
 8200    {
 8201        /// <summary>
 8202        /// Key of the permission set for the directory/file.
 8203        /// </summary>
 8204        public string FilePermissionKey { get; internal set; }
 8205
 8206        /// <summary>
 8207        /// Prevent direct instantiation of PermissionInfo instances.
 8208        /// You can use ShareModelFactory.PermissionInfo instead.
 8209        /// </summary>
 8210        internal PermissionInfo() { }
 8211    }
 8212
 8213    /// <summary>
 8214    /// ShareModelFactory provides utilities for mocking.
 8215    /// </summary>
 8216    public static partial class ShareModelFactory
 8217    {
 8218        /// <summary>
 8219        /// Creates a new PermissionInfo instance for mocking.
 8220        /// </summary>
 8221        public static PermissionInfo PermissionInfo(
 8222            string filePermissionKey)
 8223        {
 8224            return new PermissionInfo()
 8225            {
 8226                FilePermissionKey = filePermissionKey,
 8227            };
 8228        }
 8229    }
 8230}
 8231#endregion class PermissionInfo
 8232
 8233#region class Range
 8234namespace Azure.Storage.Files.Shares.Models
 8235{
 8236    /// <summary>
 8237    /// An Azure Storage file range.
 8238    /// </summary>
 8239    internal partial class Range
 8240    {
 8241        /// <summary>
 8242        /// Start of the range.
 8243        /// </summary>
 8244        public long Start { get; internal set; }
 8245
 8246        /// <summary>
 8247        /// End of the range.
 8248        /// </summary>
 8249        public long End { get; internal set; }
 8250
 8251        /// <summary>
 8252        /// Prevent direct instantiation of Range instances.
 8253        /// You can use ShareModelFactory.Range instead.
 8254        /// </summary>
 8255        internal Range() { }
 8256
 8257        /// <summary>
 8258        /// Deserializes XML into a new Range instance.
 8259        /// </summary>
 8260        /// <param name="element">The XML element to deserialize.</param>
 8261        /// <returns>A deserialized Range instance.</returns>
 8262        internal static Azure.Storage.Files.Shares.Models.Range FromXml(System.Xml.Linq.XElement element)
 8263        {
 8264            System.Diagnostics.Debug.Assert(element != null);
 8265            System.Xml.Linq.XElement _child;
 8266            Azure.Storage.Files.Shares.Models.Range _value = new Azure.Storage.Files.Shares.Models.Range();
 8267            _child = element.Element(System.Xml.Linq.XName.Get("Start", ""));
 8268            if (_child != null)
 8269            {
 8270                _value.Start = long.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 8271            }
 8272            _child = element.Element(System.Xml.Linq.XName.Get("End", ""));
 8273            if (_child != null)
 8274            {
 8275                _value.End = long.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 8276            }
 8277            CustomizeFromXml(element, _value);
 8278            return _value;
 8279        }
 8280
 8281        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.Range v
 8282    }
 8283}
 8284#endregion class Range
 8285
 8286#region class RawStorageDirectoryInfo
 8287namespace Azure.Storage.Files.Shares.Models
 8288{
 8289    /// <summary>
 8290    /// RawStorageDirectoryInfo
 8291    /// </summary>
 8292    internal partial class RawStorageDirectoryInfo
 8293    {
 8294        /// <summary>
 8295        /// The ETag contains a value which represents the version of the directory, in quotes.
 8296        /// </summary>
 8297        public Azure.ETag ETag { get; internal set; }
 8298
 8299        /// <summary>
 8300        /// Returns the date and time the share was last modified. Any operation that modifies the directory or its prop
 8301        /// </summary>
 8302        public System.DateTimeOffset LastModified { get; internal set; }
 8303
 8304        /// <summary>
 8305        /// Key of the permission set for the directory.
 8306        /// </summary>
 8307        public string FilePermissionKey { get; internal set; }
 8308
 8309        /// <summary>
 8310        /// Attributes set for the directory.
 8311        /// </summary>
 8312        public string FileAttributes { get; internal set; }
 8313
 8314        /// <summary>
 8315        /// Creation time for the directory.
 8316        /// </summary>
 8317        public System.DateTimeOffset FileCreationTime { get; internal set; }
 8318
 8319        /// <summary>
 8320        /// Last write time for the directory.
 8321        /// </summary>
 8322        public System.DateTimeOffset FileLastWriteTime { get; internal set; }
 8323
 8324        /// <summary>
 8325        /// Change time for the directory.
 8326        /// </summary>
 8327        public System.DateTimeOffset FileChangeTime { get; internal set; }
 8328
 8329        /// <summary>
 8330        /// The fileId of the directory.
 8331        /// </summary>
 8332        public string FileId { get; internal set; }
 8333
 8334        /// <summary>
 8335        /// The parent fileId of the directory.
 8336        /// </summary>
 8337        public string FileParentId { get; internal set; }
 8338
 8339        /// <summary>
 8340        /// Prevent direct instantiation of RawStorageDirectoryInfo instances.
 8341        /// You can use ShareModelFactory.RawStorageDirectoryInfo instead.
 8342        /// </summary>
 8343        internal RawStorageDirectoryInfo() { }
 8344    }
 8345}
 8346#endregion class RawStorageDirectoryInfo
 8347
 8348#region class RawStorageDirectoryProperties
 8349namespace Azure.Storage.Files.Shares.Models
 8350{
 8351    /// <summary>
 8352    /// RawStorageDirectoryProperties
 8353    /// </summary>
 8354    internal partial class RawStorageDirectoryProperties
 8355    {
 8356        /// <summary>
 8357        /// A set of name-value pairs that contain metadata for the directory.
 8358        /// </summary>
 8359        public System.Collections.Generic.IDictionary<string, string> Metadata { get; internal set; }
 8360
 8361        /// <summary>
 8362        /// The ETag contains a value that you can use to perform operations conditionally, in quotes.
 8363        /// </summary>
 8364        public Azure.ETag ETag { get; internal set; }
 8365
 8366        /// <summary>
 8367        /// Returns the date and time the Directory was last modified. Operations on files within the directory do not a
 8368        /// </summary>
 8369        public System.DateTimeOffset LastModified { get; internal set; }
 8370
 8371        /// <summary>
 8372        /// The value of this header is set to true if the directory metadata is completely encrypted using the specifie
 8373        /// </summary>
 8374        public bool IsServerEncrypted { get; internal set; }
 8375
 8376        /// <summary>
 8377        /// Attributes set for the directory.
 8378        /// </summary>
 8379        public string FileAttributes { get; internal set; }
 8380
 8381        /// <summary>
 8382        /// Creation time for the directory.
 8383        /// </summary>
 8384        public System.DateTimeOffset FileCreationTime { get; internal set; }
 8385
 8386        /// <summary>
 8387        /// Last write time for the directory.
 8388        /// </summary>
 8389        public System.DateTimeOffset FileLastWriteTime { get; internal set; }
 8390
 8391        /// <summary>
 8392        /// Change time for the directory.
 8393        /// </summary>
 8394        public System.DateTimeOffset FileChangeTime { get; internal set; }
 8395
 8396        /// <summary>
 8397        /// Key of the permission set for the directory.
 8398        /// </summary>
 8399        public string FilePermissionKey { get; internal set; }
 8400
 8401        /// <summary>
 8402        /// The fileId of the directory.
 8403        /// </summary>
 8404        public string FileId { get; internal set; }
 8405
 8406        /// <summary>
 8407        /// The parent fileId of the directory.
 8408        /// </summary>
 8409        public string FileParentId { get; internal set; }
 8410
 8411        /// <summary>
 8412        /// Creates a new RawStorageDirectoryProperties instance
 8413        /// </summary>
 8414        public RawStorageDirectoryProperties()
 8415        {
 8416            Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgnoreCase
 8417        }
 8418    }
 8419}
 8420#endregion class RawStorageDirectoryProperties
 8421
 8422#region class RawStorageFileInfo
 8423namespace Azure.Storage.Files.Shares.Models
 8424{
 8425    /// <summary>
 8426    /// RawStorageFileInfo
 8427    /// </summary>
 8428    internal partial class RawStorageFileInfo
 8429    {
 8430        /// <summary>
 8431        /// The ETag contains a value which represents the version of the file, in quotes.
 8432        /// </summary>
 8433        public Azure.ETag ETag { get; internal set; }
 8434
 8435        /// <summary>
 8436        /// Returns the date and time the share was last modified. Any operation that modifies the directory or its prop
 8437        /// </summary>
 8438        public System.DateTimeOffset LastModified { get; internal set; }
 8439
 8440        /// <summary>
 8441        /// The value of this header is set to true if the contents of the request are successfully encrypted using the 
 8442        /// </summary>
 8443        public bool IsServerEncrypted { get; internal set; }
 8444
 8445        /// <summary>
 8446        /// Key of the permission set for the file.
 8447        /// </summary>
 8448        public string FilePermissionKey { get; internal set; }
 8449
 8450        /// <summary>
 8451        /// Attributes set for the file.
 8452        /// </summary>
 8453        public string FileAttributes { get; internal set; }
 8454
 8455        /// <summary>
 8456        /// Creation time for the file.
 8457        /// </summary>
 8458        public System.DateTimeOffset FileCreationTime { get; internal set; }
 8459
 8460        /// <summary>
 8461        /// Last write time for the file.
 8462        /// </summary>
 8463        public System.DateTimeOffset FileLastWriteTime { get; internal set; }
 8464
 8465        /// <summary>
 8466        /// Change time for the file.
 8467        /// </summary>
 8468        public System.DateTimeOffset FileChangeTime { get; internal set; }
 8469
 8470        /// <summary>
 8471        /// The fileId of the file.
 8472        /// </summary>
 8473        public string FileId { get; internal set; }
 8474
 8475        /// <summary>
 8476        /// The parent fileId of the file.
 8477        /// </summary>
 8478        public string FileParentId { get; internal set; }
 8479
 8480        /// <summary>
 8481        /// Prevent direct instantiation of RawStorageFileInfo instances.
 8482        /// You can use ShareModelFactory.RawStorageFileInfo instead.
 8483        /// </summary>
 8484        internal RawStorageFileInfo() { }
 8485    }
 8486}
 8487#endregion class RawStorageFileInfo
 8488
 8489#region class RawStorageFileProperties
 8490namespace Azure.Storage.Files.Shares.Models
 8491{
 8492    /// <summary>
 8493    /// RawStorageFileProperties
 8494    /// </summary>
 8495    internal partial class RawStorageFileProperties
 8496    {
 8497        /// <summary>
 8498        /// Returns the date and time the file was last modified. The date format follows RFC 1123. Any operation that m
 8499        /// </summary>
 8500        public System.DateTimeOffset LastModified { get; internal set; }
 8501
 8502        /// <summary>
 8503        /// A set of name-value pairs associated with this file as user-defined metadata.
 8504        /// </summary>
 8505        public System.Collections.Generic.IDictionary<string, string> Metadata { get; internal set; }
 8506
 8507        /// <summary>
 8508        /// The size of the file in bytes. This header returns the value of the 'x-ms-content-length' header that is sto
 8509        /// </summary>
 8510        public long ContentLength { get; internal set; }
 8511
 8512        /// <summary>
 8513        /// The content type specified for the file. The default content type is 'application/octet-stream'
 8514        /// </summary>
 8515        public string ContentType { get; internal set; }
 8516
 8517        /// <summary>
 8518        /// The ETag contains a value that you can use to perform operations conditionally, in quotes.
 8519        /// </summary>
 8520        public Azure.ETag ETag { get; internal set; }
 8521
 8522        /// <summary>
 8523        /// If the Content-MD5 header has been set for the file, the Content-MD5 response header is returned so that the
 8524        /// </summary>
 8525        #pragma warning disable CA1819 // Properties should not return arrays
 8526        public byte[] ContentHash { get; internal set; }
 8527        #pragma warning restore CA1819 // Properties should not return arrays
 8528
 8529        /// <summary>
 8530        /// If the Content-Encoding request header has previously been set for the file, the Content-Encoding value is r
 8531        /// </summary>
 8532        public System.Collections.Generic.IEnumerable<string> ContentEncoding { get; internal set; }
 8533
 8534        /// <summary>
 8535        /// If the Cache-Control request header has previously been set for the file, the Cache-Control value is returne
 8536        /// </summary>
 8537        public string CacheControl { get; internal set; }
 8538
 8539        /// <summary>
 8540        /// Returns the value that was specified for the 'x-ms-content-disposition' header and specifies how to process 
 8541        /// </summary>
 8542        public string ContentDisposition { get; internal set; }
 8543
 8544        /// <summary>
 8545        /// Returns the value that was specified for the Content-Language request header.
 8546        /// </summary>
 8547        public System.Collections.Generic.IEnumerable<string> ContentLanguage { get; internal set; }
 8548
 8549        /// <summary>
 8550        /// Conclusion time of the last attempted Copy File operation where this file was the destination file. This val
 8551        /// </summary>
 8552        public System.DateTimeOffset CopyCompletionTime { get; internal set; }
 8553
 8554        /// <summary>
 8555        /// Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or non-fatal copy operatio
 8556        /// </summary>
 8557        public string CopyStatusDescription { get; internal set; }
 8558
 8559        /// <summary>
 8560        /// String identifier for the last attempted Copy File operation where this file was the destination file.
 8561        /// </summary>
 8562        public string CopyId { get; internal set; }
 8563
 8564        /// <summary>
 8565        /// Contains the number of bytes copied and the total bytes in the source in the last attempted Copy File operat
 8566        /// </summary>
 8567        public string CopyProgress { get; internal set; }
 8568
 8569        /// <summary>
 8570        /// URL up to 2KB in length that specifies the source file used in the last attempted Copy File operation where 
 8571        /// </summary>
 8572        public string CopySource { get; internal set; }
 8573
 8574        /// <summary>
 8575        /// State of the copy operation identified by 'x-ms-copy-id'.
 8576        /// </summary>
 8577        public Azure.Storage.Files.Shares.Models.CopyStatus CopyStatus { get; internal set; }
 8578
 8579        /// <summary>
 8580        /// The value of this header is set to true if the file data and application metadata are completely encrypted u
 8581        /// </summary>
 8582        public bool IsServerEncrypted { get; internal set; }
 8583
 8584        /// <summary>
 8585        /// Attributes set for the file.
 8586        /// </summary>
 8587        public string FileAttributes { get; internal set; }
 8588
 8589        /// <summary>
 8590        /// Creation time for the file.
 8591        /// </summary>
 8592        public System.DateTimeOffset FileCreationTime { get; internal set; }
 8593
 8594        /// <summary>
 8595        /// Last write time for the file.
 8596        /// </summary>
 8597        public System.DateTimeOffset FileLastWriteTime { get; internal set; }
 8598
 8599        /// <summary>
 8600        /// Change time for the file.
 8601        /// </summary>
 8602        public System.DateTimeOffset FileChangeTime { get; internal set; }
 8603
 8604        /// <summary>
 8605        /// Key of the permission set for the file.
 8606        /// </summary>
 8607        public string FilePermissionKey { get; internal set; }
 8608
 8609        /// <summary>
 8610        /// The fileId of the file.
 8611        /// </summary>
 8612        public string FileId { get; internal set; }
 8613
 8614        /// <summary>
 8615        /// The parent fileId of the file.
 8616        /// </summary>
 8617        public string FileParentId { get; internal set; }
 8618
 8619        /// <summary>
 8620        /// When a file is leased, specifies whether the lease is of infinite or fixed duration.
 8621        /// </summary>
 8622        public Azure.Storage.Files.Shares.Models.ShareLeaseDuration LeaseDuration { get; internal set; }
 8623
 8624        /// <summary>
 8625        /// Lease state of the file.
 8626        /// </summary>
 8627        public Azure.Storage.Files.Shares.Models.ShareLeaseState LeaseState { get; internal set; }
 8628
 8629        /// <summary>
 8630        /// The current lease status of the file.
 8631        /// </summary>
 8632        public Azure.Storage.Files.Shares.Models.ShareLeaseStatus LeaseStatus { get; internal set; }
 8633
 8634        /// <summary>
 8635        /// Creates a new RawStorageFileProperties instance
 8636        /// </summary>
 8637        public RawStorageFileProperties()
 8638        {
 8639            Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgnoreCase
 8640            ContentEncoding = new System.Collections.Generic.List<string>();
 8641            ContentLanguage = new System.Collections.Generic.List<string>();
 8642        }
 8643    }
 8644}
 8645#endregion class RawStorageFileProperties
 8646
 8647#region class ShareAccessPolicy
 8648namespace Azure.Storage.Files.Shares.Models
 8649{
 8650    /// <summary>
 8651    /// An Access policy.
 8652    /// </summary>
 8653    public partial class ShareAccessPolicy
 8654    {
 8655        /// <summary>
 8656        /// The date-time the policy is active.
 8657        /// </summary>
 8658        public System.DateTimeOffset? PolicyStartsOn { get; set; }
 8659
 8660        /// <summary>
 8661        /// The date-time the policy expires.
 8662        /// </summary>
 8663        public System.DateTimeOffset? PolicyExpiresOn { get; set; }
 8664
 8665        /// <summary>
 8666        /// The permissions for the ACL policy.
 8667        /// </summary>
 8668        public string Permissions { get; set; }
 8669
 8670        /// <summary>
 8671        /// Creates a new ShareAccessPolicy instance
 8672        /// </summary>
 8673        public ShareAccessPolicy() { }
 8674
 8675        /// <summary>
 8676        /// Serialize a ShareAccessPolicy instance as XML.
 8677        /// </summary>
 8678        /// <param name="value">The ShareAccessPolicy instance to serialize.</param>
 8679        /// <param name="name">An optional name to use for the root element instead of "AccessPolicy".</param>
 8680        /// <param name="ns">An optional namespace to use for the root element instead of "".</param>
 8681        /// <returns>The serialized XML element.</returns>
 8682        internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Files.Shares.Models.ShareAccessPolicy value, string
 8683        {
 8684            System.Diagnostics.Debug.Assert(value != null);
 8685            System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns));
 8686            if (value.PolicyStartsOn != null)
 8687            {
 8688                _element.Add(new System.Xml.Linq.XElement(
 8689                    System.Xml.Linq.XName.Get("Start", ""),
 8690                    value.PolicyStartsOn.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffZ", System.Globalization.C
 8691            }
 8692            if (value.PolicyExpiresOn != null)
 8693            {
 8694                _element.Add(new System.Xml.Linq.XElement(
 8695                    System.Xml.Linq.XName.Get("Expiry", ""),
 8696                    value.PolicyExpiresOn.Value.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffZ", System.Globalization.
 8697            }
 8698            if (value.Permissions != null)
 8699            {
 8700                _element.Add(new System.Xml.Linq.XElement(
 8701                    System.Xml.Linq.XName.Get("Permission", ""),
 8702                    value.Permissions));
 8703            }
 8704            return _element;
 8705        }
 8706
 8707        /// <summary>
 8708        /// Deserializes XML into a new ShareAccessPolicy instance.
 8709        /// </summary>
 8710        /// <param name="element">The XML element to deserialize.</param>
 8711        /// <returns>A deserialized ShareAccessPolicy instance.</returns>
 8712        internal static Azure.Storage.Files.Shares.Models.ShareAccessPolicy FromXml(System.Xml.Linq.XElement element)
 8713        {
 8714            System.Diagnostics.Debug.Assert(element != null);
 8715            System.Xml.Linq.XElement _child;
 8716            Azure.Storage.Files.Shares.Models.ShareAccessPolicy _value = new Azure.Storage.Files.Shares.Models.ShareAcce
 8717            _child = element.Element(System.Xml.Linq.XName.Get("Start", ""));
 8718            if (_child != null)
 8719            {
 8720                _value.PolicyStartsOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invar
 8721            }
 8722            _child = element.Element(System.Xml.Linq.XName.Get("Expiry", ""));
 8723            if (_child != null)
 8724            {
 8725                _value.PolicyExpiresOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Inva
 8726            }
 8727            _child = element.Element(System.Xml.Linq.XName.Get("Permission", ""));
 8728            if (_child != null)
 8729            {
 8730                _value.Permissions = _child.Value;
 8731            }
 8732            CustomizeFromXml(element, _value);
 8733            return _value;
 8734        }
 8735
 8736        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareAc
 8737    }
 8738}
 8739#endregion class ShareAccessPolicy
 8740
 8741#region class ShareCorsRule
 8742namespace Azure.Storage.Files.Shares.Models
 8743{
 8744    /// <summary>
 8745    /// CORS is an HTTP feature that enables a web application running under one domain to access resources in another d
 8746    /// </summary>
 8747    public partial class ShareCorsRule
 8748    {
 8749        /// <summary>
 8750        /// The origin domains that are permitted to make a request against the storage service via CORS. The origin dom
 8751        /// </summary>
 8752        public string AllowedOrigins { get; set; }
 8753
 8754        /// <summary>
 8755        /// The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)
 8756        /// </summary>
 8757        public string AllowedMethods { get; set; }
 8758
 8759        /// <summary>
 8760        /// The request headers that the origin domain may specify on the CORS request.
 8761        /// </summary>
 8762        public string AllowedHeaders { get; set; }
 8763
 8764        /// <summary>
 8765        /// The response headers that may be sent in the response to the CORS request and exposed by the browser to the 
 8766        /// </summary>
 8767        public string ExposedHeaders { get; set; }
 8768
 8769        /// <summary>
 8770        /// The maximum amount time that a browser should cache the preflight OPTIONS request.
 8771        /// </summary>
 8772        public int MaxAgeInSeconds { get; set; }
 8773
 8774        /// <summary>
 8775        /// Creates a new ShareCorsRule instance
 8776        /// </summary>
 8777        public ShareCorsRule() { }
 8778
 8779        /// <summary>
 8780        /// Serialize a ShareCorsRule instance as XML.
 8781        /// </summary>
 8782        /// <param name="value">The ShareCorsRule instance to serialize.</param>
 8783        /// <param name="name">An optional name to use for the root element instead of "CorsRule".</param>
 8784        /// <param name="ns">An optional namespace to use for the root element instead of "".</param>
 8785        /// <returns>The serialized XML element.</returns>
 8786        internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Files.Shares.Models.ShareCorsRule value, string nam
 8787        {
 8788            System.Diagnostics.Debug.Assert(value != null);
 8789            System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns));
 8790            _element.Add(new System.Xml.Linq.XElement(
 8791                System.Xml.Linq.XName.Get("AllowedOrigins", ""),
 8792                value.AllowedOrigins));
 8793            _element.Add(new System.Xml.Linq.XElement(
 8794                System.Xml.Linq.XName.Get("AllowedMethods", ""),
 8795                value.AllowedMethods));
 8796            _element.Add(new System.Xml.Linq.XElement(
 8797                System.Xml.Linq.XName.Get("AllowedHeaders", ""),
 8798                value.AllowedHeaders));
 8799            _element.Add(new System.Xml.Linq.XElement(
 8800                System.Xml.Linq.XName.Get("ExposedHeaders", ""),
 8801                value.ExposedHeaders));
 8802            _element.Add(new System.Xml.Linq.XElement(
 8803                System.Xml.Linq.XName.Get("MaxAgeInSeconds", ""),
 8804                value.MaxAgeInSeconds.ToString(System.Globalization.CultureInfo.InvariantCulture)));
 8805            return _element;
 8806        }
 8807
 8808        /// <summary>
 8809        /// Deserializes XML into a new ShareCorsRule instance.
 8810        /// </summary>
 8811        /// <param name="element">The XML element to deserialize.</param>
 8812        /// <returns>A deserialized ShareCorsRule instance.</returns>
 8813        internal static Azure.Storage.Files.Shares.Models.ShareCorsRule FromXml(System.Xml.Linq.XElement element)
 8814        {
 8815            System.Diagnostics.Debug.Assert(element != null);
 8816            System.Xml.Linq.XElement _child;
 8817            Azure.Storage.Files.Shares.Models.ShareCorsRule _value = new Azure.Storage.Files.Shares.Models.ShareCorsRule
 8818            _child = element.Element(System.Xml.Linq.XName.Get("AllowedOrigins", ""));
 8819            if (_child != null)
 8820            {
 8821                _value.AllowedOrigins = _child.Value;
 8822            }
 8823            _child = element.Element(System.Xml.Linq.XName.Get("AllowedMethods", ""));
 8824            if (_child != null)
 8825            {
 8826                _value.AllowedMethods = _child.Value;
 8827            }
 8828            _child = element.Element(System.Xml.Linq.XName.Get("AllowedHeaders", ""));
 8829            if (_child != null)
 8830            {
 8831                _value.AllowedHeaders = _child.Value;
 8832            }
 8833            _child = element.Element(System.Xml.Linq.XName.Get("ExposedHeaders", ""));
 8834            if (_child != null)
 8835            {
 8836                _value.ExposedHeaders = _child.Value;
 8837            }
 8838            _child = element.Element(System.Xml.Linq.XName.Get("MaxAgeInSeconds", ""));
 8839            if (_child != null)
 8840            {
 8841                _value.MaxAgeInSeconds = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 8842            }
 8843            CustomizeFromXml(element, _value);
 8844            return _value;
 8845        }
 8846
 8847        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareCo
 8848    }
 8849}
 8850#endregion class ShareCorsRule
 8851
 8852#region enum strings ShareErrorCode
 8853namespace Azure.Storage.Files.Shares.Models
 8854{
 8855    /// <summary>
 8856    /// Error codes returned by the service
 8857    /// </summary>
 8858    public readonly struct ShareErrorCode : System.IEquatable<ShareErrorCode>
 8859    {
 8860        /// <summary>
 8861        /// The ShareErrorCode value.
 8862        /// </summary>
 8863        private readonly string _value;
 8864
 8865        /// <summary>
 8866        /// Initializes a new instance of the <see cref="ShareErrorCode"/> structure.
 8867        /// </summary>
 8868        /// <param name="value">The string value of the instance.</param>
 8869        public ShareErrorCode(string value) { _value = value ?? throw new System.ArgumentNullException(nameof(value)); }
 8870
 8871        /// <summary>
 8872        /// AccountAlreadyExists
 8873        /// </summary>
 8874        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AccountAlreadyExists { get; } = new ShareErrorCod
 8875
 8876        /// <summary>
 8877        /// AccountBeingCreated
 8878        /// </summary>
 8879        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AccountBeingCreated { get; } = new ShareErrorCode
 8880
 8881        /// <summary>
 8882        /// AccountIsDisabled
 8883        /// </summary>
 8884        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AccountIsDisabled { get; } = new ShareErrorCode(@
 8885
 8886        /// <summary>
 8887        /// AuthenticationFailed
 8888        /// </summary>
 8889        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AuthenticationFailed { get; } = new ShareErrorCod
 8890
 8891        /// <summary>
 8892        /// AuthorizationFailure
 8893        /// </summary>
 8894        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AuthorizationFailure { get; } = new ShareErrorCod
 8895
 8896        /// <summary>
 8897        /// ConditionHeadersNotSupported
 8898        /// </summary>
 8899        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ConditionHeadersNotSupported { get; } = new Share
 8900
 8901        /// <summary>
 8902        /// ConditionNotMet
 8903        /// </summary>
 8904        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ConditionNotMet { get; } = new ShareErrorCode(@"C
 8905
 8906        /// <summary>
 8907        /// EmptyMetadataKey
 8908        /// </summary>
 8909        public static Azure.Storage.Files.Shares.Models.ShareErrorCode EmptyMetadataKey { get; } = new ShareErrorCode(@"
 8910
 8911        /// <summary>
 8912        /// InsufficientAccountPermissions
 8913        /// </summary>
 8914        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InsufficientAccountPermissions { get; } = new Sha
 8915
 8916        /// <summary>
 8917        /// InternalError
 8918        /// </summary>
 8919        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InternalError { get; } = new ShareErrorCode(@"Int
 8920
 8921        /// <summary>
 8922        /// InvalidAuthenticationInfo
 8923        /// </summary>
 8924        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidAuthenticationInfo { get; } = new ShareErr
 8925
 8926        /// <summary>
 8927        /// InvalidHeaderValue
 8928        /// </summary>
 8929        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidHeaderValue { get; } = new ShareErrorCode(
 8930
 8931        /// <summary>
 8932        /// InvalidHttpVerb
 8933        /// </summary>
 8934        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidHttpVerb { get; } = new ShareErrorCode(@"I
 8935
 8936        /// <summary>
 8937        /// InvalidInput
 8938        /// </summary>
 8939        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidInput { get; } = new ShareErrorCode(@"Inva
 8940
 8941        /// <summary>
 8942        /// InvalidMd5
 8943        /// </summary>
 8944        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidMd5 { get; } = new ShareErrorCode(@"Invali
 8945
 8946        /// <summary>
 8947        /// InvalidMetadata
 8948        /// </summary>
 8949        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidMetadata { get; } = new ShareErrorCode(@"I
 8950
 8951        /// <summary>
 8952        /// InvalidQueryParameterValue
 8953        /// </summary>
 8954        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidQueryParameterValue { get; } = new ShareEr
 8955
 8956        /// <summary>
 8957        /// InvalidRange
 8958        /// </summary>
 8959        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidRange { get; } = new ShareErrorCode(@"Inva
 8960
 8961        /// <summary>
 8962        /// InvalidResourceName
 8963        /// </summary>
 8964        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidResourceName { get; } = new ShareErrorCode
 8965
 8966        /// <summary>
 8967        /// InvalidUri
 8968        /// </summary>
 8969        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidUri { get; } = new ShareErrorCode(@"Invali
 8970
 8971        /// <summary>
 8972        /// InvalidXmlDocument
 8973        /// </summary>
 8974        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidXmlDocument { get; } = new ShareErrorCode(
 8975
 8976        /// <summary>
 8977        /// InvalidXmlNodeValue
 8978        /// </summary>
 8979        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidXmlNodeValue { get; } = new ShareErrorCode
 8980
 8981        /// <summary>
 8982        /// Md5Mismatch
 8983        /// </summary>
 8984        public static Azure.Storage.Files.Shares.Models.ShareErrorCode Md5Mismatch { get; } = new ShareErrorCode(@"Md5Mi
 8985
 8986        /// <summary>
 8987        /// MetadataTooLarge
 8988        /// </summary>
 8989        public static Azure.Storage.Files.Shares.Models.ShareErrorCode MetadataTooLarge { get; } = new ShareErrorCode(@"
 8990
 8991        /// <summary>
 8992        /// MissingContentLengthHeader
 8993        /// </summary>
 8994        public static Azure.Storage.Files.Shares.Models.ShareErrorCode MissingContentLengthHeader { get; } = new ShareEr
 8995
 8996        /// <summary>
 8997        /// MissingRequiredQueryParameter
 8998        /// </summary>
 8999        public static Azure.Storage.Files.Shares.Models.ShareErrorCode MissingRequiredQueryParameter { get; } = new Shar
 9000
 9001        /// <summary>
 9002        /// MissingRequiredHeader
 9003        /// </summary>
 9004        public static Azure.Storage.Files.Shares.Models.ShareErrorCode MissingRequiredHeader { get; } = new ShareErrorCo
 9005
 9006        /// <summary>
 9007        /// MissingRequiredXmlNode
 9008        /// </summary>
 9009        public static Azure.Storage.Files.Shares.Models.ShareErrorCode MissingRequiredXmlNode { get; } = new ShareErrorC
 9010
 9011        /// <summary>
 9012        /// MultipleConditionHeadersNotSupported
 9013        /// </summary>
 9014        public static Azure.Storage.Files.Shares.Models.ShareErrorCode MultipleConditionHeadersNotSupported { get; } = n
 9015
 9016        /// <summary>
 9017        /// OperationTimedOut
 9018        /// </summary>
 9019        public static Azure.Storage.Files.Shares.Models.ShareErrorCode OperationTimedOut { get; } = new ShareErrorCode(@
 9020
 9021        /// <summary>
 9022        /// OutOfRangeInput
 9023        /// </summary>
 9024        public static Azure.Storage.Files.Shares.Models.ShareErrorCode OutOfRangeInput { get; } = new ShareErrorCode(@"O
 9025
 9026        /// <summary>
 9027        /// OutOfRangeQueryParameterValue
 9028        /// </summary>
 9029        public static Azure.Storage.Files.Shares.Models.ShareErrorCode OutOfRangeQueryParameterValue { get; } = new Shar
 9030
 9031        /// <summary>
 9032        /// RequestBodyTooLarge
 9033        /// </summary>
 9034        public static Azure.Storage.Files.Shares.Models.ShareErrorCode RequestBodyTooLarge { get; } = new ShareErrorCode
 9035
 9036        /// <summary>
 9037        /// ResourceTypeMismatch
 9038        /// </summary>
 9039        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ResourceTypeMismatch { get; } = new ShareErrorCod
 9040
 9041        /// <summary>
 9042        /// RequestUrlFailedToParse
 9043        /// </summary>
 9044        public static Azure.Storage.Files.Shares.Models.ShareErrorCode RequestUrlFailedToParse { get; } = new ShareError
 9045
 9046        /// <summary>
 9047        /// ResourceAlreadyExists
 9048        /// </summary>
 9049        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ResourceAlreadyExists { get; } = new ShareErrorCo
 9050
 9051        /// <summary>
 9052        /// ResourceNotFound
 9053        /// </summary>
 9054        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ResourceNotFound { get; } = new ShareErrorCode(@"
 9055
 9056        /// <summary>
 9057        /// ServerBusy
 9058        /// </summary>
 9059        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ServerBusy { get; } = new ShareErrorCode(@"Server
 9060
 9061        /// <summary>
 9062        /// UnsupportedHeader
 9063        /// </summary>
 9064        public static Azure.Storage.Files.Shares.Models.ShareErrorCode UnsupportedHeader { get; } = new ShareErrorCode(@
 9065
 9066        /// <summary>
 9067        /// UnsupportedXmlNode
 9068        /// </summary>
 9069        public static Azure.Storage.Files.Shares.Models.ShareErrorCode UnsupportedXmlNode { get; } = new ShareErrorCode(
 9070
 9071        /// <summary>
 9072        /// UnsupportedQueryParameter
 9073        /// </summary>
 9074        public static Azure.Storage.Files.Shares.Models.ShareErrorCode UnsupportedQueryParameter { get; } = new ShareErr
 9075
 9076        /// <summary>
 9077        /// UnsupportedHttpVerb
 9078        /// </summary>
 9079        public static Azure.Storage.Files.Shares.Models.ShareErrorCode UnsupportedHttpVerb { get; } = new ShareErrorCode
 9080
 9081        /// <summary>
 9082        /// CannotDeleteFileOrDirectory
 9083        /// </summary>
 9084        public static Azure.Storage.Files.Shares.Models.ShareErrorCode CannotDeleteFileOrDirectory { get; } = new ShareE
 9085
 9086        /// <summary>
 9087        /// ClientCacheFlushDelay
 9088        /// </summary>
 9089        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ClientCacheFlushDelay { get; } = new ShareErrorCo
 9090
 9091        /// <summary>
 9092        /// DeletePending
 9093        /// </summary>
 9094        public static Azure.Storage.Files.Shares.Models.ShareErrorCode DeletePending { get; } = new ShareErrorCode(@"Del
 9095
 9096        /// <summary>
 9097        /// DirectoryNotEmpty
 9098        /// </summary>
 9099        public static Azure.Storage.Files.Shares.Models.ShareErrorCode DirectoryNotEmpty { get; } = new ShareErrorCode(@
 9100
 9101        /// <summary>
 9102        /// FileLockConflict
 9103        /// </summary>
 9104        public static Azure.Storage.Files.Shares.Models.ShareErrorCode FileLockConflict { get; } = new ShareErrorCode(@"
 9105
 9106        /// <summary>
 9107        /// InvalidFileOrDirectoryPathName
 9108        /// </summary>
 9109        public static Azure.Storage.Files.Shares.Models.ShareErrorCode InvalidFileOrDirectoryPathName { get; } = new Sha
 9110
 9111        /// <summary>
 9112        /// ParentNotFound
 9113        /// </summary>
 9114        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ParentNotFound { get; } = new ShareErrorCode(@"Pa
 9115
 9116        /// <summary>
 9117        /// ReadOnlyAttribute
 9118        /// </summary>
 9119        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ReadOnlyAttribute { get; } = new ShareErrorCode(@
 9120
 9121        /// <summary>
 9122        /// ShareAlreadyExists
 9123        /// </summary>
 9124        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareAlreadyExists { get; } = new ShareErrorCode(
 9125
 9126        /// <summary>
 9127        /// ShareBeingDeleted
 9128        /// </summary>
 9129        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareBeingDeleted { get; } = new ShareErrorCode(@
 9130
 9131        /// <summary>
 9132        /// ShareDisabled
 9133        /// </summary>
 9134        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareDisabled { get; } = new ShareErrorCode(@"Sha
 9135
 9136        /// <summary>
 9137        /// ShareNotFound
 9138        /// </summary>
 9139        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareNotFound { get; } = new ShareErrorCode(@"Sha
 9140
 9141        /// <summary>
 9142        /// SharingViolation
 9143        /// </summary>
 9144        public static Azure.Storage.Files.Shares.Models.ShareErrorCode SharingViolation { get; } = new ShareErrorCode(@"
 9145
 9146        /// <summary>
 9147        /// ShareSnapshotInProgress
 9148        /// </summary>
 9149        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotInProgress { get; } = new ShareError
 9150
 9151        /// <summary>
 9152        /// ShareSnapshotCountExceeded
 9153        /// </summary>
 9154        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotCountExceeded { get; } = new ShareEr
 9155
 9156        /// <summary>
 9157        /// ShareSnapshotOperationNotSupported
 9158        /// </summary>
 9159        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotOperationNotSupported { get; } = new
 9160
 9161        /// <summary>
 9162        /// ShareHasSnapshots
 9163        /// </summary>
 9164        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareHasSnapshots { get; } = new ShareErrorCode(@
 9165
 9166        /// <summary>
 9167        /// ContainerQuotaDowngradeNotAllowed
 9168        /// </summary>
 9169        public static Azure.Storage.Files.Shares.Models.ShareErrorCode ContainerQuotaDowngradeNotAllowed { get; } = new 
 9170
 9171        /// <summary>
 9172        /// AuthorizationSourceIPMismatch
 9173        /// </summary>
 9174        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AuthorizationSourceIPMismatch { get; } = new Shar
 9175
 9176        /// <summary>
 9177        /// AuthorizationProtocolMismatch
 9178        /// </summary>
 9179        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AuthorizationProtocolMismatch { get; } = new Shar
 9180
 9181        /// <summary>
 9182        /// AuthorizationPermissionMismatch
 9183        /// </summary>
 9184        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AuthorizationPermissionMismatch { get; } = new Sh
 9185
 9186        /// <summary>
 9187        /// AuthorizationServiceMismatch
 9188        /// </summary>
 9189        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AuthorizationServiceMismatch { get; } = new Share
 9190
 9191        /// <summary>
 9192        /// AuthorizationResourceTypeMismatch
 9193        /// </summary>
 9194        public static Azure.Storage.Files.Shares.Models.ShareErrorCode AuthorizationResourceTypeMismatch { get; } = new 
 9195
 9196        /// <summary>
 9197        /// FeatureVersionMismatch
 9198        /// </summary>
 9199        public static Azure.Storage.Files.Shares.Models.ShareErrorCode FeatureVersionMismatch { get; } = new ShareErrorC
 9200
 9201        /// <summary>
 9202        /// Determines if two <see cref="ShareErrorCode"/> values are the same.
 9203        /// </summary>
 9204        /// <param name="left">The first <see cref="ShareErrorCode"/> to compare.</param>
 9205        /// <param name="right">The second <see cref="ShareErrorCode"/> to compare.</param>
 9206        /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are the same; otherwise, false.</retur
 9207        public static bool operator ==(Azure.Storage.Files.Shares.Models.ShareErrorCode left, Azure.Storage.Files.Shares
 9208
 9209        /// <summary>
 9210        /// Determines if two <see cref="ShareErrorCode"/> values are different.
 9211        /// </summary>
 9212        /// <param name="left">The first <see cref="ShareErrorCode"/> to compare.</param>
 9213        /// <param name="right">The second <see cref="ShareErrorCode"/> to compare.</param>
 9214        /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are different; otherwise, false.</retu
 9215        public static bool operator !=(Azure.Storage.Files.Shares.Models.ShareErrorCode left, Azure.Storage.Files.Shares
 9216
 9217        /// <summary>
 9218        /// Converts a string to a <see cref="ShareErrorCode"/>.
 9219        /// </summary>
 9220        /// <param name="value">The string value to convert.</param>
 9221        /// <returns>The ShareErrorCode value.</returns>
 9222        public static implicit operator ShareErrorCode(string value) => new Azure.Storage.Files.Shares.Models.ShareError
 9223
 9224        /// <summary>
 9225        /// Check if two <see cref="ShareErrorCode"/> instances are equal.
 9226        /// </summary>
 9227        /// <param name="obj">The instance to compare to.</param>
 9228        /// <returns>True if they're equal, false otherwise.</returns>
 9229        [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
 9230        public override bool Equals(object obj) => obj is Azure.Storage.Files.Shares.Models.ShareErrorCode other && Equa
 9231
 9232        /// <summary>
 9233        /// Check if two <see cref="ShareErrorCode"/> instances are equal.
 9234        /// </summary>
 9235        /// <param name="other">The instance to compare to.</param>
 9236        /// <returns>True if they're equal, false otherwise.</returns>
 9237        public bool Equals(Azure.Storage.Files.Shares.Models.ShareErrorCode other) => string.Equals(_value, other._value
 9238
 9239        /// <summary>
 9240        /// Get a hash code for the <see cref="ShareErrorCode"/>.
 9241        /// </summary>
 9242        /// <returns>Hash code for the ShareErrorCode.</returns>
 9243        [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
 9244        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
 9245
 9246        /// <summary>
 9247        /// Convert the <see cref="ShareErrorCode"/> to a string.
 9248        /// </summary>
 9249        /// <returns>String representation of the ShareErrorCode.</returns>
 9250        public override string ToString() => _value;
 9251    }
 9252}
 9253#endregion enum strings ShareErrorCode
 9254
 9255#region class ShareFileCopyInfo
 9256namespace Azure.Storage.Files.Shares.Models
 9257{
 9258    /// <summary>
 9259    /// ShareFileCopyInfo
 9260    /// </summary>
 9261    public partial class ShareFileCopyInfo
 9262    {
 9263        /// <summary>
 9264        /// If the copy is completed, contains the ETag of the destination file. If the copy is not complete, contains t
 9265        /// </summary>
 9266        public Azure.ETag ETag { get; internal set; }
 9267
 9268        /// <summary>
 9269        /// Returns the date/time that the copy operation to the destination file completed.
 9270        /// </summary>
 9271        public System.DateTimeOffset LastModified { get; internal set; }
 9272
 9273        /// <summary>
 9274        /// String identifier for this copy operation. Use with Get File or Get File Properties to check the status of t
 9275        /// </summary>
 9276        public string CopyId { get; internal set; }
 9277
 9278        /// <summary>
 9279        /// State of the copy operation identified by x-ms-copy-id.
 9280        /// </summary>
 9281        public Azure.Storage.Files.Shares.Models.CopyStatus CopyStatus { get; internal set; }
 9282
 9283        /// <summary>
 9284        /// Prevent direct instantiation of ShareFileCopyInfo instances.
 9285        /// You can use ShareModelFactory.ShareFileCopyInfo instead.
 9286        /// </summary>
 9287        internal ShareFileCopyInfo() { }
 9288    }
 9289
 9290    /// <summary>
 9291    /// ShareModelFactory provides utilities for mocking.
 9292    /// </summary>
 9293    public static partial class ShareModelFactory
 9294    {
 9295        /// <summary>
 9296        /// Creates a new ShareFileCopyInfo instance for mocking.
 9297        /// </summary>
 9298        public static ShareFileCopyInfo ShareFileCopyInfo(
 9299            Azure.ETag eTag,
 9300            System.DateTimeOffset lastModified,
 9301            string copyId,
 9302            Azure.Storage.Files.Shares.Models.CopyStatus copyStatus)
 9303        {
 9304            return new ShareFileCopyInfo()
 9305            {
 9306                ETag = eTag,
 9307                LastModified = lastModified,
 9308                CopyId = copyId,
 9309                CopyStatus = copyStatus,
 9310            };
 9311        }
 9312    }
 9313}
 9314#endregion class ShareFileCopyInfo
 9315
 9316#region class ShareFileHandle
 9317namespace Azure.Storage.Files.Shares.Models
 9318{
 9319    /// <summary>
 9320    /// A listed Azure Storage handle item.
 9321    /// </summary>
 9322    public partial class ShareFileHandle
 9323    {
 9324        /// <summary>
 9325        /// XSMB service handle ID
 9326        /// </summary>
 9327        public string HandleId { get; internal set; }
 9328
 9329        /// <summary>
 9330        /// File or directory name including full path starting from share root
 9331        /// </summary>
 9332        public string Path { get; internal set; }
 9333
 9334        /// <summary>
 9335        /// FileId uniquely identifies the file or directory.
 9336        /// </summary>
 9337        public string FileId { get; internal set; }
 9338
 9339        /// <summary>
 9340        /// ParentId uniquely identifies the parent directory of the object.
 9341        /// </summary>
 9342        public string ParentId { get; internal set; }
 9343
 9344        /// <summary>
 9345        /// SMB session ID in context of which the file handle was opened
 9346        /// </summary>
 9347        public string SessionId { get; internal set; }
 9348
 9349        /// <summary>
 9350        /// Client IP that opened the handle
 9351        /// </summary>
 9352        public string ClientIp { get; internal set; }
 9353
 9354        /// <summary>
 9355        /// Time when the session that previously opened the handle has last been reconnected. (UTC)
 9356        /// </summary>
 9357        public System.DateTimeOffset? OpenedOn { get; internal set; }
 9358
 9359        /// <summary>
 9360        /// Time handle was last connected to (UTC)
 9361        /// </summary>
 9362        public System.DateTimeOffset? LastReconnectedOn { get; internal set; }
 9363
 9364        /// <summary>
 9365        /// Prevent direct instantiation of ShareFileHandle instances.
 9366        /// You can use ShareModelFactory.ShareFileHandle instead.
 9367        /// </summary>
 9368        internal ShareFileHandle() { }
 9369
 9370        /// <summary>
 9371        /// Deserializes XML into a new ShareFileHandle instance.
 9372        /// </summary>
 9373        /// <param name="element">The XML element to deserialize.</param>
 9374        /// <returns>A deserialized ShareFileHandle instance.</returns>
 9375        internal static Azure.Storage.Files.Shares.Models.ShareFileHandle FromXml(System.Xml.Linq.XElement element)
 9376        {
 9377            System.Diagnostics.Debug.Assert(element != null);
 9378            System.Xml.Linq.XElement _child;
 9379            Azure.Storage.Files.Shares.Models.ShareFileHandle _value = new Azure.Storage.Files.Shares.Models.ShareFileHa
 9380            _child = element.Element(System.Xml.Linq.XName.Get("HandleId", ""));
 9381            if (_child != null)
 9382            {
 9383                _value.HandleId = _child.Value;
 9384            }
 9385            _child = element.Element(System.Xml.Linq.XName.Get("Path", ""));
 9386            if (_child != null)
 9387            {
 9388                _value.Path = _child.Value;
 9389            }
 9390            _child = element.Element(System.Xml.Linq.XName.Get("FileId", ""));
 9391            if (_child != null)
 9392            {
 9393                _value.FileId = _child.Value;
 9394            }
 9395            _child = element.Element(System.Xml.Linq.XName.Get("ParentId", ""));
 9396            if (_child != null)
 9397            {
 9398                _value.ParentId = _child.Value;
 9399            }
 9400            _child = element.Element(System.Xml.Linq.XName.Get("SessionId", ""));
 9401            if (_child != null)
 9402            {
 9403                _value.SessionId = _child.Value;
 9404            }
 9405            _child = element.Element(System.Xml.Linq.XName.Get("ClientIp", ""));
 9406            if (_child != null)
 9407            {
 9408                _value.ClientIp = _child.Value;
 9409            }
 9410            _child = element.Element(System.Xml.Linq.XName.Get("OpenTime", ""));
 9411            if (_child != null)
 9412            {
 9413                _value.OpenedOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCu
 9414            }
 9415            _child = element.Element(System.Xml.Linq.XName.Get("LastReconnectTime", ""));
 9416            if (_child != null)
 9417            {
 9418                _value.LastReconnectedOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.In
 9419            }
 9420            CustomizeFromXml(element, _value);
 9421            return _value;
 9422        }
 9423
 9424        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareFi
 9425    }
 9426
 9427    /// <summary>
 9428    /// ShareModelFactory provides utilities for mocking.
 9429    /// </summary>
 9430    public static partial class ShareModelFactory
 9431    {
 9432        /// <summary>
 9433        /// Creates a new ShareFileHandle instance for mocking.
 9434        /// </summary>
 9435        public static ShareFileHandle ShareFileHandle(
 9436            string handleId,
 9437            string path,
 9438            string fileId,
 9439            string sessionId,
 9440            string clientIp,
 9441            string parentId = default,
 9442            System.DateTimeOffset? openedOn = default,
 9443            System.DateTimeOffset? lastReconnectedOn = default)
 9444        {
 9445            return new ShareFileHandle()
 9446            {
 9447                HandleId = handleId,
 9448                Path = path,
 9449                FileId = fileId,
 9450                SessionId = sessionId,
 9451                ClientIp = clientIp,
 9452                ParentId = parentId,
 9453                OpenedOn = openedOn,
 9454                LastReconnectedOn = lastReconnectedOn,
 9455            };
 9456        }
 9457    }
 9458}
 9459#endregion class ShareFileHandle
 9460
 9461#region class ShareFileLease
 9462namespace Azure.Storage.Files.Shares.Models
 9463{
 9464    /// <summary>
 9465    /// ShareFileLease
 9466    /// </summary>
 9467    public partial class ShareFileLease
 9468    {
 9469        /// <summary>
 9470        /// The ETag contains a value that you can use to perform operations conditionally. If the request version is 20
 9471        /// </summary>
 9472        public Azure.ETag ETag { get; internal set; }
 9473
 9474        /// <summary>
 9475        /// Returns the date and time the file was last modified. Any operation that modifies the file, including an upd
 9476        /// </summary>
 9477        public System.DateTimeOffset LastModified { get; internal set; }
 9478
 9479        /// <summary>
 9480        /// Uniquely identifies a file's lease
 9481        /// </summary>
 9482        public string LeaseId { get; internal set; }
 9483
 9484        /// <summary>
 9485        /// Prevent direct instantiation of ShareFileLease instances.
 9486        /// You can use ShareModelFactory.ShareFileLease instead.
 9487        /// </summary>
 9488        internal ShareFileLease() { }
 9489    }
 9490
 9491    /// <summary>
 9492    /// ShareModelFactory provides utilities for mocking.
 9493    /// </summary>
 9494    public static partial class ShareModelFactory
 9495    {
 9496        /// <summary>
 9497        /// Creates a new ShareFileLease instance for mocking.
 9498        /// </summary>
 9499        public static ShareFileLease ShareFileLease(
 9500            Azure.ETag eTag,
 9501            System.DateTimeOffset lastModified,
 9502            string leaseId)
 9503        {
 9504            return new ShareFileLease()
 9505            {
 9506                ETag = eTag,
 9507                LastModified = lastModified,
 9508                LeaseId = leaseId,
 9509            };
 9510        }
 9511    }
 9512}
 9513#endregion class ShareFileLease
 9514
 9515#region class ShareFileRangeInfoInternal
 9516namespace Azure.Storage.Files.Shares.Models
 9517{
 9518    /// <summary>
 9519    /// ShareFileRangeInfoInternal
 9520    /// </summary>
 9521    internal partial class ShareFileRangeInfoInternal
 9522    {
 9523        /// <summary>
 9524        /// The date/time that the file was last modified. Any operation that modifies the file, including an update of 
 9525        /// </summary>
 9526        public System.DateTimeOffset LastModified { get; internal set; }
 9527
 9528        /// <summary>
 9529        /// The ETag contains a value which represents the version of the file, in quotes.
 9530        /// </summary>
 9531        public Azure.ETag ETag { get; internal set; }
 9532
 9533        /// <summary>
 9534        /// The size of the file in bytes.
 9535        /// </summary>
 9536        public long FileContentLength { get; internal set; }
 9537
 9538        /// <summary>
 9539        /// A list of non-overlapping valid ranges, sorted by increasing address range.
 9540        /// </summary>
 9541        public System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.Range> Ranges { get; internal se
 9542
 9543        /// <summary>
 9544        /// Creates a new ShareFileRangeInfoInternal instance
 9545        /// </summary>
 9546        public ShareFileRangeInfoInternal()
 9547        {
 9548            Ranges = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.Range>();
 9549        }
 9550    }
 9551}
 9552#endregion class ShareFileRangeInfoInternal
 9553
 9554#region enum ShareFileRangeWriteType
 9555namespace Azure.Storage.Files.Shares.Models
 9556{
 9557    /// <summary>
 9558    /// Specify one of the following options: - Update: Writes the bytes specified by the request body into the specifie
 9559    /// </summary>
 9560    public enum ShareFileRangeWriteType
 9561    {
 9562        /// <summary>
 9563        /// update
 9564        /// </summary>
 9565        Update,
 9566
 9567        /// <summary>
 9568        /// clear
 9569        /// </summary>
 9570        Clear
 9571    }
 9572}
 9573
 9574namespace Azure.Storage.Files.Shares
 9575{
 9576    internal static partial class FileRestClient
 9577    {
 9578        public static partial class Serialization
 9579        {
 9580            public static string ToString(Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType value)
 9581            {
 13049582                return value switch
 13049583                {
 26049584                    Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType.Update => "update",
 13089585                    Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType.Clear => "clear",
 09586                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 13049587                };
 9588            }
 9589
 9590            public static Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType ParseShareFileRangeWriteType(string 
 9591            {
 09592                return value switch
 09593                {
 09594                    "update" => Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType.Update,
 09595                    "clear" => Azure.Storage.Files.Shares.Models.ShareFileRangeWriteType.Clear,
 09596                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 09597                };
 9598            }
 9599        }
 9600    }
 9601}
 9602#endregion enum ShareFileRangeWriteType
 9603
 9604#region class ShareFileUploadInfo
 9605namespace Azure.Storage.Files.Shares.Models
 9606{
 9607    /// <summary>
 9608    /// ShareFileUploadInfo
 9609    /// </summary>
 9610    public partial class ShareFileUploadInfo
 9611    {
 9612        /// <summary>
 9613        /// The ETag contains a value which represents the version of the file, in quotes.
 9614        /// </summary>
 9615        public Azure.ETag ETag { get; internal set; }
 9616
 9617        /// <summary>
 9618        /// Returns the date and time the directory was last modified. Any operation that modifies the share or its prop
 9619        /// </summary>
 9620        public System.DateTimeOffset LastModified { get; internal set; }
 9621
 9622        /// <summary>
 9623        /// This header is returned so that the client can check for message content integrity. The value of this header
 9624        /// </summary>
 9625        #pragma warning disable CA1819 // Properties should not return arrays
 9626        public byte[] ContentHash { get; internal set; }
 9627        #pragma warning restore CA1819 // Properties should not return arrays
 9628
 9629        /// <summary>
 9630        /// The value of this header is set to true if the contents of the request are successfully encrypted using the 
 9631        /// </summary>
 9632        public bool IsServerEncrypted { get; internal set; }
 9633
 9634        /// <summary>
 9635        /// Prevent direct instantiation of ShareFileUploadInfo instances.
 9636        /// You can use ShareModelFactory.ShareFileUploadInfo instead.
 9637        /// </summary>
 9638        internal ShareFileUploadInfo() { }
 9639    }
 9640
 9641    /// <summary>
 9642    /// ShareModelFactory provides utilities for mocking.
 9643    /// </summary>
 9644    public static partial class ShareModelFactory
 9645    {
 9646        /// <summary>
 9647        /// Creates a new ShareFileUploadInfo instance for mocking.
 9648        /// </summary>
 9649        public static ShareFileUploadInfo ShareFileUploadInfo(
 9650            Azure.ETag eTag,
 9651            System.DateTimeOffset lastModified,
 9652            byte[] contentHash,
 9653            bool isServerEncrypted)
 9654        {
 9655            return new ShareFileUploadInfo()
 9656            {
 9657                ETag = eTag,
 9658                LastModified = lastModified,
 9659                ContentHash = contentHash,
 9660                IsServerEncrypted = isServerEncrypted,
 9661            };
 9662        }
 9663    }
 9664}
 9665#endregion class ShareFileUploadInfo
 9666
 9667#region class ShareInfo
 9668namespace Azure.Storage.Files.Shares.Models
 9669{
 9670    /// <summary>
 9671    /// ShareInfo
 9672    /// </summary>
 9673    public partial class ShareInfo
 9674    {
 9675        /// <summary>
 9676        /// The ETag contains a value which represents the version of the share, in quotes.
 9677        /// </summary>
 9678        public Azure.ETag ETag { get; internal set; }
 9679
 9680        /// <summary>
 9681        /// Returns the date and time the share was last modified. Any operation that modifies the share or its properti
 9682        /// </summary>
 9683        public System.DateTimeOffset LastModified { get; internal set; }
 9684
 9685        /// <summary>
 9686        /// Prevent direct instantiation of ShareInfo instances.
 9687        /// You can use ShareModelFactory.ShareInfo instead.
 9688        /// </summary>
 9689        internal ShareInfo() { }
 9690    }
 9691
 9692    /// <summary>
 9693    /// ShareModelFactory provides utilities for mocking.
 9694    /// </summary>
 9695    public static partial class ShareModelFactory
 9696    {
 9697        /// <summary>
 9698        /// Creates a new ShareInfo instance for mocking.
 9699        /// </summary>
 9700        public static ShareInfo ShareInfo(
 9701            Azure.ETag eTag,
 9702            System.DateTimeOffset lastModified)
 9703        {
 9704            return new ShareInfo()
 9705            {
 9706                ETag = eTag,
 9707                LastModified = lastModified,
 9708            };
 9709        }
 9710    }
 9711}
 9712#endregion class ShareInfo
 9713
 9714#region class ShareItem
 9715namespace Azure.Storage.Files.Shares.Models
 9716{
 9717    /// <summary>
 9718    /// A listed Azure Storage share item.
 9719    /// </summary>
 9720    public partial class ShareItem
 9721    {
 9722        /// <summary>
 9723        /// Name
 9724        /// </summary>
 9725        public string Name { get; internal set; }
 9726
 9727        /// <summary>
 9728        /// Snapshot
 9729        /// </summary>
 9730        public string Snapshot { get; internal set; }
 9731
 9732        /// <summary>
 9733        /// Deleted
 9734        /// </summary>
 9735        public bool? IsDeleted { get; internal set; }
 9736
 9737        /// <summary>
 9738        /// Version
 9739        /// </summary>
 9740        public string VersionId { get; internal set; }
 9741
 9742        /// <summary>
 9743        /// Properties of a share.
 9744        /// </summary>
 9745        public Azure.Storage.Files.Shares.Models.ShareProperties Properties { get; internal set; }
 9746
 9747        /// <summary>
 9748        /// Creates a new ShareItem instance
 9749        /// </summary>
 9750        internal ShareItem()
 9751            : this(false)
 9752        {
 9753        }
 9754
 9755        /// <summary>
 9756        /// Creates a new ShareItem instance
 9757        /// </summary>
 9758        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 9759        internal ShareItem(bool skipInitialization)
 9760        {
 9761            if (!skipInitialization)
 9762            {
 9763                Properties = new Azure.Storage.Files.Shares.Models.ShareProperties();
 9764            }
 9765        }
 9766
 9767        /// <summary>
 9768        /// Deserializes XML into a new ShareItem instance.
 9769        /// </summary>
 9770        /// <param name="element">The XML element to deserialize.</param>
 9771        /// <returns>A deserialized ShareItem instance.</returns>
 9772        internal static Azure.Storage.Files.Shares.Models.ShareItem FromXml(System.Xml.Linq.XElement element)
 9773        {
 9774            System.Diagnostics.Debug.Assert(element != null);
 9775            System.Xml.Linq.XElement _child;
 9776            Azure.Storage.Files.Shares.Models.ShareItem _value = new Azure.Storage.Files.Shares.Models.ShareItem(true);
 9777            _child = element.Element(System.Xml.Linq.XName.Get("Name", ""));
 9778            if (_child != null)
 9779            {
 9780                _value.Name = _child.Value;
 9781            }
 9782            _child = element.Element(System.Xml.Linq.XName.Get("Snapshot", ""));
 9783            if (_child != null)
 9784            {
 9785                _value.Snapshot = _child.Value;
 9786            }
 9787            _child = element.Element(System.Xml.Linq.XName.Get("Deleted", ""));
 9788            if (_child != null)
 9789            {
 9790                _value.IsDeleted = bool.Parse(_child.Value);
 9791            }
 9792            _child = element.Element(System.Xml.Linq.XName.Get("Version", ""));
 9793            if (_child != null)
 9794            {
 9795                _value.VersionId = _child.Value;
 9796            }
 9797            _child = element.Element(System.Xml.Linq.XName.Get("Properties", ""));
 9798            if (_child != null)
 9799            {
 9800                _value.Properties = Azure.Storage.Files.Shares.Models.ShareProperties.FromXml(_child);
 9801            }
 9802            CustomizeFromXml(element, _value);
 9803            return _value;
 9804        }
 9805
 9806        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareIt
 9807    }
 9808
 9809    /// <summary>
 9810    /// ShareModelFactory provides utilities for mocking.
 9811    /// </summary>
 9812    public static partial class ShareModelFactory
 9813    {
 9814        /// <summary>
 9815        /// Creates a new ShareItem instance for mocking.
 9816        /// </summary>
 9817        public static ShareItem ShareItem(
 9818            string name,
 9819            Azure.Storage.Files.Shares.Models.ShareProperties properties,
 9820            string snapshot = default,
 9821            bool? isDeleted = default,
 9822            string versionId = default)
 9823        {
 9824            return new ShareItem()
 9825            {
 9826                Name = name,
 9827                Properties = properties,
 9828                Snapshot = snapshot,
 9829                IsDeleted = isDeleted,
 9830                VersionId = versionId,
 9831            };
 9832        }
 9833    }
 9834}
 9835#endregion class ShareItem
 9836
 9837#region enum ShareLeaseDuration
 9838namespace Azure.Storage.Files.Shares.Models
 9839{
 9840    /// <summary>
 9841    /// When a file is leased, specifies whether the lease is of infinite or fixed duration.
 9842    /// </summary>
 9843    public enum ShareLeaseDuration
 9844    {
 9845        /// <summary>
 9846        /// infinite
 9847        /// </summary>
 9848        Infinite,
 9849
 9850        /// <summary>
 9851        /// fixed
 9852        /// </summary>
 9853        Fixed
 9854    }
 9855}
 9856
 9857namespace Azure.Storage.Files.Shares
 9858{
 9859    internal static partial class FileRestClient
 9860    {
 9861        public static partial class Serialization
 9862        {
 9863            public static string ToString(Azure.Storage.Files.Shares.Models.ShareLeaseDuration value)
 9864            {
 09865                return value switch
 09866                {
 09867                    Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite => "infinite",
 09868                    Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Fixed => "fixed",
 09869                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 09870                };
 9871            }
 9872
 9873            public static Azure.Storage.Files.Shares.Models.ShareLeaseDuration ParseShareLeaseDuration(string value)
 9874            {
 169875                return value switch
 169876                {
 329877                    "infinite" => Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Infinite,
 09878                    "fixed" => Azure.Storage.Files.Shares.Models.ShareLeaseDuration.Fixed,
 09879                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 169880                };
 9881            }
 9882        }
 9883    }
 9884}
 9885#endregion enum ShareLeaseDuration
 9886
 9887#region enum ShareLeaseState
 9888namespace Azure.Storage.Files.Shares.Models
 9889{
 9890    /// <summary>
 9891    /// Lease state of the file.
 9892    /// </summary>
 9893    public enum ShareLeaseState
 9894    {
 9895        /// <summary>
 9896        /// available
 9897        /// </summary>
 9898        Available,
 9899
 9900        /// <summary>
 9901        /// leased
 9902        /// </summary>
 9903        Leased,
 9904
 9905        /// <summary>
 9906        /// expired
 9907        /// </summary>
 9908        Expired,
 9909
 9910        /// <summary>
 9911        /// breaking
 9912        /// </summary>
 9913        Breaking,
 9914
 9915        /// <summary>
 9916        /// broken
 9917        /// </summary>
 9918        Broken
 9919    }
 9920}
 9921
 9922namespace Azure.Storage.Files.Shares
 9923{
 9924    internal static partial class FileRestClient
 9925    {
 9926        public static partial class Serialization
 9927        {
 9928            public static string ToString(Azure.Storage.Files.Shares.Models.ShareLeaseState value)
 9929            {
 09930                return value switch
 09931                {
 09932                    Azure.Storage.Files.Shares.Models.ShareLeaseState.Available => "available",
 09933                    Azure.Storage.Files.Shares.Models.ShareLeaseState.Leased => "leased",
 09934                    Azure.Storage.Files.Shares.Models.ShareLeaseState.Expired => "expired",
 09935                    Azure.Storage.Files.Shares.Models.ShareLeaseState.Breaking => "breaking",
 09936                    Azure.Storage.Files.Shares.Models.ShareLeaseState.Broken => "broken",
 09937                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 09938                };
 9939            }
 9940
 9941            public static Azure.Storage.Files.Shares.Models.ShareLeaseState ParseShareLeaseState(string value)
 9942            {
 1349943                return value switch
 1349944                {
 2529945                    "available" => Azure.Storage.Files.Shares.Models.ShareLeaseState.Available,
 1509946                    "leased" => Azure.Storage.Files.Shares.Models.ShareLeaseState.Leased,
 09947                    "expired" => Azure.Storage.Files.Shares.Models.ShareLeaseState.Expired,
 09948                    "breaking" => Azure.Storage.Files.Shares.Models.ShareLeaseState.Breaking,
 09949                    "broken" => Azure.Storage.Files.Shares.Models.ShareLeaseState.Broken,
 09950                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 1349951                };
 9952            }
 9953        }
 9954    }
 9955}
 9956#endregion enum ShareLeaseState
 9957
 9958#region enum ShareLeaseStatus
 9959namespace Azure.Storage.Files.Shares.Models
 9960{
 9961    /// <summary>
 9962    /// The current lease status of the file.
 9963    /// </summary>
 9964    #pragma warning disable CA1717 // Only FlagsAttribute enums should have plural names
 9965    public enum ShareLeaseStatus
 9966    #pragma warning restore CA1717 // Only FlagsAttribute enums should have plural names
 9967    {
 9968        /// <summary>
 9969        /// locked
 9970        /// </summary>
 9971        Locked,
 9972
 9973        /// <summary>
 9974        /// unlocked
 9975        /// </summary>
 9976        Unlocked
 9977    }
 9978}
 9979
 9980namespace Azure.Storage.Files.Shares
 9981{
 9982    internal static partial class FileRestClient
 9983    {
 9984        public static partial class Serialization
 9985        {
 9986            public static string ToString(Azure.Storage.Files.Shares.Models.ShareLeaseStatus value)
 9987            {
 09988                return value switch
 09989                {
 09990                    Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked => "locked",
 09991                    Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Unlocked => "unlocked",
 09992                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 09993                };
 9994            }
 9995
 9996            public static Azure.Storage.Files.Shares.Models.ShareLeaseStatus ParseShareLeaseStatus(string value)
 9997            {
 1349998                return value switch
 1349999                {
 15010000                    "locked" => Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Locked,
 25210001                    "unlocked" => Azure.Storage.Files.Shares.Models.ShareLeaseStatus.Unlocked,
 010002                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Files
 13410003                };
 10004            }
 10005        }
 10006    }
 10007}
 10008#endregion enum ShareLeaseStatus
 10009
 10010#region class ShareMetrics
 10011namespace Azure.Storage.Files.Shares.Models
 10012{
 10013    /// <summary>
 10014    /// Storage Analytics metrics for file service.
 10015    /// </summary>
 10016    public partial class ShareMetrics
 10017    {
 10018        /// <summary>
 10019        /// The version of Storage Analytics to configure.
 10020        /// </summary>
 10021        public string Version { get; set; }
 10022
 10023        /// <summary>
 10024        /// Indicates whether metrics are enabled for the File service.
 10025        /// </summary>
 10026        public bool Enabled { get; set; }
 10027
 10028        /// <summary>
 10029        /// The retention policy.
 10030        /// </summary>
 10031        public Azure.Storage.Files.Shares.Models.ShareRetentionPolicy RetentionPolicy { get; set; }
 10032
 10033        /// <summary>
 10034        /// Indicates whether metrics should generate summary statistics for called API operations.
 10035        /// </summary>
 10036        public bool? IncludeApis { get; set; }
 10037
 10038        /// <summary>
 10039        /// Creates a new ShareMetrics instance
 10040        /// </summary>
 10041        public ShareMetrics()
 10042            : this(false)
 10043        {
 10044        }
 10045
 10046        /// <summary>
 10047        /// Creates a new ShareMetrics instance
 10048        /// </summary>
 10049        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 10050        internal ShareMetrics(bool skipInitialization)
 10051        {
 10052            if (!skipInitialization)
 10053            {
 10054                RetentionPolicy = new Azure.Storage.Files.Shares.Models.ShareRetentionPolicy();
 10055            }
 10056        }
 10057
 10058        /// <summary>
 10059        /// Serialize a ShareMetrics instance as XML.
 10060        /// </summary>
 10061        /// <param name="value">The ShareMetrics instance to serialize.</param>
 10062        /// <param name="name">An optional name to use for the root element instead of "Metrics".</param>
 10063        /// <param name="ns">An optional namespace to use for the root element instead of "".</param>
 10064        /// <returns>The serialized XML element.</returns>
 10065        internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Files.Shares.Models.ShareMetrics value, string name
 10066        {
 10067            System.Diagnostics.Debug.Assert(value != null);
 10068            System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns));
 10069            _element.Add(new System.Xml.Linq.XElement(
 10070                System.Xml.Linq.XName.Get("Version", ""),
 10071                value.Version));
 10072            _element.Add(new System.Xml.Linq.XElement(
 10073                System.Xml.Linq.XName.Get("Enabled", ""),
 10074                #pragma warning disable CA1308 // Normalize strings to uppercase
 10075                value.Enabled.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant()));
 10076                #pragma warning restore CA1308 // Normalize strings to uppercase
 10077            if (value.RetentionPolicy != null)
 10078            {
 10079                _element.Add(Azure.Storage.Files.Shares.Models.ShareRetentionPolicy.ToXml(value.RetentionPolicy, "Retent
 10080            }
 10081            if (value.IncludeApis != null)
 10082            {
 10083                _element.Add(new System.Xml.Linq.XElement(
 10084                    System.Xml.Linq.XName.Get("IncludeAPIs", ""),
 10085                    #pragma warning disable CA1308 // Normalize strings to uppercase
 10086                    value.IncludeApis.Value.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant
 10087                    #pragma warning restore CA1308 // Normalize strings to uppercase
 10088            }
 10089            return _element;
 10090        }
 10091
 10092        /// <summary>
 10093        /// Deserializes XML into a new ShareMetrics instance.
 10094        /// </summary>
 10095        /// <param name="element">The XML element to deserialize.</param>
 10096        /// <returns>A deserialized ShareMetrics instance.</returns>
 10097        internal static Azure.Storage.Files.Shares.Models.ShareMetrics FromXml(System.Xml.Linq.XElement element)
 10098        {
 10099            System.Diagnostics.Debug.Assert(element != null);
 10100            System.Xml.Linq.XElement _child;
 10101            Azure.Storage.Files.Shares.Models.ShareMetrics _value = new Azure.Storage.Files.Shares.Models.ShareMetrics(t
 10102            _child = element.Element(System.Xml.Linq.XName.Get("Version", ""));
 10103            if (_child != null)
 10104            {
 10105                _value.Version = _child.Value;
 10106            }
 10107            _child = element.Element(System.Xml.Linq.XName.Get("Enabled", ""));
 10108            if (_child != null)
 10109            {
 10110                _value.Enabled = bool.Parse(_child.Value);
 10111            }
 10112            _child = element.Element(System.Xml.Linq.XName.Get("RetentionPolicy", ""));
 10113            if (_child != null)
 10114            {
 10115                _value.RetentionPolicy = Azure.Storage.Files.Shares.Models.ShareRetentionPolicy.FromXml(_child);
 10116            }
 10117            _child = element.Element(System.Xml.Linq.XName.Get("IncludeAPIs", ""));
 10118            if (_child != null)
 10119            {
 10120                _value.IncludeApis = bool.Parse(_child.Value);
 10121            }
 10122            CustomizeFromXml(element, _value);
 10123            return _value;
 10124        }
 10125
 10126        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareMe
 10127    }
 10128}
 10129#endregion class ShareMetrics
 10130
 10131#region class ShareProperties
 10132namespace Azure.Storage.Files.Shares.Models
 10133{
 10134    /// <summary>
 10135    /// Properties of a share.
 10136    /// </summary>
 10137    public partial class ShareProperties
 10138    {
 10139        /// <summary>
 10140        /// Last-Modified
 10141        /// </summary>
 10142        public System.DateTimeOffset? LastModified { get; internal set; }
 10143
 10144        /// <summary>
 10145        /// Etag
 10146        /// </summary>
 10147        public Azure.ETag? ETag { get; internal set; }
 10148
 10149        /// <summary>
 10150        /// ProvisionedIops
 10151        /// </summary>
 10152        public int? ProvisionedIops { get; internal set; }
 10153
 10154        /// <summary>
 10155        /// ProvisionedIngressMBps
 10156        /// </summary>
 10157        public int? ProvisionedIngressMBps { get; internal set; }
 10158
 10159        /// <summary>
 10160        /// ProvisionedEgressMBps
 10161        /// </summary>
 10162        public int? ProvisionedEgressMBps { get; internal set; }
 10163
 10164        /// <summary>
 10165        /// NextAllowedQuotaDowngradeTime
 10166        /// </summary>
 10167        public System.DateTimeOffset? NextAllowedQuotaDowngradeTime { get; internal set; }
 10168
 10169        /// <summary>
 10170        /// DeletedTime
 10171        /// </summary>
 10172        public System.DateTimeOffset? DeletedOn { get; internal set; }
 10173
 10174        /// <summary>
 10175        /// RemainingRetentionDays
 10176        /// </summary>
 10177        public int? RemainingRetentionDays { get; internal set; }
 10178
 10179        /// <summary>
 10180        /// QuotaInGB
 10181        /// </summary>
 10182        public int? QuotaInGB { get; internal set; }
 10183
 10184        /// <summary>
 10185        /// Metadata
 10186        /// </summary>
 10187        public System.Collections.Generic.IDictionary<string, string> Metadata { get; internal set; }
 10188
 10189        /// <summary>
 10190        /// Creates a new ShareProperties instance
 10191        /// </summary>
 10192        internal ShareProperties()
 10193            : this(false)
 10194        {
 10195        }
 10196
 10197        /// <summary>
 10198        /// Creates a new ShareProperties instance
 10199        /// </summary>
 10200        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 10201        internal ShareProperties(bool skipInitialization)
 10202        {
 10203            if (!skipInitialization)
 10204            {
 10205                Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgnore
 10206            }
 10207        }
 10208
 10209        /// <summary>
 10210        /// Deserializes XML into a new ShareProperties instance.
 10211        /// </summary>
 10212        /// <param name="element">The XML element to deserialize.</param>
 10213        /// <returns>A deserialized ShareProperties instance.</returns>
 10214        internal static Azure.Storage.Files.Shares.Models.ShareProperties FromXml(System.Xml.Linq.XElement element)
 10215        {
 10216            System.Diagnostics.Debug.Assert(element != null);
 10217            System.Xml.Linq.XElement _child;
 10218            Azure.Storage.Files.Shares.Models.ShareProperties _value = new Azure.Storage.Files.Shares.Models.ShareProper
 10219            _child = element.Element(System.Xml.Linq.XName.Get("Last-Modified", ""));
 10220            if (_child != null)
 10221            {
 10222                _value.LastModified = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.Invaria
 10223            }
 10224            _child = element.Element(System.Xml.Linq.XName.Get("Etag", ""));
 10225            if (_child != null)
 10226            {
 10227                _value.ETag = new Azure.ETag(_child.Value);
 10228            }
 10229            _child = element.Element(System.Xml.Linq.XName.Get("ProvisionedIops", ""));
 10230            if (_child != null)
 10231            {
 10232                _value.ProvisionedIops = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 10233            }
 10234            _child = element.Element(System.Xml.Linq.XName.Get("ProvisionedIngressMBps", ""));
 10235            if (_child != null)
 10236            {
 10237                _value.ProvisionedIngressMBps = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCultur
 10238            }
 10239            _child = element.Element(System.Xml.Linq.XName.Get("ProvisionedEgressMBps", ""));
 10240            if (_child != null)
 10241            {
 10242                _value.ProvisionedEgressMBps = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture
 10243            }
 10244            _child = element.Element(System.Xml.Linq.XName.Get("NextAllowedQuotaDowngradeTime", ""));
 10245            if (_child != null)
 10246            {
 10247                _value.NextAllowedQuotaDowngradeTime = System.DateTimeOffset.Parse(_child.Value, System.Globalization.Cu
 10248            }
 10249            _child = element.Element(System.Xml.Linq.XName.Get("DeletedTime", ""));
 10250            if (_child != null)
 10251            {
 10252                _value.DeletedOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.InvariantC
 10253            }
 10254            _child = element.Element(System.Xml.Linq.XName.Get("RemainingRetentionDays", ""));
 10255            if (_child != null)
 10256            {
 10257                _value.RemainingRetentionDays = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCultur
 10258            }
 10259            _child = element.Element(System.Xml.Linq.XName.Get("Quota", ""));
 10260            if (_child != null)
 10261            {
 10262                _value.QuotaInGB = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 10263            }
 10264            _value.Metadata = new System.Collections.Generic.Dictionary<string, string>(System.StringComparer.OrdinalIgn
 10265            _child = element.Element(System.Xml.Linq.XName.Get("Metadata", ""));
 10266            if (_child != null)
 10267            {
 10268                foreach (System.Xml.Linq.XElement _pair in _child.Elements())
 10269                {
 10270                    _value.Metadata[_pair.Name.LocalName] = _pair.Value;
 10271                }
 10272            }
 10273            CustomizeFromXml(element, _value);
 10274            return _value;
 10275        }
 10276
 10277        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.SharePr
 10278    }
 10279
 10280    /// <summary>
 10281    /// ShareModelFactory provides utilities for mocking.
 10282    /// </summary>
 10283    public static partial class ShareModelFactory
 10284    {
 10285        /// <summary>
 10286        /// Creates a new ShareProperties instance for mocking.
 10287        /// </summary>
 10288        public static ShareProperties ShareProperties(
 10289            System.DateTimeOffset? lastModified = default,
 10290            Azure.ETag? eTag = default,
 10291            int? provisionedIops = default,
 10292            int? provisionedIngressMBps = default,
 10293            int? provisionedEgressMBps = default,
 10294            System.DateTimeOffset? nextAllowedQuotaDowngradeTime = default,
 10295            System.DateTimeOffset? deletedOn = default,
 10296            int? remainingRetentionDays = default,
 10297            int? quotaInGB = default,
 10298            System.Collections.Generic.IDictionary<string, string> metadata = default)
 10299        {
 10300            return new ShareProperties()
 10301            {
 10302                LastModified = lastModified,
 10303                ETag = eTag,
 10304                ProvisionedIops = provisionedIops,
 10305                ProvisionedIngressMBps = provisionedIngressMBps,
 10306                ProvisionedEgressMBps = provisionedEgressMBps,
 10307                NextAllowedQuotaDowngradeTime = nextAllowedQuotaDowngradeTime,
 10308                DeletedOn = deletedOn,
 10309                RemainingRetentionDays = remainingRetentionDays,
 10310                QuotaInGB = quotaInGB,
 10311                Metadata = metadata,
 10312            };
 10313        }
 10314    }
 10315}
 10316#endregion class ShareProperties
 10317
 10318#region class ShareRetentionPolicy
 10319namespace Azure.Storage.Files.Shares.Models
 10320{
 10321    /// <summary>
 10322    /// The retention policy.
 10323    /// </summary>
 10324    public partial class ShareRetentionPolicy
 10325    {
 10326        /// <summary>
 10327        /// Indicates whether a retention policy is enabled for the File service. If false, metrics data is retained, an
 10328        /// </summary>
 10329        public bool Enabled { get; set; }
 10330
 10331        /// <summary>
 10332        /// Indicates the number of days that metrics data should be retained. All data older than this value will be de
 10333        /// </summary>
 10334        public int? Days { get; set; }
 10335
 10336        /// <summary>
 10337        /// Creates a new ShareRetentionPolicy instance
 10338        /// </summary>
 10339        public ShareRetentionPolicy() { }
 10340
 10341        /// <summary>
 10342        /// Serialize a ShareRetentionPolicy instance as XML.
 10343        /// </summary>
 10344        /// <param name="value">The ShareRetentionPolicy instance to serialize.</param>
 10345        /// <param name="name">An optional name to use for the root element instead of "RetentionPolicy".</param>
 10346        /// <param name="ns">An optional namespace to use for the root element instead of "".</param>
 10347        /// <returns>The serialized XML element.</returns>
 10348        internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Files.Shares.Models.ShareRetentionPolicy value, str
 10349        {
 10350            System.Diagnostics.Debug.Assert(value != null);
 10351            System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns));
 10352            _element.Add(new System.Xml.Linq.XElement(
 10353                System.Xml.Linq.XName.Get("Enabled", ""),
 10354                #pragma warning disable CA1308 // Normalize strings to uppercase
 10355                value.Enabled.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant()));
 10356                #pragma warning restore CA1308 // Normalize strings to uppercase
 10357            if (value.Days != null)
 10358            {
 10359                _element.Add(new System.Xml.Linq.XElement(
 10360                    System.Xml.Linq.XName.Get("Days", ""),
 10361                    value.Days.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)));
 10362            }
 10363            return _element;
 10364        }
 10365
 10366        /// <summary>
 10367        /// Deserializes XML into a new ShareRetentionPolicy instance.
 10368        /// </summary>
 10369        /// <param name="element">The XML element to deserialize.</param>
 10370        /// <returns>A deserialized ShareRetentionPolicy instance.</returns>
 10371        internal static Azure.Storage.Files.Shares.Models.ShareRetentionPolicy FromXml(System.Xml.Linq.XElement element)
 10372        {
 10373            System.Diagnostics.Debug.Assert(element != null);
 10374            System.Xml.Linq.XElement _child;
 10375            Azure.Storage.Files.Shares.Models.ShareRetentionPolicy _value = new Azure.Storage.Files.Shares.Models.ShareR
 10376            _child = element.Element(System.Xml.Linq.XName.Get("Enabled", ""));
 10377            if (_child != null)
 10378            {
 10379                _value.Enabled = bool.Parse(_child.Value);
 10380            }
 10381            _child = element.Element(System.Xml.Linq.XName.Get("Days", ""));
 10382            if (_child != null)
 10383            {
 10384                _value.Days = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 10385            }
 10386            CustomizeFromXml(element, _value);
 10387            return _value;
 10388        }
 10389
 10390        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareRe
 10391    }
 10392}
 10393#endregion class ShareRetentionPolicy
 10394
 10395#region class ShareServiceProperties
 10396namespace Azure.Storage.Files.Shares.Models
 10397{
 10398    /// <summary>
 10399    /// Storage service properties.
 10400    /// </summary>
 10401    public partial class ShareServiceProperties
 10402    {
 10403        /// <summary>
 10404        /// A summary of request statistics grouped by API in hourly aggregates for files.
 10405        /// </summary>
 10406        public Azure.Storage.Files.Shares.Models.ShareMetrics HourMetrics { get; set; }
 10407
 10408        /// <summary>
 10409        /// A summary of request statistics grouped by API in minute aggregates for files.
 10410        /// </summary>
 10411        public Azure.Storage.Files.Shares.Models.ShareMetrics MinuteMetrics { get; set; }
 10412
 10413        /// <summary>
 10414        /// The set of CORS rules.
 10415        /// </summary>
 10416        public System.Collections.Generic.IList<Azure.Storage.Files.Shares.Models.ShareCorsRule> Cors { get; set; }
 10417
 10418        /// <summary>
 10419        /// Creates a new ShareServiceProperties instance
 10420        /// </summary>
 10421        public ShareServiceProperties()
 10422            : this(false)
 10423        {
 10424        }
 10425
 10426        /// <summary>
 10427        /// Creates a new ShareServiceProperties instance
 10428        /// </summary>
 10429        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 10430        internal ShareServiceProperties(bool skipInitialization)
 10431        {
 10432            if (!skipInitialization)
 10433            {
 10434                HourMetrics = new Azure.Storage.Files.Shares.Models.ShareMetrics();
 10435                MinuteMetrics = new Azure.Storage.Files.Shares.Models.ShareMetrics();
 10436            }
 10437        }
 10438
 10439        /// <summary>
 10440        /// Serialize a ShareServiceProperties instance as XML.
 10441        /// </summary>
 10442        /// <param name="value">The ShareServiceProperties instance to serialize.</param>
 10443        /// <param name="name">An optional name to use for the root element instead of "StorageServiceProperties".</para
 10444        /// <param name="ns">An optional namespace to use for the root element instead of "".</param>
 10445        /// <returns>The serialized XML element.</returns>
 10446        internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Files.Shares.Models.ShareServiceProperties value, s
 10447        {
 10448            System.Diagnostics.Debug.Assert(value != null);
 10449            System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns));
 10450            if (value.HourMetrics != null)
 10451            {
 10452                _element.Add(Azure.Storage.Files.Shares.Models.ShareMetrics.ToXml(value.HourMetrics, "HourMetrics", ""))
 10453            }
 10454            if (value.MinuteMetrics != null)
 10455            {
 10456                _element.Add(Azure.Storage.Files.Shares.Models.ShareMetrics.ToXml(value.MinuteMetrics, "MinuteMetrics", 
 10457            }
 10458            if (value.Cors != null)
 10459            {
 10460                System.Xml.Linq.XElement _elements = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get("Cors", ""))
 10461                foreach (Azure.Storage.Files.Shares.Models.ShareCorsRule _child in value.Cors)
 10462                {
 10463                    _elements.Add(Azure.Storage.Files.Shares.Models.ShareCorsRule.ToXml(_child));
 10464                }
 10465                _element.Add(_elements);
 10466            }
 10467            return _element;
 10468        }
 10469
 10470        /// <summary>
 10471        /// Deserializes XML into a new ShareServiceProperties instance.
 10472        /// </summary>
 10473        /// <param name="element">The XML element to deserialize.</param>
 10474        /// <returns>A deserialized ShareServiceProperties instance.</returns>
 10475        internal static Azure.Storage.Files.Shares.Models.ShareServiceProperties FromXml(System.Xml.Linq.XElement elemen
 10476        {
 10477            System.Diagnostics.Debug.Assert(element != null);
 10478            System.Xml.Linq.XElement _child;
 10479            Azure.Storage.Files.Shares.Models.ShareServiceProperties _value = new Azure.Storage.Files.Shares.Models.Shar
 10480            _child = element.Element(System.Xml.Linq.XName.Get("HourMetrics", ""));
 10481            if (_child != null)
 10482            {
 10483                _value.HourMetrics = Azure.Storage.Files.Shares.Models.ShareMetrics.FromXml(_child);
 10484            }
 10485            _child = element.Element(System.Xml.Linq.XName.Get("MinuteMetrics", ""));
 10486            if (_child != null)
 10487            {
 10488                _value.MinuteMetrics = Azure.Storage.Files.Shares.Models.ShareMetrics.FromXml(_child);
 10489            }
 10490            _child = element.Element(System.Xml.Linq.XName.Get("Cors", ""));
 10491            if (_child != null)
 10492            {
 10493                _value.Cors = System.Linq.Enumerable.ToList(
 10494                    System.Linq.Enumerable.Select(
 10495                        _child.Elements(System.Xml.Linq.XName.Get("CorsRule", "")),
 10496                        e => Azure.Storage.Files.Shares.Models.ShareCorsRule.FromXml(e)));
 10497            }
 10498            else
 10499            {
 10500                _value.Cors = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.ShareCorsRule>();
 10501            }
 10502            CustomizeFromXml(element, _value);
 10503            return _value;
 10504        }
 10505
 10506        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareSe
 10507    }
 10508}
 10509#endregion class ShareServiceProperties
 10510
 10511#region class ShareSignedIdentifier
 10512namespace Azure.Storage.Files.Shares.Models
 10513{
 10514    /// <summary>
 10515    /// Signed identifier.
 10516    /// </summary>
 10517    public partial class ShareSignedIdentifier
 10518    {
 10519        /// <summary>
 10520        /// A unique id.
 10521        /// </summary>
 10522        public string Id { get; set; }
 10523
 10524        /// <summary>
 10525        /// The access policy.
 10526        /// </summary>
 10527        public Azure.Storage.Files.Shares.Models.ShareAccessPolicy AccessPolicy { get; set; }
 10528
 10529        /// <summary>
 10530        /// Creates a new ShareSignedIdentifier instance
 10531        /// </summary>
 10532        public ShareSignedIdentifier()
 10533            : this(false)
 10534        {
 10535        }
 10536
 10537        /// <summary>
 10538        /// Creates a new ShareSignedIdentifier instance
 10539        /// </summary>
 10540        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 10541        internal ShareSignedIdentifier(bool skipInitialization)
 10542        {
 10543            if (!skipInitialization)
 10544            {
 10545                AccessPolicy = new Azure.Storage.Files.Shares.Models.ShareAccessPolicy();
 10546            }
 10547        }
 10548
 10549        /// <summary>
 10550        /// Serialize a ShareSignedIdentifier instance as XML.
 10551        /// </summary>
 10552        /// <param name="value">The ShareSignedIdentifier instance to serialize.</param>
 10553        /// <param name="name">An optional name to use for the root element instead of "SignedIdentifier".</param>
 10554        /// <param name="ns">An optional namespace to use for the root element instead of "".</param>
 10555        /// <returns>The serialized XML element.</returns>
 10556        internal static System.Xml.Linq.XElement ToXml(Azure.Storage.Files.Shares.Models.ShareSignedIdentifier value, st
 10557        {
 10558            System.Diagnostics.Debug.Assert(value != null);
 10559            System.Xml.Linq.XElement _element = new System.Xml.Linq.XElement(System.Xml.Linq.XName.Get(name, ns));
 10560            _element.Add(new System.Xml.Linq.XElement(
 10561                System.Xml.Linq.XName.Get("Id", ""),
 10562                value.Id));
 10563            if (value.AccessPolicy != null)
 10564            {
 10565                _element.Add(Azure.Storage.Files.Shares.Models.ShareAccessPolicy.ToXml(value.AccessPolicy, "AccessPolicy
 10566            }
 10567            return _element;
 10568        }
 10569
 10570        /// <summary>
 10571        /// Deserializes XML into a new ShareSignedIdentifier instance.
 10572        /// </summary>
 10573        /// <param name="element">The XML element to deserialize.</param>
 10574        /// <returns>A deserialized ShareSignedIdentifier instance.</returns>
 10575        internal static Azure.Storage.Files.Shares.Models.ShareSignedIdentifier FromXml(System.Xml.Linq.XElement element
 10576        {
 10577            System.Diagnostics.Debug.Assert(element != null);
 10578            System.Xml.Linq.XElement _child;
 10579            Azure.Storage.Files.Shares.Models.ShareSignedIdentifier _value = new Azure.Storage.Files.Shares.Models.Share
 10580            _child = element.Element(System.Xml.Linq.XName.Get("Id", ""));
 10581            if (_child != null)
 10582            {
 10583                _value.Id = _child.Value;
 10584            }
 10585            _child = element.Element(System.Xml.Linq.XName.Get("AccessPolicy", ""));
 10586            if (_child != null)
 10587            {
 10588                _value.AccessPolicy = Azure.Storage.Files.Shares.Models.ShareAccessPolicy.FromXml(_child);
 10589            }
 10590            CustomizeFromXml(element, _value);
 10591            return _value;
 10592        }
 10593
 10594        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareSi
 10595    }
 10596}
 10597#endregion class ShareSignedIdentifier
 10598
 10599#region class ShareSnapshotInfo
 10600namespace Azure.Storage.Files.Shares.Models
 10601{
 10602    /// <summary>
 10603    /// ShareSnapshotInfo
 10604    /// </summary>
 10605    public partial class ShareSnapshotInfo
 10606    {
 10607        /// <summary>
 10608        /// This header is a DateTime value that uniquely identifies the share snapshot. The value of this header may be
 10609        /// </summary>
 10610        public string Snapshot { get; internal set; }
 10611
 10612        /// <summary>
 10613        /// The ETag contains a value which represents the version of the share snapshot, in quotes. A share snapshot ca
 10614        /// </summary>
 10615        public Azure.ETag ETag { get; internal set; }
 10616
 10617        /// <summary>
 10618        /// Returns the date and time the share was last modified. A share snapshot cannot be modified, so the last modi
 10619        /// </summary>
 10620        public System.DateTimeOffset LastModified { get; internal set; }
 10621
 10622        /// <summary>
 10623        /// Prevent direct instantiation of ShareSnapshotInfo instances.
 10624        /// You can use ShareModelFactory.ShareSnapshotInfo instead.
 10625        /// </summary>
 10626        internal ShareSnapshotInfo() { }
 10627    }
 10628
 10629    /// <summary>
 10630    /// ShareModelFactory provides utilities for mocking.
 10631    /// </summary>
 10632    public static partial class ShareModelFactory
 10633    {
 10634        /// <summary>
 10635        /// Creates a new ShareSnapshotInfo instance for mocking.
 10636        /// </summary>
 10637        public static ShareSnapshotInfo ShareSnapshotInfo(
 10638            string snapshot,
 10639            Azure.ETag eTag,
 10640            System.DateTimeOffset lastModified)
 10641        {
 10642            return new ShareSnapshotInfo()
 10643            {
 10644                Snapshot = snapshot,
 10645                ETag = eTag,
 10646                LastModified = lastModified,
 10647            };
 10648        }
 10649    }
 10650}
 10651#endregion class ShareSnapshotInfo
 10652
 10653#region class ShareStatistics
 10654namespace Azure.Storage.Files.Shares.Models
 10655{
 10656    /// <summary>
 10657    /// Stats for the share.
 10658    /// </summary>
 10659    public partial class ShareStatistics
 10660    {
 10661        /// <summary>
 10662        /// The approximate size of the data stored in bytes, rounded up to the nearest gigabyte. Note that this value m
 10663        /// </summary>
 10664        public long ShareUsageInBytes { get; internal set; }
 10665
 10666        /// <summary>
 10667        /// Prevent direct instantiation of ShareStatistics instances.
 10668        /// You can use ShareModelFactory.ShareStatistics instead.
 10669        /// </summary>
 10670        internal ShareStatistics() { }
 10671
 10672        /// <summary>
 10673        /// Deserializes XML into a new ShareStatistics instance.
 10674        /// </summary>
 10675        /// <param name="element">The XML element to deserialize.</param>
 10676        /// <returns>A deserialized ShareStatistics instance.</returns>
 10677        internal static Azure.Storage.Files.Shares.Models.ShareStatistics FromXml(System.Xml.Linq.XElement element)
 10678        {
 10679            System.Diagnostics.Debug.Assert(element != null);
 10680            System.Xml.Linq.XElement _child;
 10681            Azure.Storage.Files.Shares.Models.ShareStatistics _value = new Azure.Storage.Files.Shares.Models.ShareStatis
 10682            _child = element.Element(System.Xml.Linq.XName.Get("ShareUsageBytes", ""));
 10683            if (_child != null)
 10684            {
 10685                _value.ShareUsageInBytes = long.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 10686            }
 10687            CustomizeFromXml(element, _value);
 10688            return _value;
 10689        }
 10690
 10691        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.ShareSt
 10692    }
 10693
 10694    /// <summary>
 10695    /// ShareModelFactory provides utilities for mocking.
 10696    /// </summary>
 10697    public static partial class ShareModelFactory
 10698    {
 10699        /// <summary>
 10700        /// Creates a new ShareStatistics instance for mocking.
 10701        /// </summary>
 10702        public static ShareStatistics ShareStatistics(
 10703            long shareUsageInBytes)
 10704        {
 10705            return new ShareStatistics()
 10706            {
 10707                ShareUsageInBytes = shareUsageInBytes,
 10708            };
 10709        }
 10710    }
 10711}
 10712#endregion class ShareStatistics
 10713
 10714#region class SharesSegment
 10715namespace Azure.Storage.Files.Shares.Models
 10716{
 10717    /// <summary>
 10718    /// An enumeration of shares.
 10719    /// </summary>
 10720    internal partial class SharesSegment
 10721    {
 10722        /// <summary>
 10723        /// ServiceEndpoint
 10724        /// </summary>
 10725        public string ServiceEndpoint { get; internal set; }
 10726
 10727        /// <summary>
 10728        /// Prefix
 10729        /// </summary>
 10730        public string Prefix { get; internal set; }
 10731
 10732        /// <summary>
 10733        /// Marker
 10734        /// </summary>
 10735        public string Marker { get; internal set; }
 10736
 10737        /// <summary>
 10738        /// MaxResults
 10739        /// </summary>
 10740        public int? MaxResults { get; internal set; }
 10741
 10742        /// <summary>
 10743        /// ShareItems
 10744        /// </summary>
 10745        public System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ShareItem> ShareItems { get; int
 10746
 10747        /// <summary>
 10748        /// NextMarker
 10749        /// </summary>
 10750        public string NextMarker { get; internal set; }
 10751
 10752        /// <summary>
 10753        /// Creates a new SharesSegment instance
 10754        /// </summary>
 10755        public SharesSegment()
 10756            : this(false)
 10757        {
 10758        }
 10759
 10760        /// <summary>
 10761        /// Creates a new SharesSegment instance
 10762        /// </summary>
 10763        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 10764        internal SharesSegment(bool skipInitialization)
 10765        {
 10766            if (!skipInitialization)
 10767            {
 10768                ShareItems = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.ShareItem>();
 10769            }
 10770        }
 10771
 10772        /// <summary>
 10773        /// Deserializes XML into a new SharesSegment instance.
 10774        /// </summary>
 10775        /// <param name="element">The XML element to deserialize.</param>
 10776        /// <returns>A deserialized SharesSegment instance.</returns>
 10777        internal static Azure.Storage.Files.Shares.Models.SharesSegment FromXml(System.Xml.Linq.XElement element)
 10778        {
 10779            System.Diagnostics.Debug.Assert(element != null);
 10780            System.Xml.Linq.XElement _child;
 10781            System.Xml.Linq.XAttribute _attribute;
 10782            Azure.Storage.Files.Shares.Models.SharesSegment _value = new Azure.Storage.Files.Shares.Models.SharesSegment
 10783            _attribute = element.Attribute(System.Xml.Linq.XName.Get("ServiceEndpoint", ""));
 10784            if (_attribute != null)
 10785            {
 10786                _value.ServiceEndpoint = _attribute.Value;
 10787            }
 10788            _child = element.Element(System.Xml.Linq.XName.Get("Prefix", ""));
 10789            if (_child != null)
 10790            {
 10791                _value.Prefix = _child.Value;
 10792            }
 10793            _child = element.Element(System.Xml.Linq.XName.Get("Marker", ""));
 10794            if (_child != null)
 10795            {
 10796                _value.Marker = _child.Value;
 10797            }
 10798            _child = element.Element(System.Xml.Linq.XName.Get("MaxResults", ""));
 10799            if (_child != null)
 10800            {
 10801                _value.MaxResults = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture);
 10802            }
 10803            _child = element.Element(System.Xml.Linq.XName.Get("Shares", ""));
 10804            if (_child != null)
 10805            {
 10806                _value.ShareItems = System.Linq.Enumerable.ToList(
 10807                    System.Linq.Enumerable.Select(
 10808                        _child.Elements(System.Xml.Linq.XName.Get("Share", "")),
 10809                        e => Azure.Storage.Files.Shares.Models.ShareItem.FromXml(e)));
 10810            }
 10811            else
 10812            {
 10813                _value.ShareItems = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.ShareItem>();
 10814            }
 10815            _child = element.Element(System.Xml.Linq.XName.Get("NextMarker", ""));
 10816            if (_child != null)
 10817            {
 10818                _value.NextMarker = _child.Value;
 10819            }
 10820            CustomizeFromXml(element, _value);
 10821            return _value;
 10822        }
 10823
 10824        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.SharesS
 10825    }
 10826}
 10827#endregion class SharesSegment
 10828
 10829#region class StorageClosedHandlesSegment
 10830namespace Azure.Storage.Files.Shares.Models
 10831{
 10832    /// <summary>
 10833    /// StorageClosedHandlesSegment
 10834    /// </summary>
 10835    public partial class StorageClosedHandlesSegment
 10836    {
 10837        /// <summary>
 10838        /// A string describing next handle to be closed. It is returned when more handles need to be closed to complete
 10839        /// </summary>
 10840        public string Marker { get; internal set; }
 10841
 10842        /// <summary>
 10843        /// Contains count of number of handles closed.
 10844        /// </summary>
 10845        public int NumberOfHandlesClosed { get; internal set; }
 10846
 10847        /// <summary>
 10848        /// Contains count of number of handles that failed to close.
 10849        /// </summary>
 10850        public int NumberOfHandlesFailedToClose { get; internal set; }
 10851
 10852        /// <summary>
 10853        /// Prevent direct instantiation of StorageClosedHandlesSegment instances.
 10854        /// You can use ShareModelFactory.StorageClosedHandlesSegment instead.
 10855        /// </summary>
 10856        internal StorageClosedHandlesSegment() { }
 10857    }
 10858
 10859    /// <summary>
 10860    /// ShareModelFactory provides utilities for mocking.
 10861    /// </summary>
 10862    public static partial class ShareModelFactory
 10863    {
 10864        /// <summary>
 10865        /// Creates a new StorageClosedHandlesSegment instance for mocking.
 10866        /// </summary>
 10867        public static StorageClosedHandlesSegment StorageClosedHandlesSegment(
 10868            string marker,
 10869            int numberOfHandlesClosed,
 10870            int numberOfHandlesFailedToClose)
 10871        {
 10872            return new StorageClosedHandlesSegment()
 10873            {
 10874                Marker = marker,
 10875                NumberOfHandlesClosed = numberOfHandlesClosed,
 10876                NumberOfHandlesFailedToClose = numberOfHandlesFailedToClose,
 10877            };
 10878        }
 10879    }
 10880}
 10881#endregion class StorageClosedHandlesSegment
 10882
 10883#region class StorageError
 10884namespace Azure.Storage.Files.Shares.Models
 10885{
 10886    /// <summary>
 10887    /// StorageError
 10888    /// </summary>
 10889    internal partial class StorageError
 10890    {
 10891        /// <summary>
 10892        /// Message
 10893        /// </summary>
 10894        public string Message { get; internal set; }
 10895
 10896        /// <summary>
 10897        /// Code
 10898        /// </summary>
 10899        public string Code { get; internal set; }
 10900
 10901        /// <summary>
 10902        /// Prevent direct instantiation of StorageError instances.
 10903        /// You can use ShareModelFactory.StorageError instead.
 10904        /// </summary>
 10905        internal StorageError() { }
 10906
 10907        /// <summary>
 10908        /// Deserializes XML into a new StorageError instance.
 10909        /// </summary>
 10910        /// <param name="element">The XML element to deserialize.</param>
 10911        /// <returns>A deserialized StorageError instance.</returns>
 10912        internal static Azure.Storage.Files.Shares.Models.StorageError FromXml(System.Xml.Linq.XElement element)
 10913        {
 10914            System.Diagnostics.Debug.Assert(element != null);
 10915            System.Xml.Linq.XElement _child;
 10916            Azure.Storage.Files.Shares.Models.StorageError _value = new Azure.Storage.Files.Shares.Models.StorageError()
 10917            _child = element.Element(System.Xml.Linq.XName.Get("Message", ""));
 10918            if (_child != null)
 10919            {
 10920                _value.Message = _child.Value;
 10921            }
 10922            _child = element.Element(System.Xml.Linq.XName.Get("Code", ""));
 10923            if (_child != null)
 10924            {
 10925                _value.Code = _child.Value;
 10926            }
 10927            CustomizeFromXml(element, _value);
 10928            return _value;
 10929        }
 10930
 10931        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.Storage
 10932    }
 10933}
 10934#endregion class StorageError
 10935
 10936#region class StorageHandlesSegment
 10937namespace Azure.Storage.Files.Shares.Models
 10938{
 10939    /// <summary>
 10940    /// An enumeration of handles.
 10941    /// </summary>
 10942    internal partial class StorageHandlesSegment
 10943    {
 10944        /// <summary>
 10945        /// NextMarker
 10946        /// </summary>
 10947        public string NextMarker { get; internal set; }
 10948
 10949        /// <summary>
 10950        /// Handles
 10951        /// </summary>
 10952        public System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ShareFileHandle> Handles { get; 
 10953
 10954        /// <summary>
 10955        /// Creates a new StorageHandlesSegment instance
 10956        /// </summary>
 10957        public StorageHandlesSegment()
 10958            : this(false)
 10959        {
 10960        }
 10961
 10962        /// <summary>
 10963        /// Creates a new StorageHandlesSegment instance
 10964        /// </summary>
 10965        /// <param name="skipInitialization">Whether to skip initializing nested objects.</param>
 10966        internal StorageHandlesSegment(bool skipInitialization)
 10967        {
 10968            if (!skipInitialization)
 10969            {
 10970                Handles = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.ShareFileHandle>();
 10971            }
 10972        }
 10973
 10974        /// <summary>
 10975        /// Deserializes XML into a new StorageHandlesSegment instance.
 10976        /// </summary>
 10977        /// <param name="element">The XML element to deserialize.</param>
 10978        /// <returns>A deserialized StorageHandlesSegment instance.</returns>
 10979        internal static Azure.Storage.Files.Shares.Models.StorageHandlesSegment FromXml(System.Xml.Linq.XElement element
 10980        {
 10981            System.Diagnostics.Debug.Assert(element != null);
 10982            System.Xml.Linq.XElement _child;
 10983            Azure.Storage.Files.Shares.Models.StorageHandlesSegment _value = new Azure.Storage.Files.Shares.Models.Stora
 10984            _child = element.Element(System.Xml.Linq.XName.Get("NextMarker", ""));
 10985            if (_child != null)
 10986            {
 10987                _value.NextMarker = _child.Value;
 10988            }
 10989            _child = element.Element(System.Xml.Linq.XName.Get("Entries", ""));
 10990            if (_child != null)
 10991            {
 10992                _value.Handles = System.Linq.Enumerable.ToList(
 10993                    System.Linq.Enumerable.Select(
 10994                        _child.Elements(System.Xml.Linq.XName.Get("Handle", "")),
 10995                        e => Azure.Storage.Files.Shares.Models.ShareFileHandle.FromXml(e)));
 10996            }
 10997            else
 10998            {
 10999                _value.Handles = new System.Collections.Generic.List<Azure.Storage.Files.Shares.Models.ShareFileHandle>(
 11000            }
 11001            CustomizeFromXml(element, _value);
 11002            return _value;
 11003        }
 11004
 11005        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Files.Shares.Models.Storage
 11006    }
 11007}
 11008#endregion class StorageHandlesSegment
 11009#endregion Models
 11010

Methods/Properties

SetPropertiesAsync()
SetPropertiesAsync_CreateMessage(...)
SetPropertiesAsync_CreateResponse(...)
GetPropertiesAsync()
GetPropertiesAsync_CreateMessage(...)
GetPropertiesAsync_CreateResponse(...)
ListSharesSegmentAsync()
ListSharesSegmentAsync_CreateMessage(...)
ListSharesSegmentAsync_CreateResponse(...)
CreateAsync()
CreateAsync_CreateMessage(...)
CreateAsync_CreateResponse(...)
GetPropertiesAsync()
GetPropertiesAsync_CreateMessage(...)
GetPropertiesAsync_CreateResponse(...)
DeleteAsync()
DeleteAsync_CreateMessage(...)
DeleteAsync_CreateResponse(...)
CreateSnapshotAsync()
CreateSnapshotAsync_CreateMessage(...)
CreateSnapshotAsync_CreateResponse(...)
CreatePermissionAsync()
CreatePermissionAsync_CreateMessage(...)
CreatePermissionAsync_CreateResponse(...)
GetPermissionAsync()
GetPermissionAsync_CreateMessage(...)
GetPermissionAsync_CreateResponse(...)
SetQuotaAsync()
SetQuotaAsync_CreateMessage(...)
SetQuotaAsync_CreateResponse(...)
SetMetadataAsync()
SetMetadataAsync_CreateMessage(...)
SetMetadataAsync_CreateResponse(...)
GetAccessPolicyAsync()
GetAccessPolicyAsync_CreateMessage(...)
GetAccessPolicyAsync_CreateResponse(...)
SetAccessPolicyAsync()
SetAccessPolicyAsync_CreateMessage(...)
SetAccessPolicyAsync_CreateResponse(...)
GetStatisticsAsync()
GetStatisticsAsync_CreateMessage(...)
GetStatisticsAsync_CreateResponse(...)
RestoreAsync()
RestoreAsync_CreateMessage(...)
RestoreAsync_CreateResponse(...)
CreateAsync()
CreateAsync_CreateMessage(...)
CreateAsync_CreateResponse(...)
GetPropertiesAsync()
GetPropertiesAsync_CreateMessage(...)
GetPropertiesAsync_CreateResponse(...)
DeleteAsync()
DeleteAsync_CreateMessage(...)
DeleteAsync_CreateResponse(...)
SetPropertiesAsync()
SetPropertiesAsync_CreateMessage(...)
SetPropertiesAsync_CreateResponse(...)
SetMetadataAsync()
SetMetadataAsync_CreateMessage(...)
SetMetadataAsync_CreateResponse(...)
ListFilesAndDirectoriesSegmentAsync()
ListFilesAndDirectoriesSegmentAsync_CreateMessage(...)
ListFilesAndDirectoriesSegmentAsync_CreateResponse(...)
ListHandlesAsync()
ListHandlesAsync_CreateMessage(...)
ListHandlesAsync_CreateResponse(...)
ForceCloseHandlesAsync()
ForceCloseHandlesAsync_CreateMessage(...)
ForceCloseHandlesAsync_CreateResponse(...)
CreateAsync()
CreateAsync_CreateMessage(...)
CreateAsync_CreateResponse(...)
DownloadAsync()
DownloadAsync_CreateMessage(...)
DownloadAsync_CreateResponse(...)
GetPropertiesAsync()
GetPropertiesAsync_CreateMessage(...)
GetPropertiesAsync_CreateResponse(...)
DeleteAsync()
DeleteAsync_CreateMessage(...)
DeleteAsync_CreateResponse(...)
SetPropertiesAsync()
SetPropertiesAsync_CreateMessage(...)
SetPropertiesAsync_CreateResponse(...)
SetMetadataAsync()
SetMetadataAsync_CreateMessage(...)
SetMetadataAsync_CreateResponse(...)
AcquireLeaseAsync()
AcquireLeaseAsync_CreateMessage(...)
AcquireLeaseAsync_CreateResponse(...)
ReleaseLeaseAsync()
ReleaseLeaseAsync_CreateMessage(...)
ReleaseLeaseAsync_CreateResponse(...)
ChangeLeaseAsync()
ChangeLeaseAsync_CreateMessage(...)
ChangeLeaseAsync_CreateResponse(...)
BreakLeaseAsync()
BreakLeaseAsync_CreateMessage(...)
BreakLeaseAsync_CreateResponse(...)
UploadRangeAsync()
UploadRangeAsync_CreateMessage(...)
UploadRangeAsync_CreateResponse(...)
UploadRangeFromURLAsync()
UploadRangeFromURLAsync_CreateMessage(...)
UploadRangeFromURLAsync_CreateResponse(...)
GetRangeListAsync()
GetRangeListAsync_CreateMessage(...)
GetRangeListAsync_CreateResponse(...)
StartCopyAsync()
StartCopyAsync_CreateMessage(...)
StartCopyAsync_CreateResponse(...)
AbortCopyAsync()
AbortCopyAsync_CreateMessage(...)
AbortCopyAsync_CreateResponse(...)
ListHandlesAsync()
ListHandlesAsync_CreateMessage(...)
ListHandlesAsync_CreateResponse(...)
ForceCloseHandlesAsync()
ForceCloseHandlesAsync_CreateMessage(...)
ForceCloseHandlesAsync_CreateResponse(...)
ToString(...)
ParseCopyStatus(...)
ToString(...)
ParseDeleteSnapshotsOptionType(...)
ToString(...)
ParseListSharesIncludeType(...)
ToString(...)
ParsePermissionCopyMode(...)
ToString(...)
ParseShareFileRangeWriteType(...)
ToString(...)
ParseShareLeaseDuration(...)
ToString(...)
ParseShareLeaseState(...)
ToString(...)
ParseShareLeaseStatus(...)