diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/IStorageSyncManagementClient.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/IStorageSyncManagementClient.cs index f812f6583e9d..217984bdb9b5 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/IStorageSyncManagementClient.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/IStorageSyncManagementClient.cs @@ -14,6 +14,10 @@ namespace Microsoft.Azure.Management.StorageSync using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// Microsoft Storage Sync Service API @@ -119,5 +123,22 @@ public partial interface IStorageSyncManagementClient : System.IDisposable /// IOperationStatusOperations OperationStatus { get; } + /// + /// Get Operation status + /// + /// + /// The desired region to obtain information from. + /// + /// + /// operation Id + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> LocationOperationStatusMethodWithHttpMessagesAsync(string locationName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } } diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/AzureEntityResource.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/AzureEntityResource.cs index c90cf262e434..83f29f138b0e 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/AzureEntityResource.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/AzureEntityResource.cs @@ -39,9 +39,11 @@ public AzureEntityResource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Resource Etag. - public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id, name, type) + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string)) + : base(id, name, type, systemData) { Etag = etag; CustomInit(); diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpoint.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpoint.cs index 435180cdd204..a682c5228a30 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpoint.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpoint.cs @@ -38,6 +38,8 @@ public CloudEndpoint() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Storage Account Resource /// Id /// Azure file share name @@ -53,8 +55,8 @@ public CloudEndpoint() /// Name /// Cloud endpoint change /// enumeration status - public CloudEndpoint(string id = default(string), string name = default(string), string type = default(string), string storageAccountResourceId = default(string), string azureFileShareName = default(string), string storageAccountTenantId = default(string), string partnershipId = default(string), string friendlyName = default(string), string backupEnabled = default(string), string provisioningState = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), CloudEndpointChangeEnumerationStatus changeEnumerationStatus = default(CloudEndpointChangeEnumerationStatus)) - : base(id, name, type) + public CloudEndpoint(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string storageAccountResourceId = default(string), string azureFileShareName = default(string), string storageAccountTenantId = default(string), string partnershipId = default(string), string friendlyName = default(string), string backupEnabled = default(string), string provisioningState = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), CloudEndpointChangeEnumerationStatus changeEnumerationStatus = default(CloudEndpointChangeEnumerationStatus)) + : base(id, name, type, systemData) { StorageAccountResourceId = storageAccountResourceId; AzureFileShareName = azureFileShareName; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpointCreateParameters.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpointCreateParameters.cs index b907bf12a0ad..5dff43b1b0f1 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpointCreateParameters.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CloudEndpointCreateParameters.cs @@ -40,14 +40,16 @@ public CloudEndpointCreateParameters() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Storage Account Resource /// Id /// Azure file share name /// Storage Account Tenant /// Id /// Friendly Name - public CloudEndpointCreateParameters(string id = default(string), string name = default(string), string type = default(string), string storageAccountResourceId = default(string), string azureFileShareName = default(string), string storageAccountTenantId = default(string), string friendlyName = default(string)) - : base(id, name, type) + public CloudEndpointCreateParameters(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string storageAccountResourceId = default(string), string azureFileShareName = default(string), string storageAccountTenantId = default(string), string friendlyName = default(string)) + : base(id, name, type, systemData) { StorageAccountResourceId = storageAccountResourceId; AzureFileShareName = azureFileShareName; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CreatedByType.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..5a85b822b05c --- /dev/null +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StorageSync.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/LocationOperationStatus.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/LocationOperationStatus.cs new file mode 100644 index 000000000000..ad04e22012b0 --- /dev/null +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/LocationOperationStatus.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StorageSync.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation status object + /// + public partial class LocationOperationStatus + { + /// + /// Initializes a new instance of the LocationOperationStatus class. + /// + public LocationOperationStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LocationOperationStatus class. + /// + /// Operation resource Id + /// Operation Id + /// Operation status + /// Start time of the operation + /// End time of the operation + /// Error details. + /// Percent complete. + public LocationOperationStatus(string id = default(string), string name = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), StorageSyncApiError error = default(StorageSyncApiError), int? percentComplete = default(int?)) + { + Id = id; + Name = name; + Status = status; + StartTime = startTime; + EndTime = endTime; + Error = error; + PercentComplete = percentComplete; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets operation Id + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets operation status + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Gets start time of the operation + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; private set; } + + /// + /// Gets end time of the operation + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; private set; } + + /// + /// Gets error details. + /// + [JsonProperty(PropertyName = "error")] + public StorageSyncApiError Error { get; private set; } + + /// + /// Gets percent complete. + /// + [JsonProperty(PropertyName = "percentComplete")] + public int? PercentComplete { get; private set; } + + } +} diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/LocationOperationStatusHeaders.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/LocationOperationStatusHeaders.cs new file mode 100644 index 000000000000..51fc360dd9f6 --- /dev/null +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/LocationOperationStatusHeaders.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StorageSync.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for LocationOperationStatus operation. + /// + public partial class LocationOperationStatusHeaders + { + /// + /// Initializes a new instance of the LocationOperationStatusHeaders + /// class. + /// + public LocationOperationStatusHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LocationOperationStatusHeaders + /// class. + /// + /// request id. + /// correlation request + /// id. + public LocationOperationStatusHeaders(string xMsRequestId = default(string), string xMsCorrelationRequestId = default(string)) + { + XMsRequestId = xMsRequestId; + XMsCorrelationRequestId = xMsCorrelationRequestId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets request id. + /// + [JsonProperty(PropertyName = "x-ms-request-id")] + public string XMsRequestId { get; set; } + + /// + /// Gets or sets correlation request id. + /// + [JsonProperty(PropertyName = "x-ms-correlation-request-id")] + public string XMsCorrelationRequestId { get; set; } + + } +} diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/OperationResourceMetricSpecification.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/OperationResourceMetricSpecification.cs index 740399d9a015..f9b6ff79b668 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/OperationResourceMetricSpecification.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/OperationResourceMetricSpecification.cs @@ -40,17 +40,20 @@ public OperationResourceMetricSpecification() /// Unit for the metric. /// Aggregation type for the /// metric. + /// Supported aggregation types + /// for the metric. /// Fill gaps in the metric with /// zero. /// Dimensions for the metric /// specification. - public OperationResourceMetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string aggregationType = default(string), bool? fillGapWithZero = default(bool?), IList dimensions = default(IList)) + public OperationResourceMetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string aggregationType = default(string), IList supportedAggregationTypes = default(IList), bool? fillGapWithZero = default(bool?), IList dimensions = default(IList)) { Name = name; DisplayName = displayName; DisplayDescription = displayDescription; Unit = unit; AggregationType = aggregationType; + SupportedAggregationTypes = supportedAggregationTypes; FillGapWithZero = fillGapWithZero; Dimensions = dimensions; CustomInit(); @@ -91,6 +94,12 @@ public OperationResourceMetricSpecification() [JsonProperty(PropertyName = "aggregationType")] public string AggregationType { get; set; } + /// + /// Gets or sets supported aggregation types for the metric. + /// + [JsonProperty(PropertyName = "supportedAggregationTypes")] + public IList SupportedAggregationTypes { get; set; } + /// /// Gets or sets fill gaps in the metric with zero. /// diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateEndpointConnection.cs index cad7829b7346..244bba20db6c 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateEndpointConnection.cs @@ -41,13 +41,15 @@ public PrivateEndpointConnection() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// The resource of private end /// point. /// The provisioning state of the /// private endpoint connection resource. Possible values include: /// 'Succeeded', 'Creating', 'Deleting', 'Failed' - public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string)) - : base(id, name, type) + public PrivateEndpointConnection(PrivateLinkServiceConnectionState privateLinkServiceConnectionState, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), string provisioningState = default(string)) + : base(id, name, type, systemData) { PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateLinkResource.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateLinkResource.cs index a0ae8265eafa..e763cd6dfe60 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateLinkResource.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/PrivateLinkResource.cs @@ -40,13 +40,15 @@ public PrivateLinkResource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// The private link resource group id. /// The private link resource required /// member names. /// The private link resource Private /// link DNS zone name. - public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) - : base(id, name, type) + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string groupId = default(string), IList requiredMembers = default(IList), IList requiredZoneNames = default(IList)) + : base(id, name, type, systemData) { GroupId = groupId; RequiredMembers = requiredMembers; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ProxyResource.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ProxyResource.cs index 6e334e048b6d..ef777aeb54c3 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ProxyResource.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ProxyResource.cs @@ -38,8 +38,10 @@ public ProxyResource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" - public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, systemData) { CustomInit(); } diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServer.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServer.cs index 5b51d38d076d..5582738e2f31 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServer.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServer.cs @@ -38,6 +38,8 @@ public RegisteredServer() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Registered Server /// Certificate /// Registered Server Agent Version @@ -73,8 +75,8 @@ public RegisteredServer() /// Monitoring /// Configuration /// Server name - public RegisteredServer(string id = default(string), string name = default(string), string type = default(string), string serverCertificate = default(string), string agentVersion = default(string), string agentVersionStatus = default(string), System.DateTime? agentVersionExpirationDate = default(System.DateTime?), string serverOSVersion = default(string), int? serverManagementErrorCode = default(int?), string lastHeartBeat = default(string), string provisioningState = default(string), string serverRole = default(string), string clusterId = default(string), string clusterName = default(string), string serverId = default(string), string storageSyncServiceUid = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), string discoveryEndpointUri = default(string), string resourceLocation = default(string), string serviceLocation = default(string), string friendlyName = default(string), string managementEndpointUri = default(string), string monitoringEndpointUri = default(string), string monitoringConfiguration = default(string), string serverName = default(string)) - : base(id, name, type) + public RegisteredServer(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string serverCertificate = default(string), string agentVersion = default(string), string agentVersionStatus = default(string), System.DateTime? agentVersionExpirationDate = default(System.DateTime?), string serverOSVersion = default(string), int? serverManagementErrorCode = default(int?), string lastHeartBeat = default(string), string provisioningState = default(string), string serverRole = default(string), string clusterId = default(string), string clusterName = default(string), string serverId = default(string), string storageSyncServiceUid = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), string discoveryEndpointUri = default(string), string resourceLocation = default(string), string serviceLocation = default(string), string friendlyName = default(string), string managementEndpointUri = default(string), string monitoringEndpointUri = default(string), string monitoringConfiguration = default(string), string serverName = default(string)) + : base(id, name, type, systemData) { ServerCertificate = serverCertificate; AgentVersion = agentVersion; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServerCreateParameters.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServerCreateParameters.cs index b1839dd2600a..f46895cf17a8 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServerCreateParameters.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/RegisteredServerCreateParameters.cs @@ -40,6 +40,8 @@ public RegisteredServerCreateParameters() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Registered Server /// Certificate /// Registered Server Agent Version @@ -51,8 +53,8 @@ public RegisteredServerCreateParameters() /// Registered Server clusterName /// Registered Server serverId /// Friendly Name - public RegisteredServerCreateParameters(string id = default(string), string name = default(string), string type = default(string), string serverCertificate = default(string), string agentVersion = default(string), string serverOSVersion = default(string), string lastHeartBeat = default(string), string serverRole = default(string), string clusterId = default(string), string clusterName = default(string), string serverId = default(string), string friendlyName = default(string)) - : base(id, name, type) + public RegisteredServerCreateParameters(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string serverCertificate = default(string), string agentVersion = default(string), string serverOSVersion = default(string), string lastHeartBeat = default(string), string serverRole = default(string), string clusterId = default(string), string clusterName = default(string), string serverId = default(string), string friendlyName = default(string)) + : base(id, name, type, systemData) { ServerCertificate = serverCertificate; AgentVersion = agentVersion; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Resource.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Resource.cs index 4bedb103c39a..aec8e5d8a3fe 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Resource.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Resource.cs @@ -41,11 +41,14 @@ public Resource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" - public Resource(string id = default(string), string name = default(string), string type = default(string)) + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) { Id = id; Name = name; Type = type; + SystemData = systemData; CustomInit(); } @@ -75,5 +78,12 @@ public Resource() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpoint.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpoint.cs index 58dd999f5ddb..dff72c0a406b 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpoint.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpoint.cs @@ -38,6 +38,8 @@ public ServerEndpoint() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Server Local path. /// Cloud Tiering. Possible values include: /// 'on', 'off' @@ -77,8 +79,8 @@ public ServerEndpoint() /// sync session is performed. Possible values include: /// 'ServerAuthoritative', 'Merge' /// Server name - public ServerEndpoint(string id = default(string), string name = default(string), string type = default(string), string serverLocalPath = default(string), string cloudTiering = default(string), int? volumeFreeSpacePercent = default(int?), int? tierFilesOlderThanDays = default(int?), string friendlyName = default(string), string serverResourceId = default(string), string provisioningState = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), ServerEndpointSyncStatus syncStatus = default(ServerEndpointSyncStatus), string offlineDataTransfer = default(string), string offlineDataTransferStorageAccountResourceId = default(string), string offlineDataTransferStorageAccountTenantId = default(string), string offlineDataTransferShareName = default(string), ServerEndpointCloudTieringStatus cloudTieringStatus = default(ServerEndpointCloudTieringStatus), ServerEndpointRecallStatus recallStatus = default(ServerEndpointRecallStatus), string initialDownloadPolicy = default(string), string localCacheMode = default(string), string initialUploadPolicy = default(string), string serverName = default(string)) - : base(id, name, type) + public ServerEndpoint(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string serverLocalPath = default(string), string cloudTiering = default(string), int? volumeFreeSpacePercent = default(int?), int? tierFilesOlderThanDays = default(int?), string friendlyName = default(string), string serverResourceId = default(string), string provisioningState = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), ServerEndpointSyncStatus syncStatus = default(ServerEndpointSyncStatus), string offlineDataTransfer = default(string), string offlineDataTransferStorageAccountResourceId = default(string), string offlineDataTransferStorageAccountTenantId = default(string), string offlineDataTransferShareName = default(string), ServerEndpointCloudTieringStatus cloudTieringStatus = default(ServerEndpointCloudTieringStatus), ServerEndpointRecallStatus recallStatus = default(ServerEndpointRecallStatus), string initialDownloadPolicy = default(string), string localCacheMode = default(string), string initialUploadPolicy = default(string), string serverName = default(string)) + : base(id, name, type, systemData) { ServerLocalPath = serverLocalPath; CloudTiering = cloudTiering; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpointCreateParameters.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpointCreateParameters.cs index 7d81569a61e6..4bc3ea926b5f 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpointCreateParameters.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/ServerEndpointCreateParameters.cs @@ -40,6 +40,8 @@ public ServerEndpointCreateParameters() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Server Local path. /// Cloud Tiering. Possible values include: /// 'on', 'off' @@ -64,8 +66,8 @@ public ServerEndpointCreateParameters() /// Policy for how the initial upload /// sync session is performed. Possible values include: /// 'ServerAuthoritative', 'Merge' - public ServerEndpointCreateParameters(string id = default(string), string name = default(string), string type = default(string), string serverLocalPath = default(string), string cloudTiering = default(string), int? volumeFreeSpacePercent = default(int?), int? tierFilesOlderThanDays = default(int?), string friendlyName = default(string), string serverResourceId = default(string), string offlineDataTransfer = default(string), string offlineDataTransferShareName = default(string), string initialDownloadPolicy = default(string), string localCacheMode = default(string), string initialUploadPolicy = default(string)) - : base(id, name, type) + public ServerEndpointCreateParameters(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string serverLocalPath = default(string), string cloudTiering = default(string), int? volumeFreeSpacePercent = default(int?), int? tierFilesOlderThanDays = default(int?), string friendlyName = default(string), string serverResourceId = default(string), string offlineDataTransfer = default(string), string offlineDataTransferShareName = default(string), string initialDownloadPolicy = default(string), string localCacheMode = default(string), string initialUploadPolicy = default(string)) + : base(id, name, type, systemData) { ServerLocalPath = serverLocalPath; CloudTiering = cloudTiering; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncApiError.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncApiError.cs index 7b42581b4ed7..f47432c2c759 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncApiError.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncApiError.cs @@ -33,15 +33,15 @@ public StorageSyncApiError() /// Error message of the given entry. /// Target of the given error entry. /// Error details of the given entry. - /// Inner error details of the given + /// Inner error details of the given /// entry. - public StorageSyncApiError(string code = default(string), string message = default(string), string target = default(string), StorageSyncErrorDetails details = default(StorageSyncErrorDetails), StorageSyncInnerErrorDetails innerError = default(StorageSyncInnerErrorDetails)) + public StorageSyncApiError(string code = default(string), string message = default(string), string target = default(string), StorageSyncErrorDetails details = default(StorageSyncErrorDetails), StorageSyncInnerErrorDetails innererror = default(StorageSyncInnerErrorDetails)) { Code = code; Message = message; Target = target; Details = details; - InnerError = innerError; + Innererror = innererror; CustomInit(); } @@ -77,8 +77,8 @@ public StorageSyncApiError() /// /// Gets or sets inner error details of the given entry. /// - [JsonProperty(PropertyName = "innerError")] - public StorageSyncInnerErrorDetails InnerError { get; set; } + [JsonProperty(PropertyName = "innererror")] + public StorageSyncInnerErrorDetails Innererror { get; set; } } } diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncService.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncService.cs index e2d5b2242a2f..e826ab6974f0 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncService.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/StorageSyncService.cs @@ -42,6 +42,8 @@ public StorageSyncService() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Resource tags. /// Incoming Traffic Policy. /// Possible values include: 'AllowAllTraffic', @@ -59,8 +61,8 @@ public StorageSyncService() /// List of private endpoint /// connection associated with the specified storage sync /// service - public StorageSyncService(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string incomingTrafficPolicy = default(string), int? storageSyncServiceStatus = default(int?), string storageSyncServiceUid = default(string), string provisioningState = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), IList privateEndpointConnections = default(IList)) - : base(location, id, name, type, tags) + public StorageSyncService(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string incomingTrafficPolicy = default(string), int? storageSyncServiceStatus = default(int?), string storageSyncServiceUid = default(string), string provisioningState = default(string), string lastWorkflowId = default(string), string lastOperationName = default(string), IList privateEndpointConnections = default(IList)) + : base(location, id, name, type, systemData, tags) { IncomingTrafficPolicy = incomingTrafficPolicy; StorageSyncServiceStatus = storageSyncServiceStatus; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroup.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroup.cs index a4ee961c3988..c9be4ca9a53c 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroup.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroup.cs @@ -38,10 +38,12 @@ public SyncGroup() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Unique Id /// Sync group status - public SyncGroup(string id = default(string), string name = default(string), string type = default(string), string uniqueId = default(string), string syncGroupStatus = default(string)) - : base(id, name, type) + public SyncGroup(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string uniqueId = default(string), string syncGroupStatus = default(string)) + : base(id, name, type, systemData) { UniqueId = uniqueId; SyncGroupStatus = syncGroupStatus; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroupCreateParameters.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroupCreateParameters.cs index c5c2f79de481..84b2d539d20d 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroupCreateParameters.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SyncGroupCreateParameters.cs @@ -35,10 +35,12 @@ public SyncGroupCreateParameters() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// The parameters used to create the sync /// group - public SyncGroupCreateParameters(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) - : base(id, name, type) + public SyncGroupCreateParameters(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), object properties = default(object)) + : base(id, name, type, systemData) { Properties = properties; CustomInit(); diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SystemData.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..266b601a5cae --- /dev/null +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StorageSync.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/TrackedResource.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/TrackedResource.cs index 51c8fd40ec0c..4b2b6e5016bd 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/TrackedResource.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/TrackedResource.cs @@ -44,9 +44,11 @@ public TrackedResource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Resource tags. - public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary)) + : base(id, name, type, systemData) { Tags = tags; Location = location; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Workflow.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Workflow.cs index 11eac2dfd875..625b9e09dbc0 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Workflow.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/Models/Workflow.cs @@ -38,6 +38,8 @@ public Workflow() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// last step name /// workflow status. Possible values include: /// 'active', 'expired', 'succeeded', 'aborted', 'failed' @@ -50,8 +52,8 @@ public Workflow() /// workflow created timestamp. /// workflow last status /// timestamp. - public Workflow(string id = default(string), string name = default(string), string type = default(string), string lastStepName = default(string), string status = default(string), string operation = default(string), string steps = default(string), string lastOperationId = default(string), string commandName = default(string), System.DateTime? createdTimestamp = default(System.DateTime?), System.DateTime? lastStatusTimestamp = default(System.DateTime?)) - : base(id, name, type) + public Workflow(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string lastStepName = default(string), string status = default(string), string operation = default(string), string steps = default(string), string lastOperationId = default(string), string commandName = default(string), System.DateTime? createdTimestamp = default(System.DateTime?), System.DateTime? lastStatusTimestamp = default(System.DateTime?)) + : base(id, name, type, systemData) { LastStepName = lastStepName; Status = status; diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/SdkInfo_MicrosoftStorageSync.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/SdkInfo_MicrosoftStorageSync.cs index 43be7cb808ba..e5395a50b23e 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/SdkInfo_MicrosoftStorageSync.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/SdkInfo_MicrosoftStorageSync.cs @@ -20,6 +20,7 @@ public static IEnumerable> ApiInfo_MicrosoftStorag return new Tuple[] { new Tuple("StorageSync", "CloudEndpoints", "2020-09-01"), + new Tuple("StorageSync", "LocationOperationStatus", "2020-09-01"), new Tuple("StorageSync", "OperationStatus", "2020-09-01"), new Tuple("StorageSync", "Operations", "2020-09-01"), new Tuple("StorageSync", "PrivateEndpointConnections", "2020-09-01"), @@ -32,16 +33,5 @@ public static IEnumerable> ApiInfo_MicrosoftStorag }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storagesync/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\github\\anpint\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e92d236d96ab4e229a9943ddea7a7534982a4028"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/StorageSyncManagementClient.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/StorageSyncManagementClient.cs index f68cbd0bc102..364bb4231820 100644 --- a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/StorageSyncManagementClient.cs +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/StorageSyncManagementClient.cs @@ -20,6 +20,8 @@ namespace Microsoft.Azure.Management.StorageSync using System.Linq; using System.Net; using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// Microsoft Storage Sync Service API @@ -410,5 +412,223 @@ private void Initialize() DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } + /// + /// Get Operation status + /// + /// + /// The desired region to obtain information from. + /// + /// + /// operation Id + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> LocationOperationStatusMethodWithHttpMessagesAsync(string locationName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (locationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); + } + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("locationName", locationName); + tracingParameters.Add("operationId", operationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "LocationOperationStatusMethod", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/operations/{operationId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new StorageSyncErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + StorageSyncError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/StorageSyncManagementClientExtensions.cs b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/StorageSyncManagementClientExtensions.cs new file mode 100644 index 000000000000..a09d76f8f4af --- /dev/null +++ b/sdk/storagesync/Microsoft.Azure.Management.StorageSync/src/Generated/StorageSyncManagementClientExtensions.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StorageSync +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for StorageSyncManagementClient. + /// + public static partial class StorageSyncManagementClientExtensions + { + /// + /// Get Operation status + /// + /// + /// The operations group for this extension method. + /// + /// + /// The desired region to obtain information from. + /// + /// + /// operation Id + /// + public static LocationOperationStatus LocationOperationStatusMethod(this IStorageSyncManagementClient operations, string locationName, string operationId) + { + return operations.LocationOperationStatusMethodAsync(locationName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Get Operation status + /// + /// + /// The operations group for this extension method. + /// + /// + /// The desired region to obtain information from. + /// + /// + /// operation Id + /// + /// + /// The cancellation token. + /// + public static async Task LocationOperationStatusMethodAsync(this IStorageSyncManagementClient operations, string locationName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.LocationOperationStatusMethodWithHttpMessagesAsync(locationName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}