From 87b4c223938eedbe9083efed4848374d8ebe8ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Mon, 21 Nov 2016 11:15:26 -0800 Subject: [PATCH 1/8] Several changes derived from modifications to the Swagger specs --- .../Insights.Tests/BasicTests/AlertsTests.cs | 2 +- .../BasicTests/EventDataTests.cs | 3 +- .../BasicTests/LogProfilesTests.cs | 4 +- .../ServiceDiagnosticSettingsTests.cs | 4 +- .../Insights/Insights.Tests/project.json | 5 +- .../Insights/EventCategoriesOperations.cs | 8 +- .../EventCategoriesOperationsExtensions.cs | 10 +- .../Generated/Insights/EventsOperations.cs | 49 +++- .../Insights/EventsOperationsExtensions.cs | 96 ++++++- .../Insights/IEventCategoriesOperations.cs | 10 +- .../Generated/Insights/IEventsOperations.cs | 53 +++- .../Generated/Insights/IInsightsClient.cs | 6 +- .../Insights/IMetricDefinitionsOperations.cs | 10 +- .../Generated/Insights/IMetricsOperations.cs | 19 +- .../Insights/ITenantEventsOperations.cs | 68 ++++- .../Insights/IUsageMetricsOperations.cs | 2 +- .../Generated/Insights/InsightsClient.cs | 2 +- .../Insights/MetricDefinitionsOperations.cs | 9 +- .../MetricDefinitionsOperationsExtensions.cs | 16 +- .../Generated/Insights/MetricsOperations.cs | 18 +- .../Insights/MetricsOperationsExtensions.cs | 34 ++- .../Insights/Models/AggregationType.cs | 2 +- .../Insights/Models/EventChannels.cs | 2 +- .../Generated/Insights/Models/EventData.cs | 177 ++++++++----- .../Generated/Insights/Models/EventLevel.cs | 2 +- .../Insights/Models/HttpRequestInfo.cs | 2 +- .../Insights/Models/LocalizableString.cs | 17 +- .../Generated/Insights/Models/Metric.cs | 23 +- .../Insights/Models/MetricAvailability.cs | 10 +- .../Insights/Models/MetricDefinition.cs | 40 ++- .../Generated/Insights/Models/MetricValue.cs | 16 +- .../Generated/Insights/Models/Page.cs | 2 +- .../Generated/Insights/Models/Page1.cs | 2 +- .../Insights/Models/SenderAuthorization.cs | 16 +- .../Generated/Insights/Models/Unit.cs | 2 +- .../Generated/Insights/Models/UsageMetric.cs | 15 +- .../Insights/TenantEventsOperations.cs | 57 ++++- .../TenantEventsOperationsExtensions.cs | 112 ++++++++- .../Insights/UsageMetricsOperations.cs | 2 +- .../UsageMetricsOperationsExtensions.cs | 34 +-- .../Insights/AlertRuleIncidentsOperations.cs | 191 +++++++++++++- .../AlertRuleIncidentsOperationsExtensions.cs | 42 +++- .../Insights/AlertRulesOperations.cs | 6 +- .../AlertRulesOperationsExtensions.cs | 10 +- .../Insights/AutoscaleSettingsOperations.cs | 2 +- .../AutoscaleSettingsOperationsExtensions.cs | 2 +- .../Insights/IAlertRuleIncidentsOperations.cs | 27 +- .../Insights/IAlertRulesOperations.cs | 6 +- .../Insights/IAutoscaleSettingsOperations.cs | 2 +- .../Insights/IIncidentsOperations.cs | 45 ---- .../Insights/IInsightsManagementClient.cs | 19 +- .../Insights/ILogProfilesOperations.cs | 6 +- .../IServiceDiagnosticSettingsOperations.cs | 4 +- .../Insights/IncidentsOperations.cs | 234 ------------------ .../Insights/IncidentsOperationsExtensions.cs | 61 ----- .../Insights/InsightsManagementClient.cs | 18 +- .../Insights/LogProfilesOperations.cs | 6 +- .../LogProfilesOperationsExtensions.cs | 10 +- .../Insights/Models/AlertRuleResource.cs | 10 +- .../Insights/Models/AutoscaleNotification.cs | 4 +- .../Insights/Models/AutoscaleProfile.cs | 13 +- .../Models/AutoscaleSettingResource.cs | 19 +- .../Models/ComparisonOperationType.cs | 2 +- .../Insights/Models/ConditionOperator.cs | 2 +- .../Insights/Models/EmailNotification.cs | 16 +- .../Management/Insights/Models/Incident.cs | 10 +- .../Models/LocationThresholdRuleCondition.cs | 15 +- .../LogProfileCreateOrUpdateParameters.cs | 90 ------- .../Insights/Models/LogProfileProperties.cs | 110 ++++++++ .../Insights/Models/LogProfileResource.cs | 53 ++-- .../Management/Insights/Models/LogSettings.cs | 13 +- .../ManagementEventAggregationCondition.cs | 9 +- .../Models/ManagementEventRuleCondition.cs | 17 +- .../Insights/Models/MetricSettings.cs | 2 +- .../Insights/Models/MetricStatisticType.cs | 2 +- .../Insights/Models/MetricTrigger.cs | 62 +++-- .../Management/Insights/Models/Page.cs | 2 +- .../Management/Insights/Models/Page1.cs | 2 +- .../Management/Insights/Models/Recurrence.cs | 27 +- .../Insights/Models/RecurrenceFrequency.cs | 2 +- .../Insights/Models/RecurrentSchedule.cs | 124 +++++++++- .../Management/Insights/Models/Resource.cs | 2 +- .../Insights/Models/RetentionPolicy.cs | 8 +- .../Management/Insights/Models/RuleAction.cs | 2 +- .../Insights/Models/RuleCondition.cs | 2 +- .../Insights/Models/RuleDataSource.cs | 2 +- .../Insights/Models/RuleEmailAction.cs | 21 +- .../RuleManagementEventClaimsDataSource.cs | 2 +- .../Models/RuleManagementEventDataSource.cs | 5 +- .../Insights/Models/RuleMetricDataSource.cs | 5 +- .../Insights/Models/RuleWebhookAction.cs | 16 +- .../Management/Insights/Models/ScaleAction.cs | 40 ++- .../Insights/Models/ScaleCapacity.cs | 10 +- .../Insights/Models/ScaleDirection.cs | 2 +- .../Management/Insights/Models/ScaleRule.cs | 22 +- .../Management/Insights/Models/ScaleType.cs | 25 ++ .../Models/ServiceDiagnosticSettings.cs | 86 +++++++ ...gnosticSettingsCreateOrUpdateParameters.cs | 76 ------ .../ServiceDiagnosticSettingsResource.cs | 47 ++-- .../Insights/Models/ThresholdRuleCondition.cs | 21 +- .../Models/TimeAggregationOperator.cs | 2 +- .../Insights/Models/TimeAggregationType.cs | 2 +- .../Management/Insights/Models/TimeWindow.cs | 9 +- .../Insights/Models/WebhookNotification.cs | 9 +- .../ServiceDiagnosticSettingsOperations.cs | 4 +- ...eDiagnosticSettingsOperationsExtensions.cs | 6 +- .../Microsoft.Azure.Insights/error.txt | 0 .../Microsoft.Azure.Insights/generate.cmd | 2 +- .../Microsoft.Azure.Insights/project.json | 6 +- 109 files changed, 1686 insertions(+), 1006 deletions(-) delete mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IIncidentsOperations.cs delete mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperations.cs delete mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperationsExtensions.cs delete mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileCreateOrUpdateParameters.cs create mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs create mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleType.cs create mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs delete mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsCreateOrUpdateParameters.cs create mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/error.txt diff --git a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/AlertsTests.cs b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/AlertsTests.cs index 2fdfce570b88..c980c928ce17 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/AlertsTests.cs +++ b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/AlertsTests.cs @@ -102,7 +102,7 @@ public void ListIncidentsTest() var handler = new RecordedDelegatingHandler(response); var insightsClient = GetInsightsManagementClient(handler); - var actualIncidents = insightsClient.Incidents.ListByAlertRule( + var actualIncidents = insightsClient.AlertRuleIncidents.ListByAlertRule( resourceGroupName: "rg1", ruleName: "r1"); diff --git a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/EventDataTests.cs b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/EventDataTests.cs index a7e9f0aefd0a..b3ce7bf9da4f 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/EventDataTests.cs +++ b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/EventDataTests.cs @@ -174,7 +174,6 @@ private static void AreEqual(SenderAuthorization exp, SenderAuthorization act) if (exp != null) { Assert.Equal(exp.Action, act.Action); - Assert.Equal(exp.Condition, act.Condition); Assert.Equal(exp.Role, act.Role); Assert.Equal(exp.Scope, act.Scope); } @@ -185,7 +184,7 @@ private static List GetEventDataCollection() return new List() { new EventData( - authorization: new SenderAuthorization(action: "action", condition: "condition", role: "role" , scope: "scope"), + authorization: new SenderAuthorization(action: "action", role: "role" , scope: "scope"), claims: new Dictionary { {"prop1", "val1"} }, correlationId: Guid.NewGuid().ToString("N"), description: "description", diff --git a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs index 09cdd5f6d8fe..3a852c509a48 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs +++ b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs @@ -127,9 +127,9 @@ private static LogProfileResource CreateLogProfile() }; } - private static LogProfileCreateOrUpdateParameters CreateLogProfileParams() + private static LogProfileProperties CreateLogProfileParams() { - return new LogProfileCreateOrUpdateParameters + return new LogProfileProperties { StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/sb1/authorizationrules/ar1", diff --git a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs index f47e2f13c5e3..49ea9aa753c9 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs +++ b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs @@ -68,9 +68,9 @@ public void LogProfiles_GetTest() AreEqual(expResponse, actualResponse); } - private static ServiceDiagnosticSettingsCreateOrUpdateParameters CreateDiagnosticSettingsParams() + private static ServiceDiagnosticSettings CreateDiagnosticSettingsParams() { - return new ServiceDiagnosticSettingsCreateOrUpdateParameters + return new ServiceDiagnosticSettings { StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/ns1/authorizationRules/authrule", diff --git a/src/ResourceManagement/Insights/Insights.Tests/project.json b/src/ResourceManagement/Insights/Insights.Tests/project.json index 5344a52246a3..eb085530c3ed 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/project.json +++ b/src/ResourceManagement/Insights/Insights.Tests/project.json @@ -32,9 +32,8 @@ "type": "platform", "version": "1.0.0" }, - "Microsoft.Azure.Test.HttpRecorder": "[1.6.7-preview,2.0.0)", - "Microsoft.Rest.ClientRuntime.Azure.TestFramework": "[1.3.5-preview,2.0.0)", - "Microsoft.Azure.Insights": "0.14.0-preview", + "Microsoft.Rest.ClientRuntime.Azure.TestFramework": "[1.4.0-preview,2.0.0)", + "Microsoft.Azure.Insights": "0.14.1-preview", "xunit": "2.2.0-beta2-build3300", "dotnet-test-xunit": "2.2.0-preview2-build1029" } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperations.cs index f433791d8074..e1a26eec1123 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -42,7 +42,9 @@ internal EventCategoriesOperations(InsightsClient client) public InsightsClient Client { get; private set; } /// - /// The list of event categories. + /// get the list of available event categories supported in the Activity Log + /// Service. The current list includes the following: Aministrative, Security, + /// ServiceHealth, Alert, Recommendation, Policy. /// /// /// Headers that will be added to request. @@ -75,7 +77,7 @@ internal EventCategoriesOperations(InsightsClient client) } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventtypes/management/eventcategories").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventcategories").ToString(); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperationsExtensions.cs index 35fa60c1b24d..35167a713c31 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventCategoriesOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Insights public static partial class EventCategoriesOperationsExtensions { /// - /// The list of event categories. + /// get the list of available event categories supported in the Activity Log + /// Service. The current list includes the following: Aministrative, Security, + /// ServiceHealth, Alert, Recommendation, Policy. /// /// /// The operations group for this extension method. @@ -29,7 +31,9 @@ public static System.Collections.Generic.IEnumerable List(thi } /// - /// The list of event categories. + /// get the list of available event categories supported in the Activity Log + /// Service. The current list includes the following: Aministrative, Security, + /// ServiceHealth, Alert, Recommendation, Policy. /// /// /// The operations group for this extension method. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperations.cs index 995901eb57fe..d5e88ba90cba 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -42,17 +42,35 @@ internal EventsOperations(InsightsClient client) public InsightsClient Client { get; private set; } /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: /// authorization, channels, claims, correlationId, description, eventDataId, - /// eventName, eventTimestamp, httpRequest, level, operationId, - /// operationName, properties, resourceGroupName, resourceProviderName, - /// resourceId, status, submissionTimestamp, subStatus, subscriptionId + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId /// /// /// Headers that will be added to request. @@ -237,7 +255,24 @@ internal EventsOperations(InsightsClient client) } /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperationsExtensions.cs index c7a1c3fd3d90..0b1b18d7e722 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/EventsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -18,7 +18,24 @@ namespace Microsoft.Azure.Insights public static partial class EventsOperationsExtensions { /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. @@ -27,11 +44,12 @@ public static partial class EventsOperationsExtensions /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: /// authorization, channels, claims, correlationId, description, eventDataId, - /// eventName, eventTimestamp, httpRequest, level, operationId, - /// operationName, properties, resourceGroupName, resourceProviderName, - /// resourceId, status, submissionTimestamp, subStatus, subscriptionId + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId /// public static Microsoft.Rest.Azure.IPage List(this IEventsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string)) { @@ -39,7 +57,24 @@ public static partial class EventsOperationsExtensions } /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. @@ -48,11 +83,12 @@ public static partial class EventsOperationsExtensions /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: /// authorization, channels, claims, correlationId, description, eventDataId, - /// eventName, eventTimestamp, httpRequest, level, operationId, - /// operationName, properties, resourceGroupName, resourceProviderName, - /// resourceId, status, submissionTimestamp, subStatus, subscriptionId + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId /// /// /// The cancellation token. @@ -66,7 +102,24 @@ public static partial class EventsOperationsExtensions } /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. @@ -80,7 +133,24 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IEventsOperati } /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventCategoriesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventCategoriesOperations.cs index e1c7db18f863..0d1e7f6c1a55 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventCategoriesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventCategoriesOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,7 +17,10 @@ namespace Microsoft.Azure.Insights public partial interface IEventCategoriesOperations { /// - /// The list of event categories. + /// get the list of available event categories supported in the + /// Activity Log Service. The current list includes the following: + /// Aministrative, Security, ServiceHealth, Alert, Recommendation, + /// Policy. /// /// /// The headers that will be added to request. @@ -31,6 +34,9 @@ public partial interface IEventCategoriesOperations /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventsOperations.cs index 151cb6776c9b..978e76c6e863 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IEventsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,16 +17,36 @@ namespace Microsoft.Azure.Insights public partial interface IEventsOperations { /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and + /// allows only the following patterns. - List events for a resource + /// group: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceUri eq + /// '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation'. + /// -List events for a resource provider: $filter=eventTimestamp ge + /// '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. /// /// /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: - /// authorization, channels, claims, correlationId, description, - /// eventDataId, eventName, eventTimestamp, httpRequest, level, - /// operationId, operationName, properties, resourceGroupName, + /// Used to fetch events with only the given properties. The filter is + /// a comma separated list of property names to be returned. Possible + /// values are: authorization, channels, claims, correlationId, + /// description, eventDataId, eventName, eventTimestamp, httpRequest, + /// level, operationId, operationName, properties, resourceGroupName, /// resourceProviderName, resourceId, status, submissionTimestamp, /// subStatus, subscriptionId /// @@ -47,7 +67,26 @@ public partial interface IEventsOperations /// System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Provides the list of events. + /// Provides the list of events. The **$filter** is very restricted and + /// allows only the following patterns. - List events for a resource + /// group: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceUri eq + /// '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation'. + /// -List events for a resource provider: $filter=eventTimestamp ge + /// '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IInsightsClient.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IInsightsClient.cs index 885e3b9f60f5..111a5e675981 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IInsightsClient.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IInsightsClient.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -54,8 +54,8 @@ public partial interface IInsightsClient : System.IDisposable int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricDefinitionsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricDefinitionsOperations.cs index 1d10da3a359a..257c9edc38b3 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricDefinitionsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricDefinitionsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,7 +17,13 @@ namespace Microsoft.Azure.Insights public partial interface IMetricDefinitionsOperations { /// - /// Lists the metric definitions for the resource. + /// Lists the metric definitions for the resource. The **$filter** + /// parameter is optional, and can be used to only retrieve certain + /// metric definitions. For example, get just the definition for the + /// CPU percentage counter: $filter=name.value eq '\Processor(_Total)\% + /// Processor Time'. This $filter is very restricted and allows only + /// these 'name eq <value>' clauses separated by or operators. No + /// other syntax is allowed. /// /// /// The identifier of the resource. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricsOperations.cs index b2d120733ef2..e7b906cd43f4 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IMetricsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,7 +17,22 @@ namespace Microsoft.Azure.Insights public partial interface IMetricsOperations { /// - /// Lists the metric values for a resource. + /// Lists the metric values for a resource. The $filter is used to + /// reduce the set of metric data returned. Some common properties for + /// this expression will be: name.value, aggregationType, startTime, + /// endTime, timeGrain. The filter expression uses these properties + /// with comparison operators (eg. eq, gt, lt) and multiple expressions + /// can be combined with parentheses and 'and/or' operators. Some + /// example filter expressions are: - $filter=(name.value eq + /// 'RunsSucceeded') and aggregationType eq 'Total' and startTime eq + /// 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M', - $filter=(name.value eq 'RunsSucceeded') and + /// (aggregationType eq 'Total' or aggregationType eq 'Average') and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1H', - $filter=(name.value eq 'ActionsCompleted' or + /// name.value eq 'RunsSucceeded') and (aggregationType eq 'Total' or + /// aggregationType eq 'Average') and startTime eq 2016-02-20 and + /// endTime eq 2016-02-21 and timeGrain eq duration'PT1M'. /// /// /// The identifier of the resource. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/ITenantEventsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/ITenantEventsOperations.cs index 5b3186911844..339871ad0a5d 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/ITenantEventsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/ITenantEventsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,16 +17,42 @@ namespace Microsoft.Azure.Insights public partial interface ITenantEventsOperations { /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable + /// to the API to get the Activity Log for the subscription is + /// applicable to this API (the parameters, $filter, etc.). One thing + /// to point out here is that this API does *not* retrieve the logs at + /// the individual subscription of the tenant but only surfaces the + /// logs that were generated at the tenant level. The **$filter** is + /// very restricted and allows only the following patterns. - List + /// events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceGroupName eq + /// '<ResourceGroupName>'. - List events for resource: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceProvider eq '<ResourceProviderName>'. - List events + /// for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. /// /// /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: - /// authorization, channels, claims, correlationId, description, - /// eventDataId, eventName, eventTimestamp, httpRequest, level, - /// operationId, operationName, properties, resourceGroupName, + /// Used to fetch events with only the given properties. The filter is + /// a comma separated list of property names to be returned. Possible + /// values are: authorization, channels, claims, correlationId, + /// description, eventDataId, eventName, eventTimestamp, httpRequest, + /// level, operationId, operationName, properties, resourceGroupName, /// resourceProviderName, resourceId, status, submissionTimestamp, /// subStatus, subscriptionId /// @@ -42,9 +68,37 @@ public partial interface ITenantEventsOperations /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable + /// to the API to get the Activity Log for the subscription is + /// applicable to this API (the parameters, $filter, etc.). One thing + /// to point out here is that this API does *not* retrieve the logs at + /// the individual subscription of the tenant but only surfaces the + /// logs that were generated at the tenant level. The **$filter** is + /// very restricted and allows only the following patterns. - List + /// events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceGroupName eq + /// '<ResourceGroupName>'. - List events for resource: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceProvider eq '<ResourceProviderName>'. - List events + /// for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IUsageMetricsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IUsageMetricsOperations.cs index 576808722578..7de1d078bbde 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IUsageMetricsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/IUsageMetricsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/InsightsClient.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/InsightsClient.cs index 1207c894b148..f50661528c02 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/InsightsClient.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/InsightsClient.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs index 5c260ff4b8cb..36cbfeb8e089 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -42,7 +42,12 @@ internal MetricDefinitionsOperations(InsightsClient client) public InsightsClient Client { get; private set; } /// - /// Lists the metric definitions for the resource. + /// Lists the metric definitions for the resource. The **$filter** parameter is + /// optional, and can be used to only retrieve certain metric definitions. For + /// example, get just the definition for the CPU percentage counter: + /// $filter=name.value eq '\Processor(_Total)\% Processor Time'. This $filter + /// is very restricted and allows only these 'name eq <value>' clauses + /// separated by or operators. No other syntax is allowed. /// /// /// The identifier of the resource. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperationsExtensions.cs index d5a38ddaf2c0..a15ff262a5c8 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -18,7 +18,12 @@ namespace Microsoft.Azure.Insights public static partial class MetricDefinitionsOperationsExtensions { /// - /// Lists the metric definitions for the resource. + /// Lists the metric definitions for the resource. The **$filter** parameter is + /// optional, and can be used to only retrieve certain metric definitions. For + /// example, get just the definition for the CPU percentage counter: + /// $filter=name.value eq '\Processor(_Total)\% Processor Time'. This $filter + /// is very restricted and allows only these 'name eq <value>' clauses + /// separated by or operators. No other syntax is allowed. /// /// /// The operations group for this extension method. @@ -35,7 +40,12 @@ public static partial class MetricDefinitionsOperationsExtensions } /// - /// Lists the metric definitions for the resource. + /// Lists the metric definitions for the resource. The **$filter** parameter is + /// optional, and can be used to only retrieve certain metric definitions. For + /// example, get just the definition for the CPU percentage counter: + /// $filter=name.value eq '\Processor(_Total)\% Processor Time'. This $filter + /// is very restricted and allows only these 'name eq <value>' clauses + /// separated by or operators. No other syntax is allowed. /// /// /// The operations group for this extension method. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs index 0e028125937e..f05009ac6dfc 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -42,7 +42,21 @@ internal MetricsOperations(InsightsClient client) public InsightsClient Client { get; private set; } /// - /// Lists the metric values for a resource. + /// Lists the metric values for a resource. The $filter is used to reduce the + /// set of metric data returned. Some common properties for this expression + /// will be: name.value, aggregationType, startTime, endTime, timeGrain. The + /// filter expression uses these properties with comparison operators (eg. eq, + /// gt, lt) and multiple expressions can be combined with parentheses and + /// 'and/or' operators. Some example filter expressions are: - + /// $filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M', - $filter=(name.value eq 'RunsSucceeded') and + /// (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime + /// eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1H', - + /// $filter=(name.value eq 'ActionsCompleted' or name.value eq 'RunsSucceeded') + /// and (aggregationType eq 'Total' or aggregationType eq 'Average') and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M'. /// /// /// The identifier of the resource. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperationsExtensions.cs index 2e126ce565a4..32a95f91b6b0 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -18,7 +18,21 @@ namespace Microsoft.Azure.Insights public static partial class MetricsOperationsExtensions { /// - /// Lists the metric values for a resource. + /// Lists the metric values for a resource. The $filter is used to reduce the + /// set of metric data returned. Some common properties for this expression + /// will be: name.value, aggregationType, startTime, endTime, timeGrain. The + /// filter expression uses these properties with comparison operators (eg. eq, + /// gt, lt) and multiple expressions can be combined with parentheses and + /// 'and/or' operators. Some example filter expressions are: - + /// $filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M', - $filter=(name.value eq 'RunsSucceeded') and + /// (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime + /// eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1H', - + /// $filter=(name.value eq 'ActionsCompleted' or name.value eq 'RunsSucceeded') + /// and (aggregationType eq 'Total' or aggregationType eq 'Average') and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M'. /// /// /// The operations group for this extension method. @@ -35,7 +49,21 @@ public static partial class MetricsOperationsExtensions } /// - /// Lists the metric values for a resource. + /// Lists the metric values for a resource. The $filter is used to reduce the + /// set of metric data returned. Some common properties for this expression + /// will be: name.value, aggregationType, startTime, endTime, timeGrain. The + /// filter expression uses these properties with comparison operators (eg. eq, + /// gt, lt) and multiple expressions can be combined with parentheses and + /// 'and/or' operators. Some example filter expressions are: - + /// $filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M', - $filter=(name.value eq 'RunsSucceeded') and + /// (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime + /// eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1H', - + /// $filter=(name.value eq 'ActionsCompleted' or name.value eq 'RunsSucceeded') + /// and (aggregationType eq 'Total' or aggregationType eq 'Average') and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M'. /// /// /// The operations group for this extension method. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/AggregationType.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/AggregationType.cs index 89a50406e325..af98affd34d9 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/AggregationType.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/AggregationType.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventChannels.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventChannels.cs index 6953a9c89b40..190339c6ef92 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventChannels.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventChannels.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventData.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventData.cs index f79ceeadf33b..5fd6511672ea 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventData.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventData.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -25,57 +25,71 @@ public EventData() { } /// /// the event channels. The regular event logs, /// that you see in the Azure Management Portals, flow through the - /// 'Operation' channel. Possible values include: 'Admin', - /// 'Operation', 'Debug', 'Analytics' + /// 'Operation' channel. Possible values include: 'Admin', 'Operation', + /// 'Debug', 'Analytics' /// the event level. Possible values include: /// 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' - /// the occurrence time of event in ISO - /// 8601 format - /// the event submission time in ISO - /// 8601 format. This value should not be confused eventTimestamp. As - /// there might be a delay between the occurence time of the event, - /// and the time that the event is submitted to the Azure logging + /// the timestamp of when the event was + /// generated by the Azure service processing the request corresponding + /// the event. It in ISO 8601 format. + /// the timestamp of when the event + /// became available for querying via this API. It is in ISO 8601 + /// format. This value should not be confused eventTimestamp. As there + /// might be a delay between the occurence time of the event, and the + /// time that the event is submitted to the Azure logging /// infrastructure. /// the authorization used by the user who - /// has performed the operation that led to this event. + /// has performed the operation that led to this event. This captures + /// the RBAC properties of the event. These usually include the + /// 'action', 'role' and the 'scope' /// key value pairs to identify ARM /// permissions. /// the email address of the user who has /// performed the operation, the UPN claim or SPN claim based on /// availability. /// the description of the event. - /// the resource Id. + /// the Id of this event as required by ARM for RBAC. + /// It contains the EventDataID and a timestamp information. /// the event data Id. This is a unique /// identifier for an event. - /// the correlation Id. The correlation Id - /// is shared among the events that belong to the same - /// deployment. + /// the correlation Id, usually a GUID in + /// the string format. The correlation Id is shared among the events + /// that belong to the same uber operation. /// the event name. This value should not be - /// confused with OperationName. For practical purposes, - /// OperationName might be more appealing to end users. + /// confused with OperationName. For practical purposes, OperationName + /// might be more appealing to end users. /// the event category. - /// the HTTP request info. The client IP - /// address of the user who initiated the event is captured as part - /// of the HTTP request info. - /// the resource group name. - /// the resource provider - /// name. - /// the resource uri + /// the HTTP request info. Usually includes + /// the 'clientRequestId', 'clientIpAddress' (IP address of the user + /// who initiated the event) and 'method' (HTTP method e.g. + /// PUT). + /// the resource group name of the + /// impacted resource. + /// the resource provider name of + /// the impacted resource. + /// the resource uri that uniquely identifies + /// the resource that caused this event. /// the resource type /// It is usually a GUID shared among the - /// events corresponding to single operation. This value should not - /// be confused with EventName. + /// events corresponding to single operation. This value should not be + /// confused with EventName. /// the operation name. - /// the property bag that includes details + /// the set of <Key, Value> pairs + /// (usually a Dictionary<String, String>) that includes details /// about the event. - /// the event status. Some typical values are: - /// Started, Succeeded, Failed. For more information see: - /// https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx + /// a string describing the status of the + /// operation. Some typical values are: Started, In progress, + /// Succeeded, Failed, Resolved. /// the event sub status. Most of the time, - /// when included, this captures the HTTP status code. For more - /// information see: - /// https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx - /// the Azure subscription Id + /// when included, this captures the HTTP status code of the REST call. + /// Common values are: OK (HTTP Status Code: 200), Created (HTTP Status + /// Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP + /// Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found + /// (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal + /// Server Error (HTTP Status Code: 500), Service Unavailable (HTTP + /// Status Code:503), Gateway Timeout (HTTP Status Code: 504) + /// the Azure subscription Id usually a + /// GUID. /// the Azure tenant Id public EventData(EventChannels channels, EventLevel level, System.DateTime eventTimestamp, System.DateTime submissionTimestamp, SenderAuthorization authorization = default(SenderAuthorization), System.Collections.Generic.IDictionary claims = default(System.Collections.Generic.IDictionary), string caller = default(string), string description = default(string), string id = default(string), string eventDataId = default(string), string correlationId = default(string), LocalizableString eventName = default(LocalizableString), LocalizableString category = default(LocalizableString), HttpRequestInfo httpRequest = default(HttpRequestInfo), string resourceGroupName = default(string), LocalizableString resourceProviderName = default(LocalizableString), string resourceId = default(string), LocalizableString resourceType = default(LocalizableString), string operationId = default(string), LocalizableString operationName = default(LocalizableString), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary), LocalizableString status = default(LocalizableString), LocalizableString subStatus = default(LocalizableString), string subscriptionId = default(string), string tenantId = default(string)) { @@ -108,7 +122,9 @@ public EventData() { } /// /// Gets or sets the authorization used by the user who has performed - /// the operation that led to this event. + /// the operation that led to this event. This captures the RBAC + /// properties of the event. These usually include the 'action', 'role' + /// and the 'scope' /// [Newtonsoft.Json.JsonProperty(PropertyName = "authorization")] public SenderAuthorization Authorization { get; set; } @@ -142,7 +158,8 @@ public EventData() { } public string Description { get; set; } /// - /// Gets or sets the resource Id. + /// Gets or sets the Id of this event as required by ARM for RBAC. It + /// contains the EventDataID and a timestamp information. /// [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id { get; set; } @@ -155,16 +172,17 @@ public EventData() { } public string EventDataId { get; set; } /// - /// Gets or sets the correlation Id. The correlation Id is shared - /// among the events that belong to the same deployment. + /// Gets or sets the correlation Id, usually a GUID in the string + /// format. The correlation Id is shared among the events that belong + /// to the same uber operation. /// [Newtonsoft.Json.JsonProperty(PropertyName = "correlationId")] public string CorrelationId { get; set; } /// - /// Gets or sets the event name. This value should not be confused - /// with OperationName. For practical purposes, OperationName might - /// be more appealing to end users. + /// Gets or sets the event name. This value should not be confused with + /// OperationName. For practical purposes, OperationName might be more + /// appealing to end users. /// [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] public LocalizableString EventName { get; set; } @@ -176,9 +194,9 @@ public EventData() { } public LocalizableString Category { get; set; } /// - /// Gets or sets the HTTP request info. The client IP address of the - /// user who initiated the event is captured as part of the HTTP - /// request info. + /// Gets or sets the HTTP request info. Usually includes the + /// 'clientRequestId', 'clientIpAddress' (IP address of the user who + /// initiated the event) and 'method' (HTTP method e.g. PUT). /// [Newtonsoft.Json.JsonProperty(PropertyName = "httpRequest")] public HttpRequestInfo HttpRequest { get; set; } @@ -191,19 +209,20 @@ public EventData() { } public EventLevel Level { get; set; } /// - /// Gets or sets the resource group name. + /// Gets or sets the resource group name of the impacted resource. /// [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroupName")] public string ResourceGroupName { get; set; } /// - /// Gets or sets the resource provider name. + /// Gets or sets the resource provider name of the impacted resource. /// [Newtonsoft.Json.JsonProperty(PropertyName = "resourceProviderName")] public LocalizableString ResourceProviderName { get; set; } /// - /// Gets or sets the resource uri + /// Gets or sets the resource uri that uniquely identifies the resource + /// that caused this event. /// [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] public string ResourceId { get; set; } @@ -229,46 +248,54 @@ public EventData() { } public LocalizableString OperationName { get; set; } /// - /// Gets or sets the property bag that includes details about the - /// event. + /// Gets or sets the set of &lt;Key, Value&gt; pairs (usually a + /// Dictionary&lt;String, String&gt;) that includes details + /// about the event. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public System.Collections.Generic.IDictionary Properties { get; set; } /// - /// Gets or sets the event status. Some typical values are: Started, - /// Succeeded, Failed. For more information see: - /// https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx + /// Gets or sets a string describing the status of the operation. Some + /// typical values are: Started, In progress, Succeeded, Failed, + /// Resolved. /// [Newtonsoft.Json.JsonProperty(PropertyName = "status")] public LocalizableString Status { get; set; } /// - /// Gets or sets the event sub status. Most of the time, when - /// included, this captures the HTTP status code. For more - /// information see: - /// https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx + /// Gets or sets the event sub status. Most of the time, when included, + /// this captures the HTTP status code of the REST call. Common values + /// are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), + /// Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: + /// 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status + /// Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error + /// (HTTP Status Code: 500), Service Unavailable (HTTP Status + /// Code:503), Gateway Timeout (HTTP Status Code: 504) /// [Newtonsoft.Json.JsonProperty(PropertyName = "subStatus")] public LocalizableString SubStatus { get; set; } /// - /// Gets or sets the occurrence time of event in ISO 8601 format + /// Gets or sets the timestamp of when the event was generated by the + /// Azure service processing the request corresponding the event. It in + /// ISO 8601 format. /// [Newtonsoft.Json.JsonProperty(PropertyName = "eventTimestamp")] public System.DateTime EventTimestamp { get; set; } /// - /// Gets or sets the event submission time in ISO 8601 format. This - /// value should not be confused eventTimestamp. As there might be a - /// delay between the occurence time of the event, and the time that - /// the event is submitted to the Azure logging infrastructure. + /// Gets or sets the timestamp of when the event became available for + /// querying via this API. It is in ISO 8601 format. This value should + /// not be confused eventTimestamp. As there might be a delay between + /// the occurence time of the event, and the time that the event is + /// submitted to the Azure logging infrastructure. /// [Newtonsoft.Json.JsonProperty(PropertyName = "submissionTimestamp")] public System.DateTime SubmissionTimestamp { get; set; } /// - /// Gets or sets the Azure subscription Id + /// Gets or sets the Azure subscription Id usually a GUID. /// [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] public string SubscriptionId { get; set; } @@ -287,6 +314,34 @@ public EventData() { } /// public virtual void Validate() { + if (this.EventName != null) + { + this.EventName.Validate(); + } + if (this.Category != null) + { + this.Category.Validate(); + } + if (this.ResourceProviderName != null) + { + this.ResourceProviderName.Validate(); + } + if (this.ResourceType != null) + { + this.ResourceType.Validate(); + } + if (this.OperationName != null) + { + this.OperationName.Validate(); + } + if (this.Status != null) + { + this.Status.Validate(); + } + if (this.SubStatus != null) + { + this.SubStatus.Validate(); + } } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventLevel.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventLevel.cs index 6f21050d16c9..de80b1b60efc 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventLevel.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/EventLevel.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/HttpRequestInfo.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/HttpRequestInfo.cs index e9360f0a6042..52405fc6a672 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/HttpRequestInfo.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/HttpRequestInfo.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/LocalizableString.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/LocalizableString.cs index f28f04fad61b..0473a143203e 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/LocalizableString.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/LocalizableString.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -25,7 +25,7 @@ public LocalizableString() { } /// /// the invariant value. /// the locale specific value. - public LocalizableString(string value = default(string), string localizedValue = default(string)) + public LocalizableString(string value, string localizedValue = default(string)) { Value = value; LocalizedValue = localizedValue; @@ -43,5 +43,18 @@ public LocalizableString() { } [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] public string LocalizedValue { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + } + } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Metric.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Metric.cs index 6e9fbf266d47..24697ef74be0 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Metric.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Metric.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -23,14 +23,14 @@ public Metric() { } /// /// Initializes a new instance of the Metric class. /// - /// the name and the display name of the - /// metric. - /// the unit of the metric. Possible values - /// include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', - /// 'BytesPerSecond', 'Percent', 'MilliSeconds' + /// the name and the display name of the metric, + /// i.e. it is localizable string. + /// the unit of the metric. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + /// 'Percent', 'MilliSeconds' /// Array of data points representing the metric /// values. - public Metric(LocalizableString name, Unit? unit, System.Collections.Generic.IList data) + public Metric(LocalizableString name, Unit unit, System.Collections.Generic.IList data) { Name = name; Unit = unit; @@ -38,7 +38,8 @@ public Metric(LocalizableString name, Unit? unit, System.Collections.Generic.ILi } /// - /// Gets or sets the name and the display name of the metric. + /// Gets or sets the name and the display name of the metric, i.e. it + /// is localizable string. /// [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public LocalizableString Name { get; set; } @@ -49,7 +50,7 @@ public Metric(LocalizableString name, Unit? unit, System.Collections.Generic.ILi /// 'Percent', 'MilliSeconds' /// [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] - public Unit? Unit { get; set; } + public Unit Unit { get; set; } /// /// Gets or sets array of data points representing the metric values. @@ -73,6 +74,10 @@ public virtual void Validate() { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Data"); } + if (this.Name != null) + { + this.Name.Validate(); + } if (this.Data != null) { foreach (var element in this.Data) diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricAvailability.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricAvailability.cs index 79594ee448c8..a358beacfec8 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricAvailability.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricAvailability.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -25,10 +25,10 @@ public MetricAvailability() { } /// Initializes a new instance of the MetricAvailability class. /// /// the time grain specifies the aggregation - /// interval for the metric. Expressed as a duration 'PT1M', 'P1D' + /// interval for the metric. Expressed as a duration 'PT1M', 'P1D', /// etc. /// the retention period for the metric at the - /// specified timegrain. Expressed as a duration 'PT1M', 'P1D' + /// specified timegrain. Expressed as a duration 'PT1M', 'P1D', /// etc. public MetricAvailability(System.TimeSpan? timeGrain = default(System.TimeSpan?), System.TimeSpan? retention = default(System.TimeSpan?)) { @@ -38,14 +38,14 @@ public MetricAvailability() { } /// /// Gets or sets the time grain specifies the aggregation interval for - /// the metric. Expressed as a duration 'PT1M', 'P1D' etc. + /// the metric. Expressed as a duration 'PT1M', 'P1D', etc. /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] public System.TimeSpan? TimeGrain { get; set; } /// /// Gets or sets the retention period for the metric at the specified - /// timegrain. Expressed as a duration 'PT1M', 'P1D' etc. + /// timegrain. Expressed as a duration 'PT1M', 'P1D', etc. /// [Newtonsoft.Json.JsonProperty(PropertyName = "retention")] public System.TimeSpan? Retention { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricDefinition.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricDefinition.cs index 0a94967e3fab..72c618568142 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricDefinition.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricDefinition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -24,12 +24,12 @@ public MetricDefinition() { } /// Initializes a new instance of the MetricDefinition class. /// /// the resource identifier of the resource - /// that has emitted the metric. - /// the name and the display name of the - /// metric. - /// the unit of the metric. Possible values - /// include: 'Count', 'Bytes', 'Seconds', 'CountPerSecond', - /// 'BytesPerSecond', 'Percent', 'MilliSeconds' + /// that emitted the metric. + /// the name and the display name of the metric, + /// i.e. it is a localizable string. + /// the unit of the metric. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + /// 'Percent', 'MilliSeconds' /// the primary aggregation type /// value defining how to use the values for display. Possible values /// include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', @@ -49,14 +49,15 @@ public MetricDefinition() { } } /// - /// Gets or sets the resource identifier of the resource that has - /// emitted the metric. + /// Gets or sets the resource identifier of the resource that emitted + /// the metric. /// [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] public string ResourceId { get; set; } /// - /// Gets or sets the name and the display name of the metric. + /// Gets or sets the name and the display name of the metric, i.e. it + /// is a localizable string. /// [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public LocalizableString Name { get; set; } @@ -70,9 +71,9 @@ public MetricDefinition() { } public Unit? Unit { get; set; } /// - /// Gets or sets the primary aggregation type value defining how to - /// use the values for display. Possible values include: 'None', - /// 'Average', 'Count', 'Minimum', 'Maximum', 'Total' + /// Gets or sets the primary aggregation type value defining how to use + /// the values for display. Possible values include: 'None', 'Average', + /// 'Count', 'Minimum', 'Maximum', 'Total' /// [Newtonsoft.Json.JsonProperty(PropertyName = "primaryAggregationType")] public AggregationType? PrimaryAggregationType { get; set; } @@ -90,5 +91,18 @@ public MetricDefinition() { } [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Name != null) + { + this.Name.Validate(); + } + } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricValue.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricValue.cs index 5982290dcc09..ed93e020c462 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricValue.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/MetricValue.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -23,19 +23,19 @@ public MetricValue() { } /// /// Initializes a new instance of the MetricValue class. /// - /// the timestamp for the metric value in ISO + /// the timestamp for the metric value in ISO /// 8601 format. /// the average value in the time range. /// the least value in the time range. /// the greatest value in the time range. /// the sum of all of the values in the time /// range. - /// the number of samples in the time range. Can - /// be used to determine the number of values that contributed to the + /// the number of samples in the time range. Can be + /// used to determine the number of values that contributed to the /// average value. - public MetricValue(System.DateTime timestamp, double? average = default(double?), double? minimum = default(double?), double? maximum = default(double?), double? total = default(double?), long? count = default(long?)) + public MetricValue(System.DateTime timeStamp, double? average = default(double?), double? minimum = default(double?), double? maximum = default(double?), double? total = default(double?), long? count = default(long?)) { - Timestamp = timestamp; + TimeStamp = timeStamp; Average = average; Minimum = minimum; Maximum = maximum; @@ -46,8 +46,8 @@ public MetricValue() { } /// /// Gets or sets the timestamp for the metric value in ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timestamp")] - public System.DateTime Timestamp { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeStamp")] + public System.DateTime TimeStamp { get; set; } /// /// Gets or sets the average value in the time range. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page.cs index 31cd1584bed0..92e2a6b0a157 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page1.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page1.cs index 0dd0b684fc0c..48ed67f34acd 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page1.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Page1.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/SenderAuthorization.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/SenderAuthorization.cs index 1dbe45ffdb3b..252f03e03705 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/SenderAuthorization.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/SenderAuthorization.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -25,14 +25,12 @@ public SenderAuthorization() { } /// /// the permissible actions. For instance: /// microsoft.support/supporttickets/write - /// the condition. - /// the role of the user. For instance: - /// Subscription Admin + /// the role of the user. For instance: Subscription + /// Admin /// the scope. - public SenderAuthorization(string action = default(string), string condition = default(string), string role = default(string), string scope = default(string)) + public SenderAuthorization(string action = default(string), string role = default(string), string scope = default(string)) { Action = action; - Condition = condition; Role = role; Scope = scope; } @@ -44,12 +42,6 @@ public SenderAuthorization() { } [Newtonsoft.Json.JsonProperty(PropertyName = "action")] public string Action { get; set; } - /// - /// Gets or sets the condition. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "condition")] - public string Condition { get; set; } - /// /// Gets or sets the role of the user. For instance: Subscription Admin /// diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Unit.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Unit.cs index ff1f9fe6f083..ddc1f81c334a 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Unit.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/Unit.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/UsageMetric.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/UsageMetric.cs index c97906d55bf6..8192c4e83b27 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/UsageMetric.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/Models/UsageMetric.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -86,5 +86,18 @@ public UsageMetric() { } [Newtonsoft.Json.JsonProperty(PropertyName = "quotaPeriod")] public System.TimeSpan? QuotaPeriod { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Name != null) + { + this.Name.Validate(); + } + } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperations.cs index f7be759ea6fb..dd275f5047ce 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -42,17 +42,39 @@ internal TenantEventsOperations(InsightsClient client) public InsightsClient Client { get; private set; } /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: /// authorization, channels, claims, correlationId, description, eventDataId, - /// eventName, eventTimestamp, httpRequest, level, operationId, - /// operationName, properties, resourceGroupName, resourceProviderName, - /// resourceId, status, submissionTimestamp, subStatus, subscriptionId + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId /// /// /// Headers that will be added to request. @@ -229,7 +251,28 @@ internal TenantEventsOperations(InsightsClient client) } /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperationsExtensions.cs index 5e4fab8d0937..e8f170266317 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/TenantEventsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -18,7 +18,28 @@ namespace Microsoft.Azure.Insights public static partial class TenantEventsOperationsExtensions { /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. @@ -27,11 +48,12 @@ public static partial class TenantEventsOperationsExtensions /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: /// authorization, channels, claims, correlationId, description, eventDataId, - /// eventName, eventTimestamp, httpRequest, level, operationId, - /// operationName, properties, resourceGroupName, resourceProviderName, - /// resourceId, status, submissionTimestamp, subStatus, subscriptionId + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId /// public static Microsoft.Rest.Azure.IPage List(this ITenantEventsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string)) { @@ -39,7 +61,28 @@ public static partial class TenantEventsOperationsExtensions } /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. @@ -48,11 +91,12 @@ public static partial class TenantEventsOperationsExtensions /// OData parameters to apply to the operation. /// /// - /// The list of property names to be returned. Possible values are: + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: /// authorization, channels, claims, correlationId, description, eventDataId, - /// eventName, eventTimestamp, httpRequest, level, operationId, - /// operationName, properties, resourceGroupName, resourceProviderName, - /// resourceId, status, submissionTimestamp, subStatus, subscriptionId + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId /// /// /// The cancellation token. @@ -66,7 +110,28 @@ public static partial class TenantEventsOperationsExtensions } /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. @@ -80,7 +145,28 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ITenantEventsO } /// - /// Provides the list of tenant events. + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. /// /// /// The operations group for this extension method. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperations.cs index d79cac76825b..3c2988e29e89 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperationsExtensions.cs index 2d0861dd7f4e..e7b1921b2a4c 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/UsageMetricsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,22 +17,22 @@ namespace Microsoft.Azure.Insights /// public static partial class UsageMetricsOperationsExtensions { - /// - /// The List operation lists the usage metrics for the resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The client Api Version. - /// - /// - /// OData parameters to apply to the operation. - /// - public static System.Collections.Generic.IEnumerable List(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + /// + /// The List operation lists the usage metrics for the resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The client Api Version. + /// + /// + /// OData parameters to apply to the operation. + /// + public static System.Collections.Generic.IEnumerable List(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) { return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageMetricsOperations)s).ListAsync(resourceUri, apiVersion, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperations.cs index 21a85249bd6b..713be16a1bcf 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -239,5 +239,194 @@ internal AlertRuleIncidentsOperations(InsightsManagementClient client) return _result; } + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ruleName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByAlertRule", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperationsExtensions.cs index 0f2ed4acc473..b53f11593eea 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRuleIncidentsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -63,5 +63,45 @@ public static Incident Get(this IAlertRuleIncidentsOperations operations, string } } + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + public static System.Collections.Generic.IEnumerable ListByAlertRule(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRuleIncidentsOperations)s).ListByAlertRuleAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAlertRuleAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByAlertRuleWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperations.cs index 280406adf40e..0195410762ec 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -42,7 +42,9 @@ internal AlertRulesOperations(InsightsManagementClient client) public InsightsManagementClient Client { get; private set; } /// - /// Creates or updates an alert rule + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} /// /// /// The name of the resource group. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperationsExtensions.cs index c8f15efb98f7..363e35b947e8 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AlertRulesOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -18,7 +18,9 @@ namespace Microsoft.Azure.Management.Insights public static partial class AlertRulesOperationsExtensions { /// - /// Creates or updates an alert rule + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} /// /// /// The operations group for this extension method. @@ -38,7 +40,9 @@ public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operat } /// - /// Creates or updates an alert rule + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} /// /// /// The operations group for this extension method. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperations.cs index 8eba4ea6476c..4f1c102d2b3e 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperationsExtensions.cs index 54bc1c392f10..2b6bb599cab2 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/AutoscaleSettingsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRuleIncidentsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRuleIncidentsOperations.cs index 9073b6480382..258f36fc2307 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRuleIncidentsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRuleIncidentsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -44,5 +44,30 @@ public partial interface IAlertRuleIncidentsOperations /// Thrown when a required parameter is null /// System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, string incidentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRulesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRulesOperations.cs index c00320b0b66b..daa38172b621 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRulesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAlertRulesOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,7 +17,9 @@ namespace Microsoft.Azure.Management.Insights public partial interface IAlertRulesOperations { /// - /// Creates or updates an alert rule + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} /// /// /// The name of the resource group. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAutoscaleSettingsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAutoscaleSettingsOperations.cs index 2dd55afdfcee..6806f73655cc 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAutoscaleSettingsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IAutoscaleSettingsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IIncidentsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IIncidentsOperations.cs deleted file mode 100644 index 8e47a5c533e2..000000000000 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IIncidentsOperations.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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 0.17.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Insights -{ - using Microsoft.Rest.Azure; - using Models; - - /// - /// IncidentsOperations operations. - /// - public partial interface IIncidentsOperations - { - /// - /// Gets a list of incidents associated to an alert rule - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the rule. - /// - /// - /// The 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 - /// - System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - } -} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IInsightsManagementClient.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IInsightsManagementClient.cs index cef56ed70b23..fb14f33bd220 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IInsightsManagementClient.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IInsightsManagementClient.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -54,8 +54,8 @@ public partial interface IInsightsManagementClient : System.IDisposable int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } @@ -71,19 +71,14 @@ public partial interface IInsightsManagementClient : System.IDisposable IServiceDiagnosticSettingsOperations ServiceDiagnosticSettings { get; } /// - /// Gets the IAlertRuleIncidentsOperations. - /// - IAlertRuleIncidentsOperations AlertRuleIncidents { get; } - - /// - /// Gets the IIncidentsOperations. + /// Gets the IAlertRulesOperations. /// - IIncidentsOperations Incidents { get; } + IAlertRulesOperations AlertRules { get; } /// - /// Gets the IAlertRulesOperations. + /// Gets the IAlertRuleIncidentsOperations. /// - IAlertRulesOperations AlertRules { get; } + IAlertRuleIncidentsOperations AlertRuleIncidents { get; } /// /// Gets the ILogProfilesOperations. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs index 66e2932ec739..7a28c4446f33 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -58,7 +58,7 @@ public partial interface ILogProfilesOperations /// System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update the log profile. + /// Create or update a log profile in Azure Monitoring REST API. /// /// /// The name of the log profile. @@ -81,7 +81,7 @@ public partial interface ILogProfilesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileCreateOrUpdateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileProperties parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// List the log profiles. /// diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs index 77f33eaa8a29..704411d99fe8 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -63,6 +63,6 @@ public partial interface IServiceDiagnosticSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsCreateOrUpdateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettings parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperations.cs deleted file mode 100644 index cc5909d0fb2a..000000000000 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperations.cs +++ /dev/null @@ -1,234 +0,0 @@ -// 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 0.17.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Insights -{ - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - - /// - /// IncidentsOperations operations. - /// - internal partial class IncidentsOperations : Microsoft.Rest.IServiceOperations, IIncidentsOperations - { - /// - /// Initializes a new instance of the IncidentsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal IncidentsOperations(InsightsManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - this.Client = client; - } - - /// - /// Gets a reference to the InsightsManagementClient - /// - public InsightsManagementClient Client { get; private set; } - - /// - /// Gets a list of incidents associated to an alert rule - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the rule. - /// - /// - /// 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 - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (ruleName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2016-03-01"; - // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("ruleName", ruleName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByAlertRule", tracingParameters); - } - // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (this.Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (Newtonsoft.Json.JsonException) - { - // Ignore the exception - } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperationsExtensions.cs deleted file mode 100644 index 1b3181f10c8e..000000000000 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IncidentsOperationsExtensions.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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 0.17.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Insights -{ - using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; - - /// - /// Extension methods for IncidentsOperations. - /// - public static partial class IncidentsOperationsExtensions - { - /// - /// Gets a list of incidents associated to an alert rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the rule. - /// - public static System.Collections.Generic.IEnumerable ListByAlertRule(this IIncidentsOperations operations, string resourceGroupName, string ruleName) - { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IIncidentsOperations)s).ListByAlertRuleAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Gets a list of incidents associated to an alert rule - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the rule. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByAlertRuleAsync(this IIncidentsOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.ListByAlertRuleWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/InsightsManagementClient.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/InsightsManagementClient.cs index 01570596ee8c..2224a854abac 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/InsightsManagementClient.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/InsightsManagementClient.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -71,19 +71,14 @@ public partial class InsightsManagementClient : Microsoft.Rest.ServiceClient - /// Gets the IAlertRuleIncidentsOperations. - /// - public virtual IAlertRuleIncidentsOperations AlertRuleIncidents { get; private set; } - - /// - /// Gets the IIncidentsOperations. + /// Gets the IAlertRulesOperations. /// - public virtual IIncidentsOperations Incidents { get; private set; } + public virtual IAlertRulesOperations AlertRules { get; private set; } /// - /// Gets the IAlertRulesOperations. + /// Gets the IAlertRuleIncidentsOperations. /// - public virtual IAlertRulesOperations AlertRules { get; private set; } + public virtual IAlertRuleIncidentsOperations AlertRuleIncidents { get; private set; } /// /// Gets the ILogProfilesOperations. @@ -293,9 +288,8 @@ private void Initialize() { this.AutoscaleSettings = new AutoscaleSettingsOperations(this); this.ServiceDiagnosticSettings = new ServiceDiagnosticSettingsOperations(this); - this.AlertRuleIncidents = new AlertRuleIncidentsOperations(this); - this.Incidents = new IncidentsOperations(this); this.AlertRules = new AlertRulesOperations(this); + this.AlertRuleIncidents = new AlertRuleIncidentsOperations(this); this.LogProfiles = new LogProfilesOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); this.AcceptLanguage = "en-US"; diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs index d076f415a8c8..491d42133dd4 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -373,7 +373,7 @@ internal LogProfilesOperations(InsightsManagementClient client) } /// - /// Create or update the log profile. + /// Create or update a log profile in Azure Monitoring REST API. /// /// /// The name of the log profile. @@ -399,7 +399,7 @@ internal LogProfilesOperations(InsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileCreateOrUpdateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileProperties parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (logProfileName == null) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs index 59b976d14215..1c663cecaa0c 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -83,7 +83,7 @@ public static LogProfileResource Get(this ILogProfilesOperations operations, str } /// - /// Create or update the log profile. + /// Create or update a log profile in Azure Monitoring REST API. /// /// /// The operations group for this extension method. @@ -94,13 +94,13 @@ public static LogProfileResource Get(this ILogProfilesOperations operations, str /// /// Parameters supplied to the operation. /// - public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileCreateOrUpdateParameters parameters) + public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileProperties parameters) { return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).CreateOrUpdateAsync(logProfileName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } /// - /// Create or update the log profile. + /// Create or update a log profile in Azure Monitoring REST API. /// /// /// The operations group for this extension method. @@ -114,7 +114,7 @@ public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileCreateOrUpdateParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileProperties parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(logProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AlertRuleResource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AlertRuleResource.cs index 5e559255a0dd..b2f354a862e5 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AlertRuleResource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AlertRuleResource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -37,8 +37,8 @@ public AlertRuleResource() { } /// will be included in the alert email. /// the condition that results in the alert /// rule being activated. - /// the actions that are performed when the - /// alert rule becomes active, and when an alert condition is + /// the array of actions that are performed when + /// the alert rule becomes active, and when an alert condition is /// resolved. /// Last time the rule was updated in /// ISO8601 format. @@ -81,8 +81,8 @@ public AlertRuleResource() { } public RuleCondition Condition { get; set; } /// - /// Gets or sets the actions that are performed when the alert rule - /// becomes active, and when an alert condition is resolved. + /// Gets or sets the array of actions that are performed when the alert + /// rule becomes active, and when an alert condition is resolved. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.actions")] public System.Collections.Generic.IList Actions { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleNotification.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleNotification.cs index 549faceaa0ac..63d0e1754530 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleNotification.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleNotification.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -52,7 +52,7 @@ static AutoscaleNotification() public System.Collections.Generic.IList Webhooks { get; set; } /// - /// the operation associated with the notification and it's value must + /// the operation associated with the notification and its value must /// be "scale" /// [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleProfile.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleProfile.cs index cfd286eff0ea..d84a0f6358d1 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleProfile.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleProfile.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -30,8 +30,7 @@ public AutoscaleProfile() { } /// triggers and parameters for the scaling action. A maximum of 10 /// rules can be specified. /// the specific date-time for the profile. - /// This element is not used if the Recurrence element is - /// used. + /// This element is not used if the Recurrence element is used. /// the repeating times at which this profile /// begins. This element is not used if the FixedDate element is /// used. @@ -73,8 +72,8 @@ public AutoscaleProfile() { } public TimeWindow FixedDate { get; set; } /// - /// Gets or sets the repeating times at which this profile begins. - /// This element is not used if the FixedDate element is used. + /// Gets or sets the repeating times at which this profile begins. This + /// element is not used if the FixedDate element is used. /// [Newtonsoft.Json.JsonProperty(PropertyName = "recurrence")] public Recurrence Recurrence { get; set; } @@ -117,6 +116,10 @@ public virtual void Validate() { this.FixedDate.Validate(); } + if (this.Recurrence != null) + { + this.Recurrence.Validate(); + } } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleSettingResource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleSettingResource.cs index 54d6eb80188e..8b8be9eb35e0 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleSettingResource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/AutoscaleSettingResource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -25,9 +25,9 @@ public AutoscaleSettingResource() { } /// Initializes a new instance of the AutoscaleSettingResource class. /// /// Resource location - /// the collection of automatic scaling - /// profiles that specify different scaling parameters for different - /// time periods. A maximum of 20 profiles can be specified. + /// the collection of automatic scaling profiles + /// that specify different scaling parameters for different time + /// periods. A maximum of 20 profiles can be specified. /// the name of the /// autoscale setting. /// Azure resource Id @@ -36,8 +36,9 @@ public AutoscaleSettingResource() { } /// Resource tags /// the collection of /// notifications. - /// the enabled flag. Specifies whether - /// automatic scaling is enabled for the resource. + /// the enabled flag. Specifies whether automatic + /// scaling is enabled for the resource. The default value is + /// 'true'. /// the resource identifier of the /// resource that the autoscale setting should be added to. public AutoscaleSettingResource(string location, System.Collections.Generic.IList profiles, string autoscaleSettingResourceName, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList notifications = default(System.Collections.Generic.IList), bool? enabled = default(bool?), string targetResourceUri = default(string)) @@ -52,8 +53,8 @@ public AutoscaleSettingResource() { } /// /// Gets or sets the collection of automatic scaling profiles that - /// specify different scaling parameters for different time periods. - /// A maximum of 20 profiles can be specified. + /// specify different scaling parameters for different time periods. A + /// maximum of 20 profiles can be specified. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.profiles")] public System.Collections.Generic.IList Profiles { get; set; } @@ -66,7 +67,7 @@ public AutoscaleSettingResource() { } /// /// Gets or sets the enabled flag. Specifies whether automatic scaling - /// is enabled for the resource. + /// is enabled for the resource. The default value is 'true'. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ComparisonOperationType.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ComparisonOperationType.cs index cb372e3fd8ca..3506b4f380a5 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ComparisonOperationType.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ComparisonOperationType.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ConditionOperator.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ConditionOperator.cs index e547f5c9144e..9c6ca37a10f6 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ConditionOperator.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ConditionOperator.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/EmailNotification.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/EmailNotification.cs index 9cf3a8752e6d..a8fa1f179313 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/EmailNotification.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/EmailNotification.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.Insights.Models using System.Linq; /// - /// Email notification. + /// Email notification of an autoscale event. /// public partial class EmailNotification { @@ -25,10 +25,11 @@ public EmailNotification() { } /// /// a value indicating /// whether to send email to subscription administrator. - /// a value - /// indicating whether to send email to subscription - /// co-administrators. - /// the custom email list. + /// a value indicating + /// whether to send email to subscription co-administrators. + /// the custom e-mails list. This value can + /// be null or empty, in which case this attribute will be + /// ignored. public EmailNotification(bool? sendToSubscriptionAdministrator = default(bool?), bool? sendToSubscriptionCoAdministrators = default(bool?), System.Collections.Generic.IList customEmails = default(System.Collections.Generic.IList)) { SendToSubscriptionAdministrator = sendToSubscriptionAdministrator; @@ -51,7 +52,8 @@ public EmailNotification() { } public bool? SendToSubscriptionCoAdministrators { get; set; } /// - /// Gets or sets the custom email list. + /// Gets or sets the custom e-mails list. This value can be null or + /// empty, in which case this attribute will be ignored. /// [Newtonsoft.Json.JsonProperty(PropertyName = "customEmails")] public System.Collections.Generic.IList CustomEmails { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Incident.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Incident.cs index f31f4dc92bcb..eefbe85edb73 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Incident.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Incident.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -31,8 +31,8 @@ public Incident() { } /// The time at which the incident was /// activated in ISO8601 format. /// The time at which the incident was - /// resolved in ISO8601 format. If null, it means the incident is - /// still active. + /// resolved in ISO8601 format. If null, it means the incident is still + /// active. public Incident(string name = default(string), string ruleName = default(string), bool? isActive = default(bool?), System.DateTime? activatedTime = default(System.DateTime?), System.DateTime? resolvedTime = default(System.DateTime?)) { Name = name; @@ -69,8 +69,8 @@ public Incident() { } public System.DateTime? ActivatedTime { get; private set; } /// - /// Gets the time at which the incident was resolved in ISO8601 - /// format. If null, it means the incident is still active. + /// Gets the time at which the incident was resolved in ISO8601 format. + /// If null, it means the incident is still active. /// [Newtonsoft.Json.JsonProperty(PropertyName = "resolvedTime")] public System.DateTime? ResolvedTime { get; private set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LocationThresholdRuleCondition.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LocationThresholdRuleCondition.cs index 6e652879153c..9d55a40f575c 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LocationThresholdRuleCondition.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LocationThresholdRuleCondition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -26,10 +26,11 @@ public LocationThresholdRuleCondition() { } /// Initializes a new instance of the LocationThresholdRuleCondition /// class. /// - /// the number of locations that - /// must fail to activate the alert. + /// the number of locations that must + /// fail to activate the alert. /// the resource from which the rule collects - /// its data. + /// its data. For this type dataSource will always be of type + /// RuleMetricDataSource. /// the period of time (in ISO 8601 duration /// format) that is used to monitor alert activity based on the /// threshold. If specified then it must be between 5 minutes and 1 @@ -43,6 +44,8 @@ public LocationThresholdRuleCondition() { } /// /// Gets or sets the resource from which the rule collects its data. + /// For this type dataSource will always be of type + /// RuleMetricDataSource. /// [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] public RuleDataSource DataSource { get; set; } @@ -56,8 +59,8 @@ public LocationThresholdRuleCondition() { } public System.TimeSpan? WindowSize { get; set; } /// - /// Gets or sets the number of locations that must fail to activate - /// the alert. + /// Gets or sets the number of locations that must fail to activate the + /// alert. /// [Newtonsoft.Json.JsonProperty(PropertyName = "failedLocationCount")] public int FailedLocationCount { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileCreateOrUpdateParameters.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileCreateOrUpdateParameters.cs deleted file mode 100644 index 34d4de6a3441..000000000000 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileCreateOrUpdateParameters.cs +++ /dev/null @@ -1,90 +0,0 @@ -// 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 0.17.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Insights.Models -{ - using System.Linq; - - /// - /// Paramters to create a new Log Profile - /// - [Microsoft.Rest.Serialization.JsonTransformation] - public partial class LogProfileCreateOrUpdateParameters - { - /// - /// Initializes a new instance of the - /// LogProfileCreateOrUpdateParameters class. - /// - public LogProfileCreateOrUpdateParameters() { } - - /// - /// Initializes a new instance of the - /// LogProfileCreateOrUpdateParameters class. - /// - /// the resource id of the storage - /// account. - /// the resource id of the service bus - /// rule. - /// the locations. - /// the categories. - /// the retention policy for this - /// log. - public LogProfileCreateOrUpdateParameters(string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) - { - StorageAccountId = storageAccountId; - ServiceBusRuleId = serviceBusRuleId; - Locations = locations; - Categories = categories; - RetentionPolicy = retentionPolicy; - } - - /// - /// Gets or sets the resource id of the storage account. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] - public string StorageAccountId { get; set; } - - /// - /// Gets or sets the resource id of the service bus rule. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] - public string ServiceBusRuleId { get; set; } - - /// - /// Gets or sets the locations. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.locations")] - public System.Collections.Generic.IList Locations { get; set; } - - /// - /// Gets or sets the categories. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.categories")] - public System.Collections.Generic.IList Categories { get; set; } - - /// - /// Gets or sets the retention policy for this log. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionPolicy")] - public RetentionPolicy RetentionPolicy { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (this.RetentionPolicy != null) - { - this.RetentionPolicy.Validate(); - } - } - } -} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs new file mode 100644 index 000000000000..99f545f7555d --- /dev/null +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs @@ -0,0 +1,110 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Insights.Models +{ + using System.Linq; + + /// + /// The log profile properties. + /// + public partial class LogProfileProperties + { + /// + /// Initializes a new instance of the LogProfileProperties class. + /// + public LogProfileProperties() { } + + /// + /// Initializes a new instance of the LogProfileProperties class. + /// + /// the resource id of the storage + /// account to which you would like to send the Activity Log. + /// List of regions for which Activity Log + /// events should be stored or streamed. It is a comma separated list + /// of valid ARM locations including the 'global' location. + /// The service bus rule ID of the + /// service bus namespace in which you would like to have Event Hubs + /// created for streaming the Activity Log. The rule ID is of the + /// format: '{service bus resource ID}/authorizationrules/{key + /// name}'. + /// the categories of the logs. These + /// categories are created as is convenient to the user. Some values + /// are: 'Write', 'Delete', and/or 'Action.' + /// the retention policy for the events + /// in the log. + public LogProfileProperties(string storageAccountId, System.Collections.Generic.IList locations, string serviceBusRuleId = default(string), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + { + StorageAccountId = storageAccountId; + ServiceBusRuleId = serviceBusRuleId; + Locations = locations; + Categories = categories; + RetentionPolicy = retentionPolicy; + } + + /// + /// Gets or sets the resource id of the storage account to which you + /// would like to send the Activity Log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] + public string StorageAccountId { get; set; } + + /// + /// Gets or sets the service bus rule ID of the service bus namespace + /// in which you would like to have Event Hubs created for streaming + /// the Activity Log. The rule ID is of the format: '{service bus + /// resource ID}/authorizationrules/{key name}'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceBusRuleId")] + public string ServiceBusRuleId { get; set; } + + /// + /// Gets or sets list of regions for which Activity Log events should + /// be stored or streamed. It is a comma separated list of valid ARM + /// locations including the 'global' location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "locations")] + public System.Collections.Generic.IList Locations { get; set; } + + /// + /// Gets or sets the categories of the logs. These categories are + /// created as is convenient to the user. Some values are: 'Write', + /// 'Delete', and/or 'Action.' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "categories")] + public System.Collections.Generic.IList Categories { get; set; } + + /// + /// Gets or sets the retention policy for the events in the log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageAccountId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccountId"); + } + if (Locations == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Locations"); + } + if (this.RetentionPolicy != null) + { + this.RetentionPolicy.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs index aaae36bed4ed..5a888ec626fe 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -25,19 +25,26 @@ public LogProfileResource() { } /// Initializes a new instance of the LogProfileResource class. /// /// Resource location + /// the resource id of the storage + /// account to which you would like to send the Activity Log. + /// List of regions for which Activity Log + /// events should be stored or streamed. It is a comma separated list + /// of valid ARM locations including the 'global' location. /// Azure resource Id /// Azure resource name /// Azure resource type /// Resource tags - /// the resource id of the storage - /// account. - /// the resource id of the service bus - /// rule. - /// the locations. - /// the categories. - /// the retention policy for this - /// log. - public LogProfileResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + /// The service bus rule ID of the + /// service bus namespace in which you would like to have Event Hubs + /// created for streaming the Activity Log. The rule ID is of the + /// format: '{service bus resource ID}/authorizationrules/{key + /// name}'. + /// the categories of the logs. These + /// categories are created as is convenient to the user. Some values + /// are: 'Write', 'Delete', and/or 'Action.' + /// the retention policy for the events + /// in the log. + public LogProfileResource(string location, string storageAccountId, System.Collections.Generic.IList locations, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string serviceBusRuleId = default(string), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) : base(location, id, name, type, tags) { StorageAccountId = storageAccountId; @@ -48,31 +55,39 @@ public LogProfileResource() { } } /// - /// Gets or sets the resource id of the storage account. + /// Gets or sets the resource id of the storage account to which you + /// would like to send the Activity Log. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] public string StorageAccountId { get; set; } /// - /// Gets or sets the resource id of the service bus rule. + /// Gets or sets the service bus rule ID of the service bus namespace + /// in which you would like to have Event Hubs created for streaming + /// the Activity Log. The rule ID is of the format: '{service bus + /// resource ID}/authorizationrules/{key name}'. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] public string ServiceBusRuleId { get; set; } /// - /// Gets or sets the locations. + /// Gets or sets list of regions for which Activity Log events should + /// be stored or streamed. It is a comma separated list of valid ARM + /// locations including the 'global' location. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.locations")] public System.Collections.Generic.IList Locations { get; set; } /// - /// Gets or sets the categories. + /// Gets or sets the categories of the logs. These categories are + /// created as is convenient to the user. Some values are: 'Write', + /// 'Delete', and/or 'Action.' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.categories")] public System.Collections.Generic.IList Categories { get; set; } /// - /// Gets or sets the retention policy for this log. + /// Gets or sets the retention policy for the events in the log. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionPolicy")] public RetentionPolicy RetentionPolicy { get; set; } @@ -86,6 +101,14 @@ public LogProfileResource() { } public override void Validate() { base.Validate(); + if (StorageAccountId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccountId"); + } + if (Locations == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Locations"); + } if (this.RetentionPolicy != null) { this.RetentionPolicy.Validate(); diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogSettings.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogSettings.cs index c9c6d7b1d18e..38e10d17dc59 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogSettings.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogSettings.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -26,8 +26,10 @@ public LogSettings() { } /// /// a value indicating whether this log is /// enabled. - /// the name of the logs to which this setting - /// is applied. + /// Name of a Diagnostic Log category for a + /// resource type this setting is applied to. To obtain the list of + /// Diagnostic Log categories for a resource, first perform a GET + /// diagnostic settings operation. /// the retention policy for this /// log. public LogSettings(bool enabled, string category = default(string), RetentionPolicy retentionPolicy = default(RetentionPolicy)) @@ -38,7 +40,10 @@ public LogSettings() { } } /// - /// Gets or sets the name of the logs to which this setting is applied. + /// Gets or sets name of a Diagnostic Log category for a resource type + /// this setting is applied to. To obtain the list of Diagnostic Log + /// categories for a resource, first perform a GET diagnostic settings + /// operation. /// [Newtonsoft.Json.JsonProperty(PropertyName = "category")] public string Category { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventAggregationCondition.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventAggregationCondition.cs index 10981d654b39..1708cdc91ac5 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventAggregationCondition.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventAggregationCondition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.Insights.Models using System.Linq; /// - /// A management event aggregation condition. + /// How the data that is collected should be combined over time. /// public partial class ManagementEventAggregationCondition { @@ -28,7 +28,8 @@ public ManagementEventAggregationCondition() { } /// the condition operator. Possible /// values include: 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', /// 'LessThanOrEqual' - /// the condition threshold. + /// The threshold value that activates the + /// alert. /// the period of time (in ISO 8601 duration /// format) that is used to monitor alert activity based on the /// threshold. If specified then it must be between 5 minutes and 1 @@ -48,7 +49,7 @@ public ManagementEventAggregationCondition() { } public ConditionOperator? OperatorProperty { get; set; } /// - /// Gets or sets the condition threshold. + /// Gets or sets the threshold value that activates the alert. /// [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] public double? Threshold { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventRuleCondition.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventRuleCondition.cs index 479d873a6016..1b21c7b6001f 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventRuleCondition.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ManagementEventRuleCondition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -27,8 +27,12 @@ public ManagementEventRuleCondition() { } /// class. /// /// the resource from which the rule collects - /// its data. - /// the aggregation condition. + /// its data. For this type dataSource will always be of type + /// RuleManagementEventDataSource. + /// How the data that is collected should be + /// combined over time and when the alert is activated. Note that for + /// management event alerts aggregation is optional – if it is not + /// provided then any event will cause the alert to activate. public ManagementEventRuleCondition(RuleDataSource dataSource = default(RuleDataSource), ManagementEventAggregationCondition aggregation = default(ManagementEventAggregationCondition)) { DataSource = dataSource; @@ -37,12 +41,17 @@ public ManagementEventRuleCondition() { } /// /// Gets or sets the resource from which the rule collects its data. + /// For this type dataSource will always be of type + /// RuleManagementEventDataSource. /// [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] public RuleDataSource DataSource { get; set; } /// - /// Gets or sets the aggregation condition. + /// Gets or sets how the data that is collected should be combined over + /// time and when the alert is activated. Note that for management + /// event alerts aggregation is optional – if it is not provided then + /// any event will cause the alert to activate. /// [Newtonsoft.Json.JsonProperty(PropertyName = "aggregation")] public ManagementEventAggregationCondition Aggregation { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricSettings.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricSettings.cs index 393854390a20..b52b101be9ba 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricSettings.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricSettings.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricStatisticType.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricStatisticType.cs index 9bf801ece6f4..5baf73f84408 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricStatisticType.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricStatisticType.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricTrigger.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricTrigger.cs index 0d5a38a15cf7..db22ded56f7a 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricTrigger.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/MetricTrigger.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -28,8 +28,8 @@ public MetricTrigger() { } /// the resource identifier of the /// resource the rule monitors. /// the granularity of metrics the rule - /// monitors. Must be one of the predefined values returned from - /// metric definitions for the metric. Must be between 12 hours and 1 + /// monitors. Must be one of the predefined values returned from metric + /// definitions for the metric. Must be between 12 hours and 1 /// minute. /// the metric statistic type. How the metrics /// from multiple instances are combined. Possible values include: @@ -42,13 +42,13 @@ public MetricTrigger() { } /// that is collected should be combined over time. The default value /// is Average. Possible values include: 'Average', 'Minimum', /// 'Maximum', 'Total', 'Count' - /// the operator that is used to - /// compare the metric data and the threshold. Possible values - /// include: 'Equals', 'NotEquals', 'GreaterThan', - /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + /// the operator that is used to compare + /// the metric data and the threshold. Possible values include: + /// 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', + /// 'LessThan', 'LessThanOrEqual' /// the threshold of the metric that triggers /// the scale action. - public MetricTrigger(string metricName = default(string), string metricResourceUri = default(string), System.TimeSpan? timeGrain = default(System.TimeSpan?), MetricStatisticType? statistic = default(MetricStatisticType?), System.TimeSpan? timeWindow = default(System.TimeSpan?), TimeAggregationType? timeAggregation = default(TimeAggregationType?), ComparisonOperationType? operatorProperty = default(ComparisonOperationType?), double? threshold = default(double?)) + public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpan timeGrain, MetricStatisticType statistic, System.TimeSpan timeWindow, TimeAggregationType timeAggregation, ComparisonOperationType operatorProperty, double threshold) { MetricName = metricName; MetricResourceUri = metricResourceUri; @@ -80,7 +80,7 @@ public MetricTrigger() { } /// the metric. Must be between 12 hours and 1 minute. /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] - public System.TimeSpan? TimeGrain { get; set; } + public System.TimeSpan TimeGrain { get; set; } /// /// Gets or sets the metric statistic type. How the metrics from @@ -88,41 +88,57 @@ public MetricTrigger() { } /// 'Average', 'Min', 'Max', 'Sum' /// [Newtonsoft.Json.JsonProperty(PropertyName = "statistic")] - public MetricStatisticType? Statistic { get; set; } + public MetricStatisticType Statistic { get; set; } /// - /// Gets or sets the range of time in which instance data is - /// collected. This value must be greater than the delay in metric - /// collection, which can vary from resource-to-resource. Must be - /// between 12 hours and 5 minutes. + /// Gets or sets the range of time in which instance data is collected. + /// This value must be greater than the delay in metric collection, + /// which can vary from resource-to-resource. Must be between 12 hours + /// and 5 minutes. /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeWindow")] - public System.TimeSpan? TimeWindow { get; set; } + public System.TimeSpan TimeWindow { get; set; } /// /// Gets or sets time aggregation type. How the data that is collected /// should be combined over time. The default value is Average. - /// Possible values include: 'Average', 'Minimum', 'Maximum', - /// 'Total', 'Count' + /// Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', + /// 'Count' /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeAggregation")] - public TimeAggregationType? TimeAggregation { get; set; } + public TimeAggregationType TimeAggregation { get; set; } /// /// Gets or sets the operator that is used to compare the metric data - /// and the threshold. Possible values include: 'Equals', - /// 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', - /// 'LessThanOrEqual' + /// and the threshold. Possible values include: 'Equals', 'NotEquals', + /// 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' /// [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] - public ComparisonOperationType? OperatorProperty { get; set; } + public ComparisonOperationType OperatorProperty { get; set; } /// /// Gets or sets the threshold of the metric that triggers the scale /// action. /// [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] - public double? Threshold { get; set; } + public double Threshold { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MetricName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricName"); + } + if (MetricResourceUri == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricResourceUri"); + } + } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page.cs index 25df1fc76e2e..d517340cdb2a 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page1.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page1.cs index 3b1f5b16c6c2..69676959c407 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page1.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Page1.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Recurrence.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Recurrence.cs index 6fc90a148c32..51c2b1dc84f8 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Recurrence.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Recurrence.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -27,11 +27,11 @@ public Recurrence() { } /// the recurrence frequency. How often the /// schedule profile should take effect. This value must be Week, /// meaning each week will have the same set of profiles. Possible - /// values include: 'None', 'Second', 'Minute', 'Hour', 'Day', - /// 'Week', 'Month', 'Year' + /// values include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', + /// 'Month', 'Year' /// the scheduling constraints for when the /// profile begins. - public Recurrence(RecurrenceFrequency? frequency = default(RecurrenceFrequency?), RecurrentSchedule schedule = default(RecurrentSchedule)) + public Recurrence(RecurrenceFrequency frequency, RecurrentSchedule schedule) { Frequency = frequency; Schedule = schedule; @@ -44,7 +44,7 @@ public Recurrence() { } /// 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' /// [Newtonsoft.Json.JsonProperty(PropertyName = "frequency")] - public RecurrenceFrequency? Frequency { get; set; } + public RecurrenceFrequency Frequency { get; set; } /// /// Gets or sets the scheduling constraints for when the profile @@ -53,5 +53,22 @@ public Recurrence() { } [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] public RecurrentSchedule Schedule { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Schedule == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Schedule"); + } + if (this.Schedule != null) + { + this.Schedule.Validate(); + } + } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrenceFrequency.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrenceFrequency.cs index 02b8e51d6f78..81137fd8db6a 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrenceFrequency.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrenceFrequency.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs index d15df2507ec0..780a48b8e485 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -24,16 +24,56 @@ public RecurrentSchedule() { } /// Initializes a new instance of the RecurrentSchedule class. /// /// the time zone for the hours of the profile. - /// See examples of valid timezone ids over here: - /// https://msdn.microsoft.com/en-us/library/azure/dn931928.aspx + /// See examples of valid timezone are: Dateline Standard Time, UTC-11, + /// Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard + /// Time (Mexico), Pacific Standard Time, US Mountain Standard Time, + /// Mountain Standard Time (Mexico), Mountain Standard Time, Central + /// America Standard Time, Central Standard Time, Central Standard Time + /// (Mexico), Canada Central Standard Time, SA Pacific Standard Time, + /// Eastern Standard Time, US Eastern Standard Time, Venezuela Standard + /// Time, Paraguay Standard Time, Atlantic Standard Time, Central + /// Brazilian Standard Time, SA Western Standard Time, Pacific SA + /// Standard Time, Newfoundland Standard Time, E. South America + /// Standard Time, Argentina Standard Time, SA Eastern Standard Time, + /// Greenland Standard Time, Montevideo Standard Time, Bahia Standard + /// Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, + /// Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard + /// Time, Greenwich Standard Time, W. Europe Standard Time, Central + /// Europe Standard Time, Romance Standard Time, Central European + /// Standard Time, W. Central Africa Standard Time, Namibia Standard + /// Time, Jordan Standard Time, GTB Standard Time, Middle East Standard + /// Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard + /// Time, South Africa Standard Time, FLE Standard Time, Turkey + /// Standard Time, Israel Standard Time, Kaliningrad Standard Time, + /// Libya Standard Time, Arabic Standard Time, Arab Standard Time, + /// Belarus Standard Time, Russian Standard Time, E. Africa Standard + /// Time, Iran Standard Time, Arabian Standard Time, Azerbaijan + /// Standard Time, Russia Time Zone 3, Mauritius Standard Time, + /// Georgian Standard Time, Caucasus Standard Time, Afghanistan + /// Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, + /// Pakistan Standard Time, India Standard Time, Sri Lanka Standard + /// Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh + /// Standard Time, N. Central Asia Standard Time, Myanmar Standard + /// Time, SE Asia Standard Time, North Asia Standard Time, China + /// Standard Time, North Asia East Standard Time, Singapore Standard + /// Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar + /// Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk + /// Standard Time, Cen. Australia Standard Time, AUS Central Standard + /// Time, E. Australia Standard Time, AUS Eastern Standard Time, West + /// Pacific Standard Time, Tasmania Standard Time, Magadan Standard + /// Time, Vladivostok Standard Time, Russia Time Zone 10, Central + /// Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + /// Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga + /// Standard Time, Samoa Standard Time, Line Islands Standard + /// Time /// the collection of days that the profile takes /// effect on. Possible values are Sunday through Saturday. /// A collection of hours that the profile takes - /// effect on. Values supported are 0 to 23 on the 24-hour clock - /// (AM/PM times are not supported). + /// effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM + /// times are not supported). /// A collection of minutes at which the profile /// takes effect at. - public RecurrentSchedule(string timeZone = default(string), System.Collections.Generic.IList days = default(System.Collections.Generic.IList), System.Collections.Generic.IList hours = default(System.Collections.Generic.IList), System.Collections.Generic.IList minutes = default(System.Collections.Generic.IList)) + public RecurrentSchedule(string timeZone, System.Collections.Generic.IList days, System.Collections.Generic.IList hours, System.Collections.Generic.IList minutes) { TimeZone = timeZone; Days = days; @@ -43,8 +83,47 @@ public RecurrentSchedule() { } /// /// Gets or sets the time zone for the hours of the profile. See - /// examples of valid timezone ids over here: - /// https://msdn.microsoft.com/en-us/library/azure/dn931928.aspx + /// examples of valid timezone are: Dateline Standard Time, UTC-11, + /// Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard + /// Time (Mexico), Pacific Standard Time, US Mountain Standard Time, + /// Mountain Standard Time (Mexico), Mountain Standard Time, Central + /// America Standard Time, Central Standard Time, Central Standard Time + /// (Mexico), Canada Central Standard Time, SA Pacific Standard Time, + /// Eastern Standard Time, US Eastern Standard Time, Venezuela Standard + /// Time, Paraguay Standard Time, Atlantic Standard Time, Central + /// Brazilian Standard Time, SA Western Standard Time, Pacific SA + /// Standard Time, Newfoundland Standard Time, E. South America + /// Standard Time, Argentina Standard Time, SA Eastern Standard Time, + /// Greenland Standard Time, Montevideo Standard Time, Bahia Standard + /// Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, + /// Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard + /// Time, Greenwich Standard Time, W. Europe Standard Time, Central + /// Europe Standard Time, Romance Standard Time, Central European + /// Standard Time, W. Central Africa Standard Time, Namibia Standard + /// Time, Jordan Standard Time, GTB Standard Time, Middle East Standard + /// Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard + /// Time, South Africa Standard Time, FLE Standard Time, Turkey + /// Standard Time, Israel Standard Time, Kaliningrad Standard Time, + /// Libya Standard Time, Arabic Standard Time, Arab Standard Time, + /// Belarus Standard Time, Russian Standard Time, E. Africa Standard + /// Time, Iran Standard Time, Arabian Standard Time, Azerbaijan + /// Standard Time, Russia Time Zone 3, Mauritius Standard Time, + /// Georgian Standard Time, Caucasus Standard Time, Afghanistan + /// Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, + /// Pakistan Standard Time, India Standard Time, Sri Lanka Standard + /// Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh + /// Standard Time, N. Central Asia Standard Time, Myanmar Standard + /// Time, SE Asia Standard Time, North Asia Standard Time, China + /// Standard Time, North Asia East Standard Time, Singapore Standard + /// Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar + /// Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk + /// Standard Time, Cen. Australia Standard Time, AUS Central Standard + /// Time, E. Australia Standard Time, AUS Eastern Standard Time, West + /// Pacific Standard Time, Tasmania Standard Time, Magadan Standard + /// Time, Vladivostok Standard Time, Russia Time Zone 10, Central + /// Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + /// Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga + /// Standard Time, Samoa Standard Time, Line Islands Standard Time /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] public string TimeZone { get; set; } @@ -58,8 +137,8 @@ public RecurrentSchedule() { } /// /// Gets or sets a collection of hours that the profile takes effect - /// on. Values supported are 0 to 23 on the 24-hour clock (AM/PM - /// times are not supported). + /// on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times + /// are not supported). /// [Newtonsoft.Json.JsonProperty(PropertyName = "hours")] public System.Collections.Generic.IList Hours { get; set; } @@ -71,5 +150,30 @@ public RecurrentSchedule() { } [Newtonsoft.Json.JsonProperty(PropertyName = "minutes")] public System.Collections.Generic.IList Minutes { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TimeZone == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TimeZone"); + } + if (Days == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Days"); + } + if (Hours == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Hours"); + } + if (Minutes == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Minutes"); + } + } } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Resource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Resource.cs index 9bf907afa30e..1844e6ddbda3 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Resource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/Resource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RetentionPolicy.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RetentionPolicy.cs index f222e8052c6b..cc010ea24097 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RetentionPolicy.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RetentionPolicy.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -25,7 +25,8 @@ public RetentionPolicy() { } /// /// a value indicating whether the retention /// policy is enabled. - /// the number of days for the retention. + /// the number of days for the retention in days. A + /// value of 0 will retain the events indefinitely. public RetentionPolicy(bool enabled, int days) { Enabled = enabled; @@ -40,7 +41,8 @@ public RetentionPolicy(bool enabled, int days) public bool Enabled { get; set; } /// - /// Gets or sets the number of days for the retention. + /// Gets or sets the number of days for the retention in days. A value + /// of 0 will retain the events indefinitely. /// [Newtonsoft.Json.JsonProperty(PropertyName = "days")] public int Days { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleAction.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleAction.cs index 69f7cbe41f0d..34e5df7ea29d 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleAction.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleAction.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleCondition.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleCondition.cs index 5ba952be1e4b..fd25240b7bab 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleCondition.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleCondition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleDataSource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleDataSource.cs index ab527d5df44b..3ff121627a2a 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleDataSource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleDataSource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleEmailAction.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleEmailAction.cs index a35175386b77..618f41b22a95 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleEmailAction.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleEmailAction.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -12,7 +12,7 @@ namespace Microsoft.Azure.Management.Insights.Models /// /// Specifies the action to send email when the rule condition is - /// evaluated. + /// evaluated. The discriminator is always RuleEmailAction in this case. /// [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleEmailAction")] public partial class RuleEmailAction : RuleAction @@ -25,12 +25,11 @@ public RuleEmailAction() { } /// /// Initializes a new instance of the RuleEmailAction class. /// - /// the flag to send e-mails to the - /// service owners. Whether the administrators (service and - /// co-adiminstrators) of the service should be notified when the - /// alert is activated. - /// the list of administrator's custom - /// email addresses notifiy of the activation of the alert. + /// Whether the administrators + /// (service and co-adiminstrators) of the service should be notified + /// when the alert is activated. + /// the list of administrator's custom email + /// addresses notifiy of the activation of the alert. public RuleEmailAction(bool? sendToServiceOwners = default(bool?), System.Collections.Generic.IList customEmails = default(System.Collections.Generic.IList)) { SendToServiceOwners = sendToServiceOwners; @@ -38,9 +37,9 @@ public RuleEmailAction() { } } /// - /// Gets or sets the flag to send e-mails to the service owners. - /// Whether the administrators (service and co-adiminstrators) of the - /// service should be notified when the alert is activated. + /// Gets or sets whether the administrators (service and + /// co-adiminstrators) of the service should be notified when the alert + /// is activated. /// [Newtonsoft.Json.JsonProperty(PropertyName = "sendToServiceOwners")] public bool? SendToServiceOwners { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventClaimsDataSource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventClaimsDataSource.cs index 0bd01bdae0d8..7e2acff3deb6 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventClaimsDataSource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventClaimsDataSource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventDataSource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventDataSource.cs index 9a057e10248d..2f4cab87a8be 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventDataSource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleManagementEventDataSource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -11,7 +11,8 @@ namespace Microsoft.Azure.Management.Insights.Models using System.Linq; /// - /// A rule management event data source. + /// A rule management event data source. The discriminator fields is always + /// RuleManagementEventDataSource in this case. /// [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource")] public partial class RuleManagementEventDataSource : RuleDataSource diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleMetricDataSource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleMetricDataSource.cs index 21cbe1f91515..76ced5891bf5 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleMetricDataSource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleMetricDataSource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -11,7 +11,8 @@ namespace Microsoft.Azure.Management.Insights.Models using System.Linq; /// - /// A rule metric data source. + /// A rule metric data source. The discriminator value is always + /// RuleMetricDataSource in this case. /// [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")] public partial class RuleMetricDataSource : RuleDataSource diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleWebhookAction.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleWebhookAction.cs index cb73e3db1f24..f781bdef0b04 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleWebhookAction.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RuleWebhookAction.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -12,7 +12,7 @@ namespace Microsoft.Azure.Management.Insights.Models /// /// Specifies the action to post to service when the rule condition is - /// evaluated. + /// evaluated. The discriminator is always RuleWebhookAction in this case. /// [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleWebhookAction")] public partial class RuleWebhookAction : RuleAction @@ -25,10 +25,11 @@ public RuleWebhookAction() { } /// /// Initializes a new instance of the RuleWebhookAction class. /// - /// the service uri to Post the - /// notitication. + /// the service uri to Post the notitication + /// when the alert activates or resolves. /// the dictionary of custom properties to - /// include with the post operation. + /// include with the post operation. These data are appended to the + /// webhook payload. public RuleWebhookAction(string serviceUri = default(string), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary)) { ServiceUri = serviceUri; @@ -36,14 +37,15 @@ public RuleWebhookAction() { } } /// - /// Gets or sets the service uri to Post the notitication. + /// Gets or sets the service uri to Post the notitication when the + /// alert activates or resolves. /// [Newtonsoft.Json.JsonProperty(PropertyName = "serviceUri")] public string ServiceUri { get; set; } /// /// Gets or sets the dictionary of custom properties to include with - /// the post operation. + /// the post operation. These data are appended to the webhook payload. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public System.Collections.Generic.IDictionary Properties { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleAction.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleAction.cs index 34a500714d8e..e7894a6c3d86 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleAction.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleAction.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -26,25 +26,22 @@ public ScaleAction() { } /// the scale direction. Whether the scaling /// action increases or decreases the number of instances. Possible /// values include: 'None', 'Increase', 'Decrease' + /// the type of action that should occur when the + /// scale rule fires. Possible values include: 'ChangeCount', + /// 'PercentChangeCount', 'ExactCount' /// the amount of time to wait since the last - /// scaling action before this action occurs. It must be between 1 - /// week and 1 minute. + /// scaling action before this action occurs. It must be between 1 week + /// and 1 minute in ISO 8601 format. /// the number of instances that are involved in /// the scaling action. This value must be 1 or greater. The default /// value is 1. - public ScaleAction(ScaleDirection direction, System.TimeSpan cooldown, string value = default(string)) + public ScaleAction(ScaleDirection direction, ScaleType type, System.TimeSpan cooldown, string value = default(string)) { Direction = direction; + Type = type; Value = value; Cooldown = cooldown; } - /// - /// Static constructor for ScaleAction class. - /// - static ScaleAction() - { - Type = "ChangeCount"; - } /// /// Gets or sets the scale direction. Whether the scaling action @@ -54,10 +51,18 @@ static ScaleAction() [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] public ScaleDirection Direction { get; set; } + /// + /// Gets or sets the type of action that should occur when the scale + /// rule fires. Possible values include: 'ChangeCount', + /// 'PercentChangeCount', 'ExactCount' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ScaleType Type { get; set; } + /// /// Gets or sets the number of instances that are involved in the - /// scaling action. This value must be 1 or greater. The default - /// value is 1. + /// scaling action. This value must be 1 or greater. The default value + /// is 1. /// [Newtonsoft.Json.JsonProperty(PropertyName = "value")] public string Value { get; set; } @@ -65,18 +70,11 @@ static ScaleAction() /// /// Gets or sets the amount of time to wait since the last scaling /// action before this action occurs. It must be between 1 week and 1 - /// minute. + /// minute in ISO 8601 format. /// [Newtonsoft.Json.JsonProperty(PropertyName = "cooldown")] public System.TimeSpan Cooldown { get; set; } - /// - /// the type of action that should occur, this must be set to - /// ChangeCount. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public static string Type { get; private set; } - /// /// Validate the object. /// diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleCapacity.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleCapacity.cs index 5d127d6c1895..95b5dbce0dbe 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleCapacity.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleCapacity.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -26,8 +26,8 @@ public ScaleCapacity() { } /// the minimum number of instances for the /// resource. /// the maximum number of instances for the - /// resource. The actual maximum number may be limited by the cores - /// that are available. + /// resource. The actual maximum number of instances is limited by the + /// cores that are available in the subscription. /// the number of instances that will be /// set if metrics are not available for evaluation. The default is /// only used if the current instance count is lower than the @@ -47,8 +47,8 @@ public ScaleCapacity(string minimum, string maximum, string defaultProperty) /// /// Gets or sets the maximum number of instances for the resource. The - /// actual maximum number may be limited by the cores that are - /// available. + /// actual maximum number of instances is limited by the cores that are + /// available in the subscription. /// [Newtonsoft.Json.JsonProperty(PropertyName = "maximum")] public string Maximum { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleDirection.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleDirection.cs index cb4b5ada0ab1..9973ffedc81f 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleDirection.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleDirection.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleRule.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleRule.cs index 4c10c39ae4ba..e495486a0a97 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleRule.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleRule.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -18,21 +18,17 @@ public partial class ScaleRule /// /// Initializes a new instance of the ScaleRule class. /// - public ScaleRule() - { - ScaleAction = new ScaleAction(); - } + public ScaleRule() { } /// /// Initializes a new instance of the ScaleRule class. /// - /// the parameters for the scaling - /// action. /// the trigger that results in a scaling /// action. - public ScaleRule(ScaleAction scaleAction, MetricTrigger metricTrigger = default(MetricTrigger)) + /// the parameters for the scaling + /// action. + public ScaleRule(MetricTrigger metricTrigger, ScaleAction scaleAction) { - ScaleAction = new ScaleAction(); MetricTrigger = metricTrigger; ScaleAction = scaleAction; } @@ -57,10 +53,18 @@ public ScaleRule() /// public virtual void Validate() { + if (MetricTrigger == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricTrigger"); + } if (ScaleAction == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ScaleAction"); } + if (this.MetricTrigger != null) + { + this.MetricTrigger.Validate(); + } if (this.ScaleAction != null) { this.ScaleAction.Validate(); diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleType.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleType.cs new file mode 100644 index 000000000000..f890f163e600 --- /dev/null +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ScaleType.cs @@ -0,0 +1,25 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Insights.Models +{ + + /// + /// Defines values for ScaleType. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ScaleType + { + [System.Runtime.Serialization.EnumMember(Value = "ChangeCount")] + ChangeCount, + [System.Runtime.Serialization.EnumMember(Value = "PercentChangeCount")] + PercentChangeCount, + [System.Runtime.Serialization.EnumMember(Value = "ExactCount")] + ExactCount + } +} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs new file mode 100644 index 000000000000..db506f7427cf --- /dev/null +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs @@ -0,0 +1,86 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Insights.Models +{ + using System.Linq; + + /// + /// The diagnostic settings for service. + /// + public partial class ServiceDiagnosticSettings + { + /// + /// Initializes a new instance of the ServiceDiagnosticSettings class. + /// + public ServiceDiagnosticSettings() { } + + /// + /// Initializes a new instance of the ServiceDiagnosticSettings class. + /// + /// The resource ID of the storage + /// account to which you would like to send Diagnostic Logs. + /// The service bus rule ID of the + /// service bus namespace in which you would like to have Event Hubs + /// created for streaming Diagnostic Logs. The rule ID is of the + /// format: '{service bus resource ID}/authorizationrules/{key + /// name}'. + /// the list of metric settings. + /// the list of logs settings. + /// The workspace ID (resource ID of a Log + /// Analytics workspace) for a Log Analytics workspace to which you + /// would like to send Diagnostic Logs. Example: + /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + public ServiceDiagnosticSettings(string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList metrics = default(System.Collections.Generic.IList), System.Collections.Generic.IList logs = default(System.Collections.Generic.IList), string workspaceId = default(string)) + { + StorageAccountId = storageAccountId; + ServiceBusRuleId = serviceBusRuleId; + Metrics = metrics; + Logs = logs; + WorkspaceId = workspaceId; + } + + /// + /// Gets or sets the resource ID of the storage account to which you + /// would like to send Diagnostic Logs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] + public string StorageAccountId { get; set; } + + /// + /// Gets or sets the service bus rule ID of the service bus namespace + /// in which you would like to have Event Hubs created for streaming + /// Diagnostic Logs. The rule ID is of the format: '{service bus + /// resource ID}/authorizationrules/{key name}'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceBusRuleId")] + public string ServiceBusRuleId { get; set; } + + /// + /// Gets or sets the list of metric settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metrics")] + public System.Collections.Generic.IList Metrics { get; set; } + + /// + /// Gets or sets the list of logs settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "logs")] + public System.Collections.Generic.IList Logs { get; set; } + + /// + /// Gets or sets the workspace ID (resource ID of a Log Analytics + /// workspace) for a Log Analytics workspace to which you would like to + /// send Diagnostic Logs. Example: + /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceId")] + public string WorkspaceId { get; set; } + + } +} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsCreateOrUpdateParameters.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsCreateOrUpdateParameters.cs deleted file mode 100644 index 1389c16bbf6f..000000000000 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsCreateOrUpdateParameters.cs +++ /dev/null @@ -1,76 +0,0 @@ -// 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 0.17.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Insights.Models -{ - using System.Linq; - - /// - /// Parameters supplied to the Create or Update service configuration. - /// - [Microsoft.Rest.Serialization.JsonTransformation] - public partial class ServiceDiagnosticSettingsCreateOrUpdateParameters - { - /// - /// Initializes a new instance of the - /// ServiceDiagnosticSettingsCreateOrUpdateParameters class. - /// - public ServiceDiagnosticSettingsCreateOrUpdateParameters() { } - - /// - /// Initializes a new instance of the - /// ServiceDiagnosticSettingsCreateOrUpdateParameters class. - /// - /// the resource id of the storage - /// account. - /// the id of the service bus - /// rule. - /// the list of metrics. - /// the list of logs. - /// the OMS workspace Id. - public ServiceDiagnosticSettingsCreateOrUpdateParameters(string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList metrics = default(System.Collections.Generic.IList), System.Collections.Generic.IList logs = default(System.Collections.Generic.IList), string workspaceId = default(string)) - { - StorageAccountId = storageAccountId; - ServiceBusRuleId = serviceBusRuleId; - Metrics = metrics; - Logs = logs; - WorkspaceId = workspaceId; - } - - /// - /// Gets or sets the resource id of the storage account. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] - public string StorageAccountId { get; set; } - - /// - /// Gets or sets the id of the service bus rule. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] - public string ServiceBusRuleId { get; set; } - - /// - /// Gets or sets the list of metrics. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.metrics")] - public System.Collections.Generic.IList Metrics { get; set; } - - /// - /// Gets or sets the list of logs. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.logs")] - public System.Collections.Generic.IList Logs { get; set; } - - /// - /// Gets or sets the OMS workspace Id. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceId")] - public string WorkspaceId { get; set; } - - } -} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsResource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsResource.cs index a92eac342214..f69b4b8391e4 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsResource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettingsResource.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -17,27 +17,33 @@ namespace Microsoft.Azure.Management.Insights.Models public partial class ServiceDiagnosticSettingsResource : Resource { /// - /// Initializes a new instance of the - /// ServiceDiagnosticSettingsResource class. + /// Initializes a new instance of the ServiceDiagnosticSettingsResource + /// class. /// public ServiceDiagnosticSettingsResource() { } /// - /// Initializes a new instance of the - /// ServiceDiagnosticSettingsResource class. + /// Initializes a new instance of the ServiceDiagnosticSettingsResource + /// class. /// /// Resource location /// Azure resource Id /// Azure resource name /// Azure resource type /// Resource tags - /// the resource id of the storage - /// account. - /// the id of the service bus - /// rule. - /// the list of metrics. - /// the list of logs. - /// the OMS workspace Id. + /// The resource ID of the storage + /// account to which you would like to send Diagnostic Logs. + /// The service bus rule ID of the + /// service bus namespace in which you would like to have Event Hubs + /// created for streaming Diagnostic Logs. The rule ID is of the + /// format: '{service bus resource ID}/authorizationrules/{key + /// name}'. + /// the list of metric settings. + /// the list of logs settings. + /// The workspace ID (resource ID of a Log + /// Analytics workspace) for a Log Analytics workspace to which you + /// would like to send Diagnostic Logs. Example: + /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 public ServiceDiagnosticSettingsResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList metrics = default(System.Collections.Generic.IList), System.Collections.Generic.IList logs = default(System.Collections.Generic.IList), string workspaceId = default(string)) : base(location, id, name, type, tags) { @@ -49,31 +55,38 @@ public ServiceDiagnosticSettingsResource() { } } /// - /// Gets or sets the resource id of the storage account. + /// Gets or sets the resource ID of the storage account to which you + /// would like to send Diagnostic Logs. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] public string StorageAccountId { get; set; } /// - /// Gets or sets the id of the service bus rule. + /// Gets or sets the service bus rule ID of the service bus namespace + /// in which you would like to have Event Hubs created for streaming + /// Diagnostic Logs. The rule ID is of the format: '{service bus + /// resource ID}/authorizationrules/{key name}'. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] public string ServiceBusRuleId { get; set; } /// - /// Gets or sets the list of metrics. + /// Gets or sets the list of metric settings. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.metrics")] public System.Collections.Generic.IList Metrics { get; set; } /// - /// Gets or sets the list of logs. + /// Gets or sets the list of logs settings. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.logs")] public System.Collections.Generic.IList Logs { get; set; } /// - /// Gets or sets the OMS workspace Id. + /// Gets or sets the workspace ID (resource ID of a Log Analytics + /// workspace) for a Log Analytics workspace to which you would like to + /// send Diagnostic Logs. Example: + /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceId")] public string WorkspaceId { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ThresholdRuleCondition.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ThresholdRuleCondition.cs index 9c292a138c21..fcb1be4f4d06 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ThresholdRuleCondition.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ThresholdRuleCondition.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -30,17 +30,18 @@ public ThresholdRuleCondition() { } /// the threshold value that activates the /// alert. /// the resource from which the rule collects - /// its data. + /// its data. For this type dataSource will always be of type + /// RuleMetricDataSource. /// the period of time (in ISO 8601 duration /// format) that is used to monitor alert activity based on the /// threshold. If specified then it must be between 5 minutes and 1 /// day. /// the time aggregation operator. How - /// the data that is collected should be combined over time. The - /// default value is the PrimaryAggregationType of the Metric. - /// Possible values include: 'Average', 'Minimum', 'Maximum', - /// 'Total', 'Last' - public ThresholdRuleCondition(ConditionOperator? operatorProperty, double threshold, RuleDataSource dataSource = default(RuleDataSource), System.TimeSpan? windowSize = default(System.TimeSpan?), TimeAggregationOperator? timeAggregation = default(TimeAggregationOperator?)) + /// the data that are collected should be combined over time. The + /// default value is the PrimaryAggregationType of the Metric. Possible + /// values include: 'Average', 'Minimum', 'Maximum', 'Total', + /// 'Last' + public ThresholdRuleCondition(ConditionOperator operatorProperty, double threshold, RuleDataSource dataSource = default(RuleDataSource), System.TimeSpan? windowSize = default(System.TimeSpan?), TimeAggregationOperator? timeAggregation = default(TimeAggregationOperator?)) { DataSource = dataSource; OperatorProperty = operatorProperty; @@ -51,6 +52,8 @@ public ThresholdRuleCondition() { } /// /// Gets or sets the resource from which the rule collects its data. + /// For this type dataSource will always be of type + /// RuleMetricDataSource. /// [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] public RuleDataSource DataSource { get; set; } @@ -61,7 +64,7 @@ public ThresholdRuleCondition() { } /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' /// [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] - public ConditionOperator? OperatorProperty { get; set; } + public ConditionOperator OperatorProperty { get; set; } /// /// Gets or sets the threshold value that activates the alert. @@ -78,7 +81,7 @@ public ThresholdRuleCondition() { } public System.TimeSpan? WindowSize { get; set; } /// - /// Gets or sets the time aggregation operator. How the data that is + /// Gets or sets the time aggregation operator. How the data that are /// collected should be combined over time. The default value is the /// PrimaryAggregationType of the Metric. Possible values include: /// 'Average', 'Minimum', 'Maximum', 'Total', 'Last' diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationOperator.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationOperator.cs index 729d3ca1ba1b..4b09fee4ab69 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationOperator.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationOperator.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationType.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationType.cs index be5a5ce8af00..25d280cab005 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationType.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeAggregationType.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs index 494215c80ee9..e55989d4ae59 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -11,8 +11,7 @@ namespace Microsoft.Azure.Management.Insights.Models using System.Linq; /// - /// A specific date-time for the profile. This element is not used if the - /// Recurrence element is used. + /// A specific date-time for the profile. /// public partial class TimeWindow { @@ -28,8 +27,8 @@ public TimeWindow() { } /// format. /// the end time for the profile in ISO 8601 /// format. - /// the time zone of the start and end times - /// for the profile. See examples of valid timezone ids over here: + /// the time zone of the start and end times for + /// the profile. See examples of valid timezone ids over here: /// https://msdn.microsoft.com/en-us/library/azure/dn931928.aspx public TimeWindow(System.DateTime start, System.DateTime end, string timeZone = default(string)) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/WebhookNotification.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/WebhookNotification.cs index 9e218e7a1091..f05ac63ec22b 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/WebhookNotification.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/WebhookNotification.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.Insights.Models using System.Linq; /// - /// Webhook notification. + /// Webhook notification of an autoscale event. /// public partial class WebhookNotification { @@ -25,7 +25,8 @@ public WebhookNotification() { } /// /// the service address to receive the /// notification. - /// a property bag of settings. + /// a property bag of settings. This value can + /// be empty. public WebhookNotification(string serviceUri = default(string), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary)) { ServiceUri = serviceUri; @@ -39,7 +40,7 @@ public WebhookNotification() { } public string ServiceUri { get; set; } /// - /// Gets or sets a property bag of settings. + /// Gets or sets a property bag of settings. This value can be empty. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public System.Collections.Generic.IDictionary Properties { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs index dbd798b75e83..c47819c434d4 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -248,7 +248,7 @@ internal ServiceDiagnosticSettingsOperations(InsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsCreateOrUpdateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettings parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceUri == null) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs index 5e9f69874543..fef4c7c130e0 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for // license information. // -// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -63,7 +63,7 @@ public static ServiceDiagnosticSettingsResource Get(this IServiceDiagnosticSetti /// /// Parameters supplied to the operation. /// - public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsCreateOrUpdateParameters parameters) + public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettings parameters) { return System.Threading.Tasks.Task.Factory.StartNew(s => ((IServiceDiagnosticSettingsOperations)s).CreateOrUpdateAsync(resourceUri, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } @@ -83,7 +83,7 @@ public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiag /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsCreateOrUpdateParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettings parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceUri, parameters, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/error.txt b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/error.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd index cff85f5ccaae..b608e371e8ff 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd @@ -5,7 +5,7 @@ @echo off -set autoRestVersion=0.17.0-Nightly20160914 +set autoRestVersion=1.0.0-Nightly20161116 if "%1" == "" ( set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/insights/compositeInsightsClient.json" ) else ( diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/project.json b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/project.json index 7150c5b2002a..1ad2eee3ed7f 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/project.json +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/project.json @@ -1,5 +1,5 @@ { - "version": "0.14.0-preview", + "version": "0.14.1-preview", "description": "Microsoft Azure Insights Library", "authors": [ "Microsoft" ], @@ -18,8 +18,8 @@ "keyFile": "../../../../tools/MSSharedLibKey.snk" }, "dependencies": { - "Microsoft.Rest.ClientRuntime.Azure": "[3.3.1,4.0.0)", - "Microsoft.Rest.ClientRuntime": "[2.3.2,3.0.0)" + "Microsoft.Rest.ClientRuntime.Azure": "[3.3.3,4.0.0)", + "Microsoft.Rest.ClientRuntime": "[2.3.3,3.0.0)" }, "frameworks": { From b92ea8320e26dbe88f58834c172098fffe43e1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Tue, 22 Nov 2016 14:35:42 -0800 Subject: [PATCH 2/8] Changes derived from Swagger Spec modifications and bug fixes --- .../BasicTests/LogProfilesTests.cs | 7 +- .../Insights.Tests/BasicTests/MetricsTests.cs | 4 +- .../ServiceDiagnosticSettingsTests.cs | 7 +- .../Insights/MetricDefinitionsOperations.cs | 5 - .../Generated/Insights/MetricsOperations.cs | 5 - .../Insights/ILogProfilesOperations.cs | 2 +- .../IServiceDiagnosticSettingsOperations.cs | 2 +- .../Insights/LogProfilesOperations.cs | 2 +- .../LogProfilesOperationsExtensions.cs | 4 +- .../Insights/Models/LogProfileProperties.cs | 110 ------------------ .../Models/ServiceDiagnosticSettings.cs | 86 -------------- .../ServiceDiagnosticSettingsOperations.cs | 6 +- ...eDiagnosticSettingsOperationsExtensions.cs | 4 +- 13 files changed, 22 insertions(+), 222 deletions(-) delete mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs delete mode 100644 src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs diff --git a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs index 3a852c509a48..9a75e7fccc61 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs +++ b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/LogProfilesTests.cs @@ -127,9 +127,9 @@ private static LogProfileResource CreateLogProfile() }; } - private static LogProfileProperties CreateLogProfileParams() + private static LogProfileResource CreateLogProfileParams() { - return new LogProfileProperties + return new LogProfileResource { StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/sb1/authorizationrules/ar1", @@ -139,7 +139,8 @@ private static LogProfileProperties CreateLogProfileParams() { Days = 4, Enabled = true, - } + }, + Location = "" }; } diff --git a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/MetricsTests.cs b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/MetricsTests.cs index ce61ca67fc15..daa0f9544cdd 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/MetricsTests.cs +++ b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/MetricsTests.cs @@ -82,7 +82,7 @@ private IList GetMetricCollection(string resourceId) Count = 1, Maximum = 10.0, Minimum = 10.0, - Timestamp = DateTime.Parse("2014-08-20T12:15:23.00Z"), + TimeStamp = DateTime.Parse("2014-08-20T12:15:23.00Z"), Total = 10.0 } } @@ -126,7 +126,7 @@ private void AreEqual(MetricValue exp, MetricValue act) Assert.Equal(exp.Count, act.Count); Assert.Equal(exp.Maximum, act.Maximum); Assert.Equal(exp.Minimum, act.Minimum); - Assert.Equal(exp.Timestamp.ToUniversalTime(), act.Timestamp.ToUniversalTime()); + Assert.Equal(exp.TimeStamp.ToUniversalTime(), act.TimeStamp.ToUniversalTime()); Assert.Equal(exp.Total, act.Total); } } diff --git a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs index 49ea9aa753c9..6ac6a8173d99 100644 --- a/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs +++ b/src/ResourceManagement/Insights/Insights.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs @@ -68,9 +68,9 @@ public void LogProfiles_GetTest() AreEqual(expResponse, actualResponse); } - private static ServiceDiagnosticSettings CreateDiagnosticSettingsParams() + private static ServiceDiagnosticSettingsResource CreateDiagnosticSettingsParams() { - return new ServiceDiagnosticSettings + return new ServiceDiagnosticSettingsResource { StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/ns1/authorizationRules/authrule", @@ -98,7 +98,8 @@ private static ServiceDiagnosticSettings CreateDiagnosticSettingsParams() }, TimeGrain = TimeSpan.FromMinutes(1) } - } + }, + Location = "" }; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs index 36cbfeb8e089..6048f464bc63 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricDefinitionsOperations.cs @@ -79,10 +79,6 @@ internal MetricDefinitionsOperations(InsightsClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -101,7 +97,6 @@ internal MetricDefinitionsOperations(InsightsClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metricDefinitions").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs index f05009ac6dfc..8fb8636cf89d 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Insights/MetricsOperations.cs @@ -88,10 +88,6 @@ internal MetricsOperations(InsightsClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2016-09-01"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -110,7 +106,6 @@ internal MetricsOperations(InsightsClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metrics").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (odataQuery != null) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs index 7a28c4446f33..92d006d4d42b 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ILogProfilesOperations.cs @@ -81,7 +81,7 @@ public partial interface ILogProfilesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileProperties parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// List the log profiles. /// diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs index 704411d99fe8..864608358b26 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/IServiceDiagnosticSettingsOperations.cs @@ -63,6 +63,6 @@ public partial interface IServiceDiagnosticSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettings parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs index 491d42133dd4..cc289689cbd0 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperations.cs @@ -399,7 +399,7 @@ internal LogProfilesOperations(InsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileProperties parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (logProfileName == null) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs index 1c663cecaa0c..0582e546bb47 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/LogProfilesOperationsExtensions.cs @@ -94,7 +94,7 @@ public static LogProfileResource Get(this ILogProfilesOperations operations, str /// /// Parameters supplied to the operation. /// - public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileProperties parameters) + public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters) { return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).CreateOrUpdateAsync(logProfileName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } @@ -114,7 +114,7 @@ public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileProperties parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(logProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) { diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs deleted file mode 100644 index 99f545f7555d..000000000000 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileProperties.cs +++ /dev/null @@ -1,110 +0,0 @@ -// 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 1.0.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Insights.Models -{ - using System.Linq; - - /// - /// The log profile properties. - /// - public partial class LogProfileProperties - { - /// - /// Initializes a new instance of the LogProfileProperties class. - /// - public LogProfileProperties() { } - - /// - /// Initializes a new instance of the LogProfileProperties class. - /// - /// the resource id of the storage - /// account to which you would like to send the Activity Log. - /// List of regions for which Activity Log - /// events should be stored or streamed. It is a comma separated list - /// of valid ARM locations including the 'global' location. - /// The service bus rule ID of the - /// service bus namespace in which you would like to have Event Hubs - /// created for streaming the Activity Log. The rule ID is of the - /// format: '{service bus resource ID}/authorizationrules/{key - /// name}'. - /// the categories of the logs. These - /// categories are created as is convenient to the user. Some values - /// are: 'Write', 'Delete', and/or 'Action.' - /// the retention policy for the events - /// in the log. - public LogProfileProperties(string storageAccountId, System.Collections.Generic.IList locations, string serviceBusRuleId = default(string), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) - { - StorageAccountId = storageAccountId; - ServiceBusRuleId = serviceBusRuleId; - Locations = locations; - Categories = categories; - RetentionPolicy = retentionPolicy; - } - - /// - /// Gets or sets the resource id of the storage account to which you - /// would like to send the Activity Log. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] - public string StorageAccountId { get; set; } - - /// - /// Gets or sets the service bus rule ID of the service bus namespace - /// in which you would like to have Event Hubs created for streaming - /// the Activity Log. The rule ID is of the format: '{service bus - /// resource ID}/authorizationrules/{key name}'. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "serviceBusRuleId")] - public string ServiceBusRuleId { get; set; } - - /// - /// Gets or sets list of regions for which Activity Log events should - /// be stored or streamed. It is a comma separated list of valid ARM - /// locations including the 'global' location. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "locations")] - public System.Collections.Generic.IList Locations { get; set; } - - /// - /// Gets or sets the categories of the logs. These categories are - /// created as is convenient to the user. Some values are: 'Write', - /// 'Delete', and/or 'Action.' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "categories")] - public System.Collections.Generic.IList Categories { get; set; } - - /// - /// Gets or sets the retention policy for the events in the log. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] - public RetentionPolicy RetentionPolicy { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (StorageAccountId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccountId"); - } - if (Locations == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Locations"); - } - if (this.RetentionPolicy != null) - { - this.RetentionPolicy.Validate(); - } - } - } -} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs deleted file mode 100644 index db506f7427cf..000000000000 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/ServiceDiagnosticSettings.cs +++ /dev/null @@ -1,86 +0,0 @@ -// 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 1.0.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.Insights.Models -{ - using System.Linq; - - /// - /// The diagnostic settings for service. - /// - public partial class ServiceDiagnosticSettings - { - /// - /// Initializes a new instance of the ServiceDiagnosticSettings class. - /// - public ServiceDiagnosticSettings() { } - - /// - /// Initializes a new instance of the ServiceDiagnosticSettings class. - /// - /// The resource ID of the storage - /// account to which you would like to send Diagnostic Logs. - /// The service bus rule ID of the - /// service bus namespace in which you would like to have Event Hubs - /// created for streaming Diagnostic Logs. The rule ID is of the - /// format: '{service bus resource ID}/authorizationrules/{key - /// name}'. - /// the list of metric settings. - /// the list of logs settings. - /// The workspace ID (resource ID of a Log - /// Analytics workspace) for a Log Analytics workspace to which you - /// would like to send Diagnostic Logs. Example: - /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 - public ServiceDiagnosticSettings(string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList metrics = default(System.Collections.Generic.IList), System.Collections.Generic.IList logs = default(System.Collections.Generic.IList), string workspaceId = default(string)) - { - StorageAccountId = storageAccountId; - ServiceBusRuleId = serviceBusRuleId; - Metrics = metrics; - Logs = logs; - WorkspaceId = workspaceId; - } - - /// - /// Gets or sets the resource ID of the storage account to which you - /// would like to send Diagnostic Logs. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] - public string StorageAccountId { get; set; } - - /// - /// Gets or sets the service bus rule ID of the service bus namespace - /// in which you would like to have Event Hubs created for streaming - /// Diagnostic Logs. The rule ID is of the format: '{service bus - /// resource ID}/authorizationrules/{key name}'. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "serviceBusRuleId")] - public string ServiceBusRuleId { get; set; } - - /// - /// Gets or sets the list of metric settings. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metrics")] - public System.Collections.Generic.IList Metrics { get; set; } - - /// - /// Gets or sets the list of logs settings. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "logs")] - public System.Collections.Generic.IList Logs { get; set; } - - /// - /// Gets or sets the workspace ID (resource ID of a Log Analytics - /// workspace) for a Log Analytics workspace to which you would like to - /// send Diagnostic Logs. Example: - /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "workspaceId")] - public string WorkspaceId { get; set; } - - } -} diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs index c47819c434d4..24d85a39b6b9 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperations.cs @@ -248,7 +248,7 @@ internal ServiceDiagnosticSettingsOperations(InsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettings parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (resourceUri == null) { @@ -258,6 +258,10 @@ internal ServiceDiagnosticSettingsOperations(InsightsManagementClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs index fef4c7c130e0..aa8b53d811cc 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/ServiceDiagnosticSettingsOperationsExtensions.cs @@ -63,7 +63,7 @@ public static ServiceDiagnosticSettingsResource Get(this IServiceDiagnosticSetti /// /// Parameters supplied to the operation. /// - public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettings parameters) + public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters) { return System.Threading.Tasks.Task.Factory.StartNew(s => ((IServiceDiagnosticSettingsOperations)s).CreateOrUpdateAsync(resourceUri, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); } @@ -83,7 +83,7 @@ public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiag /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettings parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceUri, parameters, null, cancellationToken).ConfigureAwait(false)) { From 1075827778e376c6d0653e1f7b472e865d59c708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Mon, 28 Nov 2016 10:21:47 -0800 Subject: [PATCH 3/8] Improvements in documentation and adding a reference to a commit in the generate.cmd file --- .../Insights/Models/RecurrentSchedule.cs | 58 ++++++------ .../Management/Insights/Models/TimeWindow.cs | 91 +++++++++++++++++-- .../Microsoft.Azure.Insights/generate.cmd | 7 +- 3 files changed, 118 insertions(+), 38 deletions(-) diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs index 780a48b8e485..4f90a5a2b31f 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/RecurrentSchedule.cs @@ -23,33 +23,33 @@ public RecurrentSchedule() { } /// /// Initializes a new instance of the RecurrentSchedule class. /// - /// the time zone for the hours of the profile. - /// See examples of valid timezone are: Dateline Standard Time, UTC-11, - /// Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard - /// Time (Mexico), Pacific Standard Time, US Mountain Standard Time, - /// Mountain Standard Time (Mexico), Mountain Standard Time, Central - /// America Standard Time, Central Standard Time, Central Standard Time - /// (Mexico), Canada Central Standard Time, SA Pacific Standard Time, - /// Eastern Standard Time, US Eastern Standard Time, Venezuela Standard - /// Time, Paraguay Standard Time, Atlantic Standard Time, Central - /// Brazilian Standard Time, SA Western Standard Time, Pacific SA - /// Standard Time, Newfoundland Standard Time, E. South America - /// Standard Time, Argentina Standard Time, SA Eastern Standard Time, - /// Greenland Standard Time, Montevideo Standard Time, Bahia Standard - /// Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, - /// Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard - /// Time, Greenwich Standard Time, W. Europe Standard Time, Central - /// Europe Standard Time, Romance Standard Time, Central European - /// Standard Time, W. Central Africa Standard Time, Namibia Standard - /// Time, Jordan Standard Time, GTB Standard Time, Middle East Standard - /// Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard - /// Time, South Africa Standard Time, FLE Standard Time, Turkey - /// Standard Time, Israel Standard Time, Kaliningrad Standard Time, - /// Libya Standard Time, Arabic Standard Time, Arab Standard Time, - /// Belarus Standard Time, Russian Standard Time, E. Africa Standard - /// Time, Iran Standard Time, Arabian Standard Time, Azerbaijan - /// Standard Time, Russia Time Zone 3, Mauritius Standard Time, - /// Georgian Standard Time, Caucasus Standard Time, Afghanistan + /// the timezone for the hours of the profile. + /// Some examples of valid timezones are: Dateline Standard Time, + /// UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific + /// Standard Time (Mexico), Pacific Standard Time, US Mountain Standard + /// Time, Mountain Standard Time (Mexico), Mountain Standard Time, + /// Central America Standard Time, Central Standard Time, Central + /// Standard Time (Mexico), Canada Central Standard Time, SA Pacific + /// Standard Time, Eastern Standard Time, US Eastern Standard Time, + /// Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard + /// Time, Central Brazilian Standard Time, SA Western Standard Time, + /// Pacific SA Standard Time, Newfoundland Standard Time, E. South + /// America Standard Time, Argentina Standard Time, SA Eastern Standard + /// Time, Greenland Standard Time, Montevideo Standard Time, Bahia + /// Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard + /// Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT + /// Standard Time, Greenwich Standard Time, W. Europe Standard Time, + /// Central Europe Standard Time, Romance Standard Time, Central + /// European Standard Time, W. Central Africa Standard Time, Namibia + /// Standard Time, Jordan Standard Time, GTB Standard Time, Middle East + /// Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe + /// Standard Time, South Africa Standard Time, FLE Standard Time, + /// Turkey Standard Time, Israel Standard Time, Kaliningrad Standard + /// Time, Libya Standard Time, Arabic Standard Time, Arab Standard + /// Time, Belarus Standard Time, Russian Standard Time, E. Africa + /// Standard Time, Iran Standard Time, Arabian Standard Time, + /// Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard + /// Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan /// Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, /// Pakistan Standard Time, India Standard Time, Sri Lanka Standard /// Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh @@ -82,8 +82,8 @@ public RecurrentSchedule(string timeZone, System.Collections.Generic.IList - /// Gets or sets the time zone for the hours of the profile. See - /// examples of valid timezone are: Dateline Standard Time, UTC-11, + /// Gets or sets the timezone for the hours of the profile. Some + /// examples of valid timezones are: Dateline Standard Time, UTC-11, /// Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard /// Time (Mexico), Pacific Standard Time, US Mountain Standard Time, /// Mountain Standard Time (Mexico), Mountain Standard Time, Central diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs index e55989d4ae59..900dd61616f2 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/TimeWindow.cs @@ -27,9 +27,49 @@ public TimeWindow() { } /// format. /// the end time for the profile in ISO 8601 /// format. - /// the time zone of the start and end times for - /// the profile. See examples of valid timezone ids over here: - /// https://msdn.microsoft.com/en-us/library/azure/dn931928.aspx + /// the timezone of the start and end times for + /// the profile. Some examples of valid timezones are: Dateline + /// Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard + /// Time, Pacific Standard Time (Mexico), Pacific Standard Time, US + /// Mountain Standard Time, Mountain Standard Time (Mexico), Mountain + /// Standard Time, Central America Standard Time, Central Standard + /// Time, Central Standard Time (Mexico), Canada Central Standard Time, + /// SA Pacific Standard Time, Eastern Standard Time, US Eastern + /// Standard Time, Venezuela Standard Time, Paraguay Standard Time, + /// Atlantic Standard Time, Central Brazilian Standard Time, SA Western + /// Standard Time, Pacific SA Standard Time, Newfoundland Standard + /// Time, E. South America Standard Time, Argentina Standard Time, SA + /// Eastern Standard Time, Greenland Standard Time, Montevideo Standard + /// Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, + /// Azores Standard Time, Cape Verde Standard Time, Morocco Standard + /// Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe + /// Standard Time, Central Europe Standard Time, Romance Standard Time, + /// Central European Standard Time, W. Central Africa Standard Time, + /// Namibia Standard Time, Jordan Standard Time, GTB Standard Time, + /// Middle East Standard Time, Egypt Standard Time, Syria Standard + /// Time, E. Europe Standard Time, South Africa Standard Time, FLE + /// Standard Time, Turkey Standard Time, Israel Standard Time, + /// Kaliningrad Standard Time, Libya Standard Time, Arabic Standard + /// Time, Arab Standard Time, Belarus Standard Time, Russian Standard + /// Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard + /// Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius + /// Standard Time, Georgian Standard Time, Caucasus Standard Time, + /// Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg + /// Standard Time, Pakistan Standard Time, India Standard Time, Sri + /// Lanka Standard Time, Nepal Standard Time, Central Asia Standard + /// Time, Bangladesh Standard Time, N. Central Asia Standard Time, + /// Myanmar Standard Time, SE Asia Standard Time, North Asia Standard + /// Time, China Standard Time, North Asia East Standard Time, Singapore + /// Standard Time, W. Australia Standard Time, Taipei Standard Time, + /// Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard + /// Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS + /// Central Standard Time, E. Australia Standard Time, AUS Eastern + /// Standard Time, West Pacific Standard Time, Tasmania Standard Time, + /// Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone + /// 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand + /// Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, + /// Tonga Standard Time, Samoa Standard Time, Line Islands Standard + /// Time public TimeWindow(System.DateTime start, System.DateTime end, string timeZone = default(string)) { TimeZone = timeZone; @@ -38,9 +78,48 @@ public TimeWindow() { } } /// - /// Gets or sets the time zone of the start and end times for the - /// profile. See examples of valid timezone ids over here: - /// https://msdn.microsoft.com/en-us/library/azure/dn931928.aspx + /// Gets or sets the timezone of the start and end times for the + /// profile. Some examples of valid timezones are: Dateline Standard + /// Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, + /// Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain + /// Standard Time, Mountain Standard Time (Mexico), Mountain Standard + /// Time, Central America Standard Time, Central Standard Time, Central + /// Standard Time (Mexico), Canada Central Standard Time, SA Pacific + /// Standard Time, Eastern Standard Time, US Eastern Standard Time, + /// Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard + /// Time, Central Brazilian Standard Time, SA Western Standard Time, + /// Pacific SA Standard Time, Newfoundland Standard Time, E. South + /// America Standard Time, Argentina Standard Time, SA Eastern Standard + /// Time, Greenland Standard Time, Montevideo Standard Time, Bahia + /// Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard + /// Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT + /// Standard Time, Greenwich Standard Time, W. Europe Standard Time, + /// Central Europe Standard Time, Romance Standard Time, Central + /// European Standard Time, W. Central Africa Standard Time, Namibia + /// Standard Time, Jordan Standard Time, GTB Standard Time, Middle East + /// Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe + /// Standard Time, South Africa Standard Time, FLE Standard Time, + /// Turkey Standard Time, Israel Standard Time, Kaliningrad Standard + /// Time, Libya Standard Time, Arabic Standard Time, Arab Standard + /// Time, Belarus Standard Time, Russian Standard Time, E. Africa + /// Standard Time, Iran Standard Time, Arabian Standard Time, + /// Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard + /// Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan + /// Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, + /// Pakistan Standard Time, India Standard Time, Sri Lanka Standard + /// Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh + /// Standard Time, N. Central Asia Standard Time, Myanmar Standard + /// Time, SE Asia Standard Time, North Asia Standard Time, China + /// Standard Time, North Asia East Standard Time, Singapore Standard + /// Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar + /// Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk + /// Standard Time, Cen. Australia Standard Time, AUS Central Standard + /// Time, E. Australia Standard Time, AUS Eastern Standard Time, West + /// Pacific Standard Time, Tasmania Standard Time, Magadan Standard + /// Time, Vladivostok Standard Time, Russia Time Zone 10, Central + /// Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + /// Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga + /// Standard Time, Samoa Standard Time, Line Islands Standard Time /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] public string TimeZone { get; set; } diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd index b608e371e8ff..20be0457d8e5 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/generate.cmd @@ -7,7 +7,7 @@ @echo off set autoRestVersion=1.0.0-Nightly20161116 if "%1" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/insights/compositeInsightsClient.json" + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1f823636981e779b6d4155aa18d042146e1270fb/insights/compositeInsightsClient.json" ) else ( set specFile="%1" ) @@ -18,7 +18,7 @@ if exist %generateFolder% rd /S /Q %generateFolder% call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Insights %autoRestVersion% %generateFolder% "-FT 1" if "%2" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-insights/compositeInsightsManagementClient.json" + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1f823636981e779b6d4155aa18d042146e1270fb/arm-insights/compositeInsightsManagementClient.json" ) else ( set specFile="%2" ) @@ -26,4 +26,5 @@ if "%2" == "" ( set generateFolder=%~dp0Generated\Management\Insights if exist %generateFolder% rd /S /Q %generateFolder% -call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Management.Insights %autoRestVersion% %generateFolder% "-FT 1" \ No newline at end of file +call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Management.Insights %autoRestVersion% %generateFolder% "-FT 1" + \ No newline at end of file From b4b67aaa8e5eb28763cc3257930b28d0de82d8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Tue, 29 Nov 2016 16:07:50 -0800 Subject: [PATCH 4/8] Making StorageAccountId optional in LogProfileResource --- .../Management/Insights/Models/LogProfileResource.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs index 5a888ec626fe..0ebeb90cb615 100644 --- a/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs +++ b/src/ResourceManagement/Insights/Microsoft.Azure.Insights/Generated/Management/Insights/Models/LogProfileResource.cs @@ -25,8 +25,6 @@ public LogProfileResource() { } /// Initializes a new instance of the LogProfileResource class. /// /// Resource location - /// the resource id of the storage - /// account to which you would like to send the Activity Log. /// List of regions for which Activity Log /// events should be stored or streamed. It is a comma separated list /// of valid ARM locations including the 'global' location. @@ -34,6 +32,8 @@ public LogProfileResource() { } /// Azure resource name /// Azure resource type /// Resource tags + /// the resource id of the storage + /// account to which you would like to send the Activity Log. /// The service bus rule ID of the /// service bus namespace in which you would like to have Event Hubs /// created for streaming the Activity Log. The rule ID is of the @@ -44,7 +44,7 @@ public LogProfileResource() { } /// are: 'Write', 'Delete', and/or 'Action.' /// the retention policy for the events /// in the log. - public LogProfileResource(string location, string storageAccountId, System.Collections.Generic.IList locations, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string serviceBusRuleId = default(string), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + public LogProfileResource(string location, System.Collections.Generic.IList locations, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) : base(location, id, name, type, tags) { StorageAccountId = storageAccountId; @@ -101,10 +101,6 @@ public LogProfileResource() { } public override void Validate() { base.Validate(); - if (StorageAccountId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccountId"); - } if (Locations == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Locations"); From f6582a2ce1f6d9f1ea51bcf9fd7e11237b006d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Wed, 15 Feb 2017 17:02:53 -0800 Subject: [PATCH 5/8] First generation of Monitor --- global.json | 3 +- .../Monitor/AlertRuleIncidentsOperations.cs | 432 ++++++++ .../AlertRuleIncidentsOperationsExtensions.cs | 107 ++ .../Monitor/AlertRulesOperations.cs | 813 +++++++++++++++ .../Monitor/AlertRulesOperationsExtensions.cs | 188 ++++ .../Monitor/AutoscaleSettingsOperations.cs | 979 ++++++++++++++++++ .../AutoscaleSettingsOperationsExtensions.cs | 218 ++++ .../Monitor/IAlertRuleIncidentsOperations.cs | 73 ++ .../Monitor/IAlertRulesOperations.cs | 122 +++ .../Monitor/IAutoscaleSettingsOperations.cs | 142 +++ .../Monitor/ILogProfilesOperations.cs | 105 ++ .../Monitor/IMonitorManagementClient.cs | 89 ++ .../IServiceDiagnosticSettingsOperations.cs | 68 ++ .../Monitor/LogProfilesOperations.cs | 745 +++++++++++++ .../LogProfilesOperationsExtensions.cs | 154 +++ .../Monitor/Models/AlertRuleResource.cs | 111 ++ .../Monitor/Models/AutoscaleNotification.cs | 62 ++ .../Monitor/Models/AutoscaleProfile.cs | 125 +++ .../Models/AutoscaleSettingResource.cs | 121 +++ .../Monitor/Models/ComparisonOperationType.cs | 31 + .../Monitor/Models/ConditionOperator.cs | 27 + .../Monitor/Models/EmailNotification.cs | 62 ++ .../Management/Monitor/Models/Incident.cs | 79 ++ .../Models/LocationThresholdRuleCondition.cs | 78 ++ .../Monitor/Models/LogProfileResource.cs | 114 ++ .../Management/Monitor/Models/LogSettings.cs | 77 ++ .../ManagementEventAggregationCondition.cs | 66 ++ .../Models/ManagementEventRuleCondition.cs | 60 ++ .../Monitor/Models/MetricSettings.cs | 72 ++ .../Monitor/Models/MetricStatisticType.cs | 27 + .../Monitor/Models/MetricTrigger.cs | 144 +++ .../Management/Monitor/Models/Page.cs | 46 + .../Management/Monitor/Models/Page1.cs | 46 + .../Management/Monitor/Models/Recurrence.cs | 74 ++ .../Monitor/Models/RecurrenceFrequency.cs | 35 + .../Monitor/Models/RecurrentSchedule.cs | 179 ++++ .../Management/Monitor/Models/Resource.cs | 84 ++ .../Monitor/Models/RetentionPolicy.cs | 61 ++ .../Management/Monitor/Models/RuleAction.cs | 26 + .../Monitor/Models/RuleCondition.cs | 25 + .../Monitor/Models/RuleDataSource.cs | 25 + .../Monitor/Models/RuleEmailAction.cs | 55 + .../RuleManagementEventClaimsDataSource.cs | 41 + .../Models/RuleManagementEventDataSource.cs | 122 +++ .../Monitor/Models/RuleMetricDataSource.cs | 53 + .../Monitor/Models/RuleWebhookAction.cs | 54 + .../Management/Monitor/Models/ScaleAction.cs | 88 ++ .../Monitor/Models/ScaleCapacity.cs | 86 ++ .../Monitor/Models/ScaleDirection.cs | 25 + .../Management/Monitor/Models/ScaleRule.cs | 74 ++ .../Management/Monitor/Models/ScaleType.cs | 25 + .../ServiceDiagnosticSettingsResource.cs | 125 +++ .../Monitor/Models/ThresholdRuleCondition.cs | 102 ++ .../Monitor/Models/TimeAggregationOperator.cs | 29 + .../Monitor/Models/TimeAggregationType.cs | 29 + .../Management/Monitor/Models/TimeWindow.cs | 150 +++ .../Monitor/Models/WebhookNotification.cs | 49 + .../Monitor/MonitorManagementClient.cs | 335 ++++++ .../ServiceDiagnosticSettingsOperations.cs | 423 ++++++++ ...eDiagnosticSettingsOperationsExtensions.cs | 95 ++ .../Monitor/ActivityLogsOperations.cs | 443 ++++++++ .../ActivityLogsOperationsExtensions.cs | 173 ++++ .../Monitor/EventCategoriesOperations.cs | 210 ++++ .../EventCategoriesOperationsExtensions.cs | 53 + .../Monitor/IActivityLogsOperations.cs | 111 ++ .../Monitor/IEventCategoriesOperations.cs | 42 + .../Monitor/IMetricDefinitionsOperations.cs | 51 + .../Generated/Monitor/IMetricsOperations.cs | 66 ++ .../Generated/Monitor/IMonitorClient.cs | 94 ++ .../Monitor/ITenantActivityLogsOperations.cs | 123 +++ .../Monitor/IUsageMetricsOperations.cs | 48 + .../Monitor/MetricDefinitionsOperations.cs | 237 +++++ .../MetricDefinitionsOperationsExtensions.cs | 71 ++ .../Generated/Monitor/MetricsOperations.cs | 250 +++++ .../Monitor/MetricsOperationsExtensions.cs | 97 ++ .../Monitor/Models/AggregationType.cs | 31 + .../Generated/Monitor/Models/EventData.cs | 333 ++++++ .../Generated/Monitor/Models/EventLevel.cs | 29 + .../Monitor/Models/HttpRequestInfo.cs | 63 ++ .../Monitor/Models/LocalizableString.cs | 60 ++ .../Generated/Monitor/Models/Metric.cs | 93 ++ .../Monitor/Models/MetricAvailability.cs | 54 + .../Monitor/Models/MetricDefinition.cs | 108 ++ .../Generated/Monitor/Models/MetricValue.cs | 95 ++ .../Generated/Monitor/Models/Page.cs | 46 + .../Generated/Monitor/Models/Page1.cs | 46 + .../Monitor/Models/SenderAuthorization.cs | 58 ++ .../Generated/Monitor/Models/Unit.cs | 33 + .../Generated/Monitor/Models/UsageMetric.cs | 103 ++ .../Generated/Monitor/MonitorClient.cs | 333 ++++++ .../Monitor/TenantActivityLogsOperations.cs | 443 ++++++++ .../TenantActivityLogsOperationsExtensions.cs | 189 ++++ .../Monitor/UsageMetricsOperations.cs | 243 +++++ .../UsageMetricsOperationsExtensions.cs | 67 ++ .../Microsoft.Azure.Monitor.xproj | 18 + .../Properties/AssemblyInfo.cs | 20 + .../Microsoft.Azure.Monitor/generate.cmd | 30 + .../Microsoft.Azure.Monitor/project.json | 50 + .../Monitor.Tests/BasicTests/AlertsTests.cs | 320 ++++++ .../BasicTests/AutoscaleTests.cs | 269 +++++ .../BasicTests/EventDataTests.cs | 219 ++++ .../BasicTests/LogProfilesTests.cs | 178 ++++ .../Monitor.Tests/BasicTests/MetricsTests.cs | 184 ++++ .../ServiceDiagnosticSettingsTests.cs | 205 ++++ .../Monitor.Tests/BasicTests/TestBaseTests.cs | 97 ++ .../Monitor.Tests/BasicTests/UsagesTests.cs | 96 ++ .../Monitor.Tests/Helpers/JsonExtensions.cs | 192 ++++ .../Helpers/RecordedDelegatingHandler.cs | 90 ++ .../Monitor/Monitor.Tests/Monitor.Tests.xproj | 21 + .../Monitor.Tests/Properties/AssemblyInfo.cs | 39 + .../Monitor/Monitor.Tests/project.json | 41 + src/ResourceManagement/Monitor/Monitor.sln | 118 +++ src/ResourceManagement/Monitor/NuGet.Config | 6 + src/ResourceManagement/Monitor/global.json | 3 + 114 files changed, 14746 insertions(+), 1 deletion(-) create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Properties/AssemblyInfo.cs create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd create mode 100644 src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/project.json create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/Helpers/RecordedDelegatingHandler.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/Properties/AssemblyInfo.cs create mode 100644 src/ResourceManagement/Monitor/Monitor.Tests/project.json create mode 100644 src/ResourceManagement/Monitor/Monitor.sln create mode 100644 src/ResourceManagement/Monitor/NuGet.Config create mode 100644 src/ResourceManagement/Monitor/global.json diff --git a/global.json b/global.json index a4394799a565..10555f07ed28 100644 --- a/global.json +++ b/global.json @@ -24,6 +24,7 @@ "src/ResourceManagement/Websites/Microsoft.Azure.Management.Websites", "src/ResourceManagement/IotHub/Microsoft.Azure.Management.IotHub", "src/ResourceManagement/Insights/Microsoft.Azure.Insights", - "src/ResourceManagement/AnalysisServices/Microsoft.Azure.Management.Analysis" + "src/ResourceManagement/AnalysisServices/Microsoft.Azure.Management.Analysis", + "src/ResourceManagement/Monitor/Microsoft.Azure.Monitor" ] } \ No newline at end of file diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs new file mode 100644 index 000000000000..a63388df2131 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs @@ -0,0 +1,432 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// AlertRuleIncidentsOperations operations. + /// + internal partial class AlertRuleIncidentsOperations : Microsoft.Rest.IServiceOperations, IAlertRuleIncidentsOperations + { + /// + /// Initializes a new instance of the AlertRuleIncidentsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AlertRuleIncidentsOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// Gets an incident associated to an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The name of the incident to retrieve. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, string incidentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ruleName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + } + if (incidentName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "incidentName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("incidentName", incidentName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + _url = _url.Replace("{incidentName}", System.Uri.EscapeDataString(incidentName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ruleName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByAlertRule", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs new file mode 100644 index 000000000000..28985a393b35 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs @@ -0,0 +1,107 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for AlertRuleIncidentsOperations. + /// + public static partial class AlertRuleIncidentsOperationsExtensions + { + /// + /// Gets an incident associated to an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The name of the incident to retrieve. + /// + public static Incident Get(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRuleIncidentsOperations)s).GetAsync(resourceGroupName, ruleName, incidentName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets an incident associated to an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The name of the incident to retrieve. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ruleName, incidentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + public static System.Collections.Generic.IEnumerable ListByAlertRule(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRuleIncidentsOperations)s).ListByAlertRuleAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByAlertRuleAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByAlertRuleWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs new file mode 100644 index 000000000000..0b0810fd368e --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs @@ -0,0 +1,813 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// AlertRulesOperations operations. + /// + internal partial class AlertRulesOperations : Microsoft.Rest.IServiceOperations, IAlertRulesOperations + { + /// + /// Initializes a new instance of the AlertRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AlertRulesOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The parameters of the rule to create or update. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ruleName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + } + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ruleName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 204 && (int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (ruleName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ruleName", ruleName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List the alert rules within a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs new file mode 100644 index 000000000000..789ec96fb732 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs @@ -0,0 +1,188 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for AlertRulesOperations. + /// + public static partial class AlertRulesOperationsExtensions + { + /// + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The parameters of the rule to create or update. + /// + public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, ruleName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The parameters of the rule to create or update. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ruleName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + public static void Delete(this IAlertRulesOperations operations, string resourceGroupName, string ruleName) + { + System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).DeleteAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Deletes an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + public static AlertRuleResource Get(this IAlertRulesOperations operations, string resourceGroupName, string ruleName) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).GetAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets an alert rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List the alert rules within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IAlertRulesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).ListByResourceGroupAsync(resourceGroupName, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// List the alert rules within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IAlertRulesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs new file mode 100644 index 000000000000..e3832994e930 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs @@ -0,0 +1,979 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// AutoscaleSettingsOperations operations. + /// + internal partial class AutoscaleSettingsOperations : Microsoft.Rest.IServiceOperations, IAutoscaleSettingsOperations + { + /// + /// Initializes a new instance of the AutoscaleSettingsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AutoscaleSettingsOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates an autoscale setting. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (autoscaleSettingName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "autoscaleSettingName"); + } + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("autoscaleSettingName", autoscaleSettingName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes and autoscale setting + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (autoscaleSettingName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "autoscaleSettingName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("autoscaleSettingName", autoscaleSettingName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets an autoscale setting + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (autoscaleSettingName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "autoscaleSettingName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("autoscaleSettingName", autoscaleSettingName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs new file mode 100644 index 000000000000..6d04b53e28a4 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs @@ -0,0 +1,218 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for AutoscaleSettingsOperations. + /// + public static partial class AutoscaleSettingsOperationsExtensions + { + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IAutoscaleSettingsOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).ListByResourceGroupAsync(resourceGroupName, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an autoscale setting. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// Parameters supplied to the operation. + /// + public static AutoscaleSettingResource CreateOrUpdate(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).CreateOrUpdateAsync(resourceGroupName, autoscaleSettingName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an autoscale setting. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, autoscaleSettingName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes and autoscale setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + public static void Delete(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName) + { + System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).DeleteAsync(resourceGroupName, autoscaleSettingName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Deletes and autoscale setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await operations.DeleteWithHttpMessagesAsync(resourceGroupName, autoscaleSettingName, null, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an autoscale setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + public static AutoscaleSettingResource Get(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).GetAsync(resourceGroupName, autoscaleSettingName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets an autoscale setting + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, autoscaleSettingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IAutoscaleSettingsOperations operations, string nextPageLink) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).ListByResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IAutoscaleSettingsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs new file mode 100644 index 000000000000..afa8a9a27cc3 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs @@ -0,0 +1,73 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// AlertRuleIncidentsOperations operations. + /// + public partial interface IAlertRuleIncidentsOperations + { + /// + /// Gets an incident associated to an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The name of the incident to retrieve. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, string incidentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets a list of incidents associated to an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs new file mode 100644 index 000000000000..2743782850d4 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs @@ -0,0 +1,122 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// AlertRulesOperations operations. + /// + public partial interface IAlertRulesOperations + { + /// + /// Creates or updates an alert rule. + /// Request method: PUT Request URI: + /// https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/alertRules/{alert-rule-name}?api-version={api-version} + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The parameters of the rule to create or update. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Deletes an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets an alert rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the rule. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List the alert rules within a resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs new file mode 100644 index 000000000000..bf63b945e959 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs @@ -0,0 +1,142 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// AutoscaleSettingsOperations operations. + /// + public partial interface IAutoscaleSettingsOperations + { + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The name of the resource group. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Creates or updates an autoscale setting. + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Deletes and autoscale setting + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets an autoscale setting + /// + /// + /// The name of the resource group. + /// + /// + /// The autoscale setting name. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Lists the autoscale settings for a resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs new file mode 100644 index 000000000000..7c29513a7d37 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs @@ -0,0 +1,105 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// LogProfilesOperations operations. + /// + public partial interface ILogProfilesOperations + { + /// + /// Deletes the log profile. + /// + /// + /// The name of the log profile. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets the log profile. + /// + /// + /// The name of the log profile. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Create or update a log profile in Azure Monitoring REST API. + /// + /// + /// The name of the log profile. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List the log profiles. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs new file mode 100644 index 000000000000..ae10881bfd6b --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs @@ -0,0 +1,89 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Composite Swagger for Monitor Management Client + /// + public partial interface IMonitorManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + Microsoft.Rest.ServiceClientCredentials Credentials { get; } + + /// + /// The Azure subscription Id. + /// + string SubscriptionId { get; set; } + + /// + /// Gets or sets the preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running + /// Operations. Default value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IAutoscaleSettingsOperations. + /// + IAutoscaleSettingsOperations AutoscaleSettings { get; } + + /// + /// Gets the IServiceDiagnosticSettingsOperations. + /// + IServiceDiagnosticSettingsOperations ServiceDiagnosticSettings { get; } + + /// + /// Gets the IAlertRulesOperations. + /// + IAlertRulesOperations AlertRules { get; } + + /// + /// Gets the IAlertRuleIncidentsOperations. + /// + IAlertRuleIncidentsOperations AlertRuleIncidents { get; } + + /// + /// Gets the ILogProfilesOperations. + /// + ILogProfilesOperations LogProfiles { get; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs new file mode 100644 index 000000000000..83ba8af739a4 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs @@ -0,0 +1,68 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// ServiceDiagnosticSettingsOperations operations. + /// + public partial interface IServiceDiagnosticSettingsOperations + { + /// + /// Gets the active diagnostic settings for the specified resource. + /// + /// + /// The identifier of the resource. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceUri, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Create or update new diagnostic settings for the specified + /// resource. + /// + /// + /// The identifier of the resource. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs new file mode 100644 index 000000000000..a35b918a14ab --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs @@ -0,0 +1,745 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// LogProfilesOperations operations. + /// + internal partial class LogProfilesOperations : Microsoft.Rest.IServiceOperations, ILogProfilesOperations + { + /// + /// Initializes a new instance of the LogProfilesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LogProfilesOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// Deletes the log profile. + /// + /// + /// The name of the log profile. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (logProfileName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "logProfileName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("logProfileName", logProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); + _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + if (_httpResponse.Content != null) { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + } + else { + _responseContent = string.Empty; + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the log profile. + /// + /// + /// The name of the log profile. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (logProfileName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "logProfileName"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("logProfileName", logProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); + _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update a log profile in Azure Monitoring REST API. + /// + /// + /// The name of the log profile. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (logProfileName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "logProfileName"); + } + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("logProfileName", logProfileName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); + _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List the log profiles. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs new file mode 100644 index 000000000000..8c28aac7819e --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs @@ -0,0 +1,154 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for LogProfilesOperations. + /// + public static partial class LogProfilesOperationsExtensions + { + /// + /// Deletes the log profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the log profile. + /// + public static void Delete(this ILogProfilesOperations operations, string logProfileName) + { + System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).DeleteAsync(logProfileName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Deletes the log profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the log profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ILogProfilesOperations operations, string logProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + await operations.DeleteWithHttpMessagesAsync(logProfileName, null, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the log profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the log profile. + /// + public static LogProfileResource Get(this ILogProfilesOperations operations, string logProfileName) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).GetAsync(logProfileName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets the log profile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the log profile. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ILogProfilesOperations operations, string logProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(logProfileName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a log profile in Azure Monitoring REST API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the log profile. + /// + /// + /// Parameters supplied to the operation. + /// + public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).CreateOrUpdateAsync(logProfileName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Create or update a log profile in Azure Monitoring REST API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the log profile. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(logProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List the log profiles. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this ILogProfilesOperations operations) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// List the log profiles. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ILogProfilesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs new file mode 100644 index 000000000000..3fb1f9a577ff --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs @@ -0,0 +1,111 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The alert rule resource. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class AlertRuleResource : Resource + { + /// + /// Initializes a new instance of the AlertRuleResource class. + /// + public AlertRuleResource() { } + + /// + /// Initializes a new instance of the AlertRuleResource class. + /// + /// Resource location + /// the name of the alert + /// rule. + /// the flag that indicates whether the alert + /// rule is enabled. + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + /// the description of the alert rule that + /// will be included in the alert email. + /// the condition that results in the alert + /// rule being activated. + /// the array of actions that are performed when + /// the alert rule becomes active, and when an alert condition is + /// resolved. + /// Last time the rule was updated in + /// ISO8601 format. + public AlertRuleResource(string location, string alertRuleResourceName, bool isEnabled, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string description = default(string), RuleCondition condition = default(RuleCondition), System.Collections.Generic.IList actions = default(System.Collections.Generic.IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + : base(location, id, name, type, tags) + { + AlertRuleResourceName = alertRuleResourceName; + Description = description; + IsEnabled = isEnabled; + Condition = condition; + Actions = actions; + LastUpdatedTime = lastUpdatedTime; + } + + /// + /// Gets or sets the name of the alert rule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + public string AlertRuleResourceName { get; set; } + + /// + /// Gets or sets the description of the alert rule that will be + /// included in the alert email. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the flag that indicates whether the alert rule is + /// enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isEnabled")] + public bool IsEnabled { get; set; } + + /// + /// Gets or sets the condition that results in the alert rule being + /// activated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.condition")] + public RuleCondition Condition { get; set; } + + /// + /// Gets or sets the array of actions that are performed when the alert + /// rule becomes active, and when an alert condition is resolved. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.actions")] + public System.Collections.Generic.IList Actions { get; set; } + + /// + /// Gets last time the rule was updated in ISO8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastUpdatedTime")] + public System.DateTime? LastUpdatedTime { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (AlertRuleResourceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AlertRuleResourceName"); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs new file mode 100644 index 000000000000..429ceaaee534 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Autoscale notification. + /// + public partial class AutoscaleNotification + { + /// + /// Initializes a new instance of the AutoscaleNotification class. + /// + public AutoscaleNotification() { } + + /// + /// Initializes a new instance of the AutoscaleNotification class. + /// + /// the email notification. + /// the collection of webhook + /// notifications. + public AutoscaleNotification(EmailNotification email = default(EmailNotification), System.Collections.Generic.IList webhooks = default(System.Collections.Generic.IList)) + { + Email = email; + Webhooks = webhooks; + } + /// + /// Static constructor for AutoscaleNotification class. + /// + static AutoscaleNotification() + { + Operation = "Scale"; + } + + /// + /// Gets or sets the email notification. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "email")] + public EmailNotification Email { get; set; } + + /// + /// Gets or sets the collection of webhook notifications. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "webhooks")] + public System.Collections.Generic.IList Webhooks { get; set; } + + /// + /// the operation associated with the notification and its value must + /// be "scale" + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public static string Operation { get; private set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs new file mode 100644 index 000000000000..c0630fecdb47 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs @@ -0,0 +1,125 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Autoscale profile. + /// + public partial class AutoscaleProfile + { + /// + /// Initializes a new instance of the AutoscaleProfile class. + /// + public AutoscaleProfile() { } + + /// + /// Initializes a new instance of the AutoscaleProfile class. + /// + /// the name of the profile. + /// the number of instances that can be used + /// during this profile. + /// the collection of rules that provide the + /// triggers and parameters for the scaling action. A maximum of 10 + /// rules can be specified. + /// the specific date-time for the profile. + /// This element is not used if the Recurrence element is used. + /// the repeating times at which this profile + /// begins. This element is not used if the FixedDate element is + /// used. + public AutoscaleProfile(string name, ScaleCapacity capacity, System.Collections.Generic.IList rules, TimeWindow fixedDate = default(TimeWindow), Recurrence recurrence = default(Recurrence)) + { + Name = name; + Capacity = capacity; + Rules = rules; + FixedDate = fixedDate; + Recurrence = recurrence; + } + + /// + /// Gets or sets the name of the profile. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the number of instances that can be used during this + /// profile. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + public ScaleCapacity Capacity { get; set; } + + /// + /// Gets or sets the collection of rules that provide the triggers and + /// parameters for the scaling action. A maximum of 10 rules can be + /// specified. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] + public System.Collections.Generic.IList Rules { get; set; } + + /// + /// Gets or sets the specific date-time for the profile. This element + /// is not used if the Recurrence element is used. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "fixedDate")] + public TimeWindow FixedDate { get; set; } + + /// + /// Gets or sets the repeating times at which this profile begins. This + /// element is not used if the FixedDate element is used. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recurrence")] + public Recurrence Recurrence { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + } + if (Capacity == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Capacity"); + } + if (Rules == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Rules"); + } + if (this.Capacity != null) + { + this.Capacity.Validate(); + } + if (this.Rules != null) + { + foreach (var element in this.Rules) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.FixedDate != null) + { + this.FixedDate.Validate(); + } + if (this.Recurrence != null) + { + this.Recurrence.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs new file mode 100644 index 000000000000..49abc19505f3 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs @@ -0,0 +1,121 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The autoscale setting resource. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class AutoscaleSettingResource : Resource + { + /// + /// Initializes a new instance of the AutoscaleSettingResource class. + /// + public AutoscaleSettingResource() { } + + /// + /// Initializes a new instance of the AutoscaleSettingResource class. + /// + /// Resource location + /// the collection of automatic scaling profiles + /// that specify different scaling parameters for different time + /// periods. A maximum of 20 profiles can be specified. + /// the name of the + /// autoscale setting. + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + /// the collection of + /// notifications. + /// the enabled flag. Specifies whether automatic + /// scaling is enabled for the resource. The default value is + /// 'true'. + /// the resource identifier of the + /// resource that the autoscale setting should be added to. + public AutoscaleSettingResource(string location, System.Collections.Generic.IList profiles, string autoscaleSettingResourceName, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList notifications = default(System.Collections.Generic.IList), bool? enabled = default(bool?), string targetResourceUri = default(string)) + : base(location, id, name, type, tags) + { + Profiles = profiles; + Notifications = notifications; + Enabled = enabled; + AutoscaleSettingResourceName = autoscaleSettingResourceName; + TargetResourceUri = targetResourceUri; + } + + /// + /// Gets or sets the collection of automatic scaling profiles that + /// specify different scaling parameters for different time periods. A + /// maximum of 20 profiles can be specified. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.profiles")] + public System.Collections.Generic.IList Profiles { get; set; } + + /// + /// Gets or sets the collection of notifications. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notifications")] + public System.Collections.Generic.IList Notifications { get; set; } + + /// + /// Gets or sets the enabled flag. Specifies whether automatic scaling + /// is enabled for the resource. The default value is 'true'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets the name of the autoscale setting. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + public string AutoscaleSettingResourceName { get; set; } + + /// + /// Gets or sets the resource identifier of the resource that the + /// autoscale setting should be added to. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetResourceUri")] + public string TargetResourceUri { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Profiles == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Profiles"); + } + if (AutoscaleSettingResourceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AutoscaleSettingResourceName"); + } + if (this.Profiles != null) + { + if (this.Profiles.Count > 20) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxItems, "Profiles", 20); + } + foreach (var element in this.Profiles) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs new file mode 100644 index 000000000000..7e8f008f77ac --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs @@ -0,0 +1,31 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for ComparisonOperationType. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ComparisonOperationType + { + [System.Runtime.Serialization.EnumMember(Value = "Equals")] + Equals, + [System.Runtime.Serialization.EnumMember(Value = "NotEquals")] + NotEquals, + [System.Runtime.Serialization.EnumMember(Value = "GreaterThan")] + GreaterThan, + [System.Runtime.Serialization.EnumMember(Value = "GreaterThanOrEqual")] + GreaterThanOrEqual, + [System.Runtime.Serialization.EnumMember(Value = "LessThan")] + LessThan, + [System.Runtime.Serialization.EnumMember(Value = "LessThanOrEqual")] + LessThanOrEqual + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs new file mode 100644 index 000000000000..4cbf188dc3b7 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs @@ -0,0 +1,27 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for ConditionOperator. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ConditionOperator + { + [System.Runtime.Serialization.EnumMember(Value = "GreaterThan")] + GreaterThan, + [System.Runtime.Serialization.EnumMember(Value = "GreaterThanOrEqual")] + GreaterThanOrEqual, + [System.Runtime.Serialization.EnumMember(Value = "LessThan")] + LessThan, + [System.Runtime.Serialization.EnumMember(Value = "LessThanOrEqual")] + LessThanOrEqual + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs new file mode 100644 index 000000000000..3dc3debc80b3 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Email notification of an autoscale event. + /// + public partial class EmailNotification + { + /// + /// Initializes a new instance of the EmailNotification class. + /// + public EmailNotification() { } + + /// + /// Initializes a new instance of the EmailNotification class. + /// + /// a value indicating + /// whether to send email to subscription administrator. + /// a value indicating + /// whether to send email to subscription co-administrators. + /// the custom e-mails list. This value can + /// be null or empty, in which case this attribute will be + /// ignored. + public EmailNotification(bool? sendToSubscriptionAdministrator = default(bool?), bool? sendToSubscriptionCoAdministrators = default(bool?), System.Collections.Generic.IList customEmails = default(System.Collections.Generic.IList)) + { + SendToSubscriptionAdministrator = sendToSubscriptionAdministrator; + SendToSubscriptionCoAdministrators = sendToSubscriptionCoAdministrators; + CustomEmails = customEmails; + } + + /// + /// Gets or sets a value indicating whether to send email to + /// subscription administrator. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sendToSubscriptionAdministrator")] + public bool? SendToSubscriptionAdministrator { get; set; } + + /// + /// Gets or sets a value indicating whether to send email to + /// subscription co-administrators. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sendToSubscriptionCoAdministrators")] + public bool? SendToSubscriptionCoAdministrators { get; set; } + + /// + /// Gets or sets the custom e-mails list. This value can be null or + /// empty, in which case this attribute will be ignored. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customEmails")] + public System.Collections.Generic.IList CustomEmails { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs new file mode 100644 index 000000000000..f5265dc413c3 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs @@ -0,0 +1,79 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// An alert incident indicates the activation status of an alert rule. + /// + public partial class Incident + { + /// + /// Initializes a new instance of the Incident class. + /// + public Incident() { } + + /// + /// Initializes a new instance of the Incident class. + /// + /// Incident name. + /// Rule name that is associated with the + /// incident. + /// A boolean to indicate whether the incident + /// is active or resolved. + /// The time at which the incident was + /// activated in ISO8601 format. + /// The time at which the incident was + /// resolved in ISO8601 format. If null, it means the incident is still + /// active. + public Incident(string name = default(string), string ruleName = default(string), bool? isActive = default(bool?), System.DateTime? activatedTime = default(System.DateTime?), System.DateTime? resolvedTime = default(System.DateTime?)) + { + Name = name; + RuleName = ruleName; + IsActive = isActive; + ActivatedTime = activatedTime; + ResolvedTime = resolvedTime; + } + + /// + /// Gets incident name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets rule name that is associated with the incident. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "ruleName")] + public string RuleName { get; private set; } + + /// + /// Gets a boolean to indicate whether the incident is active or + /// resolved. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isActive")] + public bool? IsActive { get; private set; } + + /// + /// Gets the time at which the incident was activated in ISO8601 + /// format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "activatedTime")] + public System.DateTime? ActivatedTime { get; private set; } + + /// + /// Gets the time at which the incident was resolved in ISO8601 format. + /// If null, it means the incident is still active. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resolvedTime")] + public System.DateTime? ResolvedTime { get; private set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs new file mode 100644 index 000000000000..4ef77a17dbaf --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs @@ -0,0 +1,78 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// A rule condition based on a certain number of locations failing. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.LocationThresholdRuleCondition")] + public partial class LocationThresholdRuleCondition : RuleCondition + { + /// + /// Initializes a new instance of the LocationThresholdRuleCondition + /// class. + /// + public LocationThresholdRuleCondition() { } + + /// + /// Initializes a new instance of the LocationThresholdRuleCondition + /// class. + /// + /// the number of locations that must + /// fail to activate the alert. + /// the resource from which the rule collects + /// its data. For this type dataSource will always be of type + /// RuleMetricDataSource. + /// the period of time (in ISO 8601 duration + /// format) that is used to monitor alert activity based on the + /// threshold. If specified then it must be between 5 minutes and 1 + /// day. + public LocationThresholdRuleCondition(int failedLocationCount, RuleDataSource dataSource = default(RuleDataSource), System.TimeSpan? windowSize = default(System.TimeSpan?)) + { + DataSource = dataSource; + WindowSize = windowSize; + FailedLocationCount = failedLocationCount; + } + + /// + /// Gets or sets the resource from which the rule collects its data. + /// For this type dataSource will always be of type + /// RuleMetricDataSource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] + public RuleDataSource DataSource { get; set; } + + /// + /// Gets or sets the period of time (in ISO 8601 duration format) that + /// is used to monitor alert activity based on the threshold. If + /// specified then it must be between 5 minutes and 1 day. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "windowSize")] + public System.TimeSpan? WindowSize { get; set; } + + /// + /// Gets or sets the number of locations that must fail to activate the + /// alert. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "failedLocationCount")] + public int FailedLocationCount { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs new file mode 100644 index 000000000000..407a81934811 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs @@ -0,0 +1,114 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The log profile resource. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class LogProfileResource : Resource + { + /// + /// Initializes a new instance of the LogProfileResource class. + /// + public LogProfileResource() { } + + /// + /// Initializes a new instance of the LogProfileResource class. + /// + /// Resource location + /// List of regions for which Activity Log + /// events should be stored or streamed. It is a comma separated list + /// of valid ARM locations including the 'global' location. + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + /// the resource id of the storage + /// account to which you would like to send the Activity Log. + /// The service bus rule ID of the + /// service bus namespace in which you would like to have Event Hubs + /// created for streaming the Activity Log. The rule ID is of the + /// format: '{service bus resource ID}/authorizationrules/{key + /// name}'. + /// the categories of the logs. These + /// categories are created as is convenient to the user. Some values + /// are: 'Write', 'Delete', and/or 'Action.' + /// the retention policy for the events + /// in the log. + public LogProfileResource(string location, System.Collections.Generic.IList locations, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + : base(location, id, name, type, tags) + { + StorageAccountId = storageAccountId; + ServiceBusRuleId = serviceBusRuleId; + Locations = locations; + Categories = categories; + RetentionPolicy = retentionPolicy; + } + + /// + /// Gets or sets the resource id of the storage account to which you + /// would like to send the Activity Log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] + public string StorageAccountId { get; set; } + + /// + /// Gets or sets the service bus rule ID of the service bus namespace + /// in which you would like to have Event Hubs created for streaming + /// the Activity Log. The rule ID is of the format: '{service bus + /// resource ID}/authorizationrules/{key name}'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] + public string ServiceBusRuleId { get; set; } + + /// + /// Gets or sets list of regions for which Activity Log events should + /// be stored or streamed. It is a comma separated list of valid ARM + /// locations including the 'global' location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.locations")] + public System.Collections.Generic.IList Locations { get; set; } + + /// + /// Gets or sets the categories of the logs. These categories are + /// created as is convenient to the user. Some values are: 'Write', + /// 'Delete', and/or 'Action.' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.categories")] + public System.Collections.Generic.IList Categories { get; set; } + + /// + /// Gets or sets the retention policy for the events in the log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Locations == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Locations"); + } + if (this.RetentionPolicy != null) + { + this.RetentionPolicy.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs new file mode 100644 index 000000000000..bc3aabca8ca4 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs @@ -0,0 +1,77 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Part of MultiTenantDiagnosticSettings. Specifies the settings for a + /// particular log. + /// + public partial class LogSettings + { + /// + /// Initializes a new instance of the LogSettings class. + /// + public LogSettings() { } + + /// + /// Initializes a new instance of the LogSettings class. + /// + /// a value indicating whether this log is + /// enabled. + /// Name of a Diagnostic Log category for a + /// resource type this setting is applied to. To obtain the list of + /// Diagnostic Log categories for a resource, first perform a GET + /// diagnostic settings operation. + /// the retention policy for this + /// log. + public LogSettings(bool enabled, string category = default(string), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + { + Category = category; + Enabled = enabled; + RetentionPolicy = retentionPolicy; + } + + /// + /// Gets or sets name of a Diagnostic Log category for a resource type + /// this setting is applied to. To obtain the list of Diagnostic Log + /// categories for a resource, first perform a GET diagnostic settings + /// operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets a value indicating whether this log is enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled { get; set; } + + /// + /// Gets or sets the retention policy for this log. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.RetentionPolicy != null) + { + this.RetentionPolicy.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs new file mode 100644 index 000000000000..f7d9adca503d --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs @@ -0,0 +1,66 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// How the data that is collected should be combined over time. + /// + public partial class ManagementEventAggregationCondition + { + /// + /// Initializes a new instance of the + /// ManagementEventAggregationCondition class. + /// + public ManagementEventAggregationCondition() { } + + /// + /// Initializes a new instance of the + /// ManagementEventAggregationCondition class. + /// + /// the condition operator. Possible + /// values include: 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', + /// 'LessThanOrEqual' + /// The threshold value that activates the + /// alert. + /// the period of time (in ISO 8601 duration + /// format) that is used to monitor alert activity based on the + /// threshold. If specified then it must be between 5 minutes and 1 + /// day. + public ManagementEventAggregationCondition(ConditionOperator? operatorProperty = default(ConditionOperator?), double? threshold = default(double?), System.TimeSpan? windowSize = default(System.TimeSpan?)) + { + OperatorProperty = operatorProperty; + Threshold = threshold; + WindowSize = windowSize; + } + + /// + /// Gets or sets the condition operator. Possible values include: + /// 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + public ConditionOperator? OperatorProperty { get; set; } + + /// + /// Gets or sets the threshold value that activates the alert. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + public double? Threshold { get; set; } + + /// + /// Gets or sets the period of time (in ISO 8601 duration format) that + /// is used to monitor alert activity based on the threshold. If + /// specified then it must be between 5 minutes and 1 day. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "windowSize")] + public System.TimeSpan? WindowSize { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs new file mode 100644 index 000000000000..bd876c36bb86 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs @@ -0,0 +1,60 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// A management event rule condition. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.ManagementEventRuleCondition")] + public partial class ManagementEventRuleCondition : RuleCondition + { + /// + /// Initializes a new instance of the ManagementEventRuleCondition + /// class. + /// + public ManagementEventRuleCondition() { } + + /// + /// Initializes a new instance of the ManagementEventRuleCondition + /// class. + /// + /// the resource from which the rule collects + /// its data. For this type dataSource will always be of type + /// RuleManagementEventDataSource. + /// How the data that is collected should be + /// combined over time and when the alert is activated. Note that for + /// management event alerts aggregation is optional – if it is not + /// provided then any event will cause the alert to activate. + public ManagementEventRuleCondition(RuleDataSource dataSource = default(RuleDataSource), ManagementEventAggregationCondition aggregation = default(ManagementEventAggregationCondition)) + { + DataSource = dataSource; + Aggregation = aggregation; + } + + /// + /// Gets or sets the resource from which the rule collects its data. + /// For this type dataSource will always be of type + /// RuleManagementEventDataSource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] + public RuleDataSource DataSource { get; set; } + + /// + /// Gets or sets how the data that is collected should be combined over + /// time and when the alert is activated. Note that for management + /// event alerts aggregation is optional – if it is not provided then + /// any event will cause the alert to activate. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "aggregation")] + public ManagementEventAggregationCondition Aggregation { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs new file mode 100644 index 000000000000..9e4a27950755 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs @@ -0,0 +1,72 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Part of MultiTenantDiagnosticSettings. Specifies the settings for a + /// particular metric. + /// + public partial class MetricSettings + { + /// + /// Initializes a new instance of the MetricSettings class. + /// + public MetricSettings() { } + + /// + /// Initializes a new instance of the MetricSettings class. + /// + /// the timegrain of the metric in ISO8601 + /// format. + /// a value indicating whether this timegrain is + /// enabled. + /// the retention policy for this + /// timegrain. + public MetricSettings(System.TimeSpan timeGrain, bool enabled, RetentionPolicy retentionPolicy = default(RetentionPolicy)) + { + TimeGrain = timeGrain; + Enabled = enabled; + RetentionPolicy = retentionPolicy; + } + + /// + /// Gets or sets the timegrain of the metric in ISO8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] + public System.TimeSpan TimeGrain { get; set; } + + /// + /// Gets or sets a value indicating whether this timegrain is enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled { get; set; } + + /// + /// Gets or sets the retention policy for this timegrain. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.RetentionPolicy != null) + { + this.RetentionPolicy.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs new file mode 100644 index 000000000000..01450b9f3d4d --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs @@ -0,0 +1,27 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for MetricStatisticType. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum MetricStatisticType + { + [System.Runtime.Serialization.EnumMember(Value = "Average")] + Average, + [System.Runtime.Serialization.EnumMember(Value = "Min")] + Min, + [System.Runtime.Serialization.EnumMember(Value = "Max")] + Max, + [System.Runtime.Serialization.EnumMember(Value = "Sum")] + Sum + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs new file mode 100644 index 000000000000..d7b2c3ae7f9a --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs @@ -0,0 +1,144 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The trigger that results in a scaling action. + /// + public partial class MetricTrigger + { + /// + /// Initializes a new instance of the MetricTrigger class. + /// + public MetricTrigger() { } + + /// + /// Initializes a new instance of the MetricTrigger class. + /// + /// the name of the metric that defines what + /// the rule monitors. + /// the resource identifier of the + /// resource the rule monitors. + /// the granularity of metrics the rule + /// monitors. Must be one of the predefined values returned from metric + /// definitions for the metric. Must be between 12 hours and 1 + /// minute. + /// the metric statistic type. How the metrics + /// from multiple instances are combined. Possible values include: + /// 'Average', 'Min', 'Max', 'Sum' + /// the range of time in which instance data + /// is collected. This value must be greater than the delay in metric + /// collection, which can vary from resource-to-resource. Must be + /// between 12 hours and 5 minutes. + /// time aggregation type. How the data + /// that is collected should be combined over time. The default value + /// is Average. Possible values include: 'Average', 'Minimum', + /// 'Maximum', 'Total', 'Count' + /// the operator that is used to compare + /// the metric data and the threshold. Possible values include: + /// 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', + /// 'LessThan', 'LessThanOrEqual' + /// the threshold of the metric that triggers + /// the scale action. + public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpan timeGrain, MetricStatisticType statistic, System.TimeSpan timeWindow, TimeAggregationType timeAggregation, ComparisonOperationType operatorProperty, double threshold) + { + MetricName = metricName; + MetricResourceUri = metricResourceUri; + TimeGrain = timeGrain; + Statistic = statistic; + TimeWindow = timeWindow; + TimeAggregation = timeAggregation; + OperatorProperty = operatorProperty; + Threshold = threshold; + } + + /// + /// Gets or sets the name of the metric that defines what the rule + /// monitors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metricName")] + public string MetricName { get; set; } + + /// + /// Gets or sets the resource identifier of the resource the rule + /// monitors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metricResourceUri")] + public string MetricResourceUri { get; set; } + + /// + /// Gets or sets the granularity of metrics the rule monitors. Must be + /// one of the predefined values returned from metric definitions for + /// the metric. Must be between 12 hours and 1 minute. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] + public System.TimeSpan TimeGrain { get; set; } + + /// + /// Gets or sets the metric statistic type. How the metrics from + /// multiple instances are combined. Possible values include: + /// 'Average', 'Min', 'Max', 'Sum' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "statistic")] + public MetricStatisticType Statistic { get; set; } + + /// + /// Gets or sets the range of time in which instance data is collected. + /// This value must be greater than the delay in metric collection, + /// which can vary from resource-to-resource. Must be between 12 hours + /// and 5 minutes. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeWindow")] + public System.TimeSpan TimeWindow { get; set; } + + /// + /// Gets or sets time aggregation type. How the data that is collected + /// should be combined over time. The default value is Average. + /// Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', + /// 'Count' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeAggregation")] + public TimeAggregationType TimeAggregation { get; set; } + + /// + /// Gets or sets the operator that is used to compare the metric data + /// and the threshold. Possible values include: 'Equals', 'NotEquals', + /// 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + public ComparisonOperationType OperatorProperty { get; set; } + + /// + /// Gets or sets the threshold of the metric that triggers the scale + /// action. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + public double Threshold { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MetricName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricName"); + } + if (MetricResourceUri == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricResourceUri"); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs new file mode 100644 index 000000000000..69c4c496e56d --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs @@ -0,0 +1,46 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs new file mode 100644 index 000000000000..28a3519f753d --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs @@ -0,0 +1,46 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs new file mode 100644 index 000000000000..edc855290964 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs @@ -0,0 +1,74 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The repeating times at which this profile begins. This element is not + /// used if the FixedDate element is used. + /// + public partial class Recurrence + { + /// + /// Initializes a new instance of the Recurrence class. + /// + public Recurrence() { } + + /// + /// Initializes a new instance of the Recurrence class. + /// + /// the recurrence frequency. How often the + /// schedule profile should take effect. This value must be Week, + /// meaning each week will have the same set of profiles. Possible + /// values include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', + /// 'Month', 'Year' + /// the scheduling constraints for when the + /// profile begins. + public Recurrence(RecurrenceFrequency frequency, RecurrentSchedule schedule) + { + Frequency = frequency; + Schedule = schedule; + } + + /// + /// Gets or sets the recurrence frequency. How often the schedule + /// profile should take effect. This value must be Week, meaning each + /// week will have the same set of profiles. Possible values include: + /// 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "frequency")] + public RecurrenceFrequency Frequency { get; set; } + + /// + /// Gets or sets the scheduling constraints for when the profile + /// begins. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] + public RecurrentSchedule Schedule { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Schedule == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Schedule"); + } + if (this.Schedule != null) + { + this.Schedule.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs new file mode 100644 index 000000000000..84ce4f31fe64 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs @@ -0,0 +1,35 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for RecurrenceFrequency. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum RecurrenceFrequency + { + [System.Runtime.Serialization.EnumMember(Value = "None")] + None, + [System.Runtime.Serialization.EnumMember(Value = "Second")] + Second, + [System.Runtime.Serialization.EnumMember(Value = "Minute")] + Minute, + [System.Runtime.Serialization.EnumMember(Value = "Hour")] + Hour, + [System.Runtime.Serialization.EnumMember(Value = "Day")] + Day, + [System.Runtime.Serialization.EnumMember(Value = "Week")] + Week, + [System.Runtime.Serialization.EnumMember(Value = "Month")] + Month, + [System.Runtime.Serialization.EnumMember(Value = "Year")] + Year + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs new file mode 100644 index 000000000000..f65146399687 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs @@ -0,0 +1,179 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The scheduling constraints for when the profile begins. + /// + public partial class RecurrentSchedule + { + /// + /// Initializes a new instance of the RecurrentSchedule class. + /// + public RecurrentSchedule() { } + + /// + /// Initializes a new instance of the RecurrentSchedule class. + /// + /// the timezone for the hours of the profile. + /// Some examples of valid timezones are: Dateline Standard Time, + /// UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific + /// Standard Time (Mexico), Pacific Standard Time, US Mountain Standard + /// Time, Mountain Standard Time (Mexico), Mountain Standard Time, + /// Central America Standard Time, Central Standard Time, Central + /// Standard Time (Mexico), Canada Central Standard Time, SA Pacific + /// Standard Time, Eastern Standard Time, US Eastern Standard Time, + /// Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard + /// Time, Central Brazilian Standard Time, SA Western Standard Time, + /// Pacific SA Standard Time, Newfoundland Standard Time, E. South + /// America Standard Time, Argentina Standard Time, SA Eastern Standard + /// Time, Greenland Standard Time, Montevideo Standard Time, Bahia + /// Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard + /// Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT + /// Standard Time, Greenwich Standard Time, W. Europe Standard Time, + /// Central Europe Standard Time, Romance Standard Time, Central + /// European Standard Time, W. Central Africa Standard Time, Namibia + /// Standard Time, Jordan Standard Time, GTB Standard Time, Middle East + /// Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe + /// Standard Time, South Africa Standard Time, FLE Standard Time, + /// Turkey Standard Time, Israel Standard Time, Kaliningrad Standard + /// Time, Libya Standard Time, Arabic Standard Time, Arab Standard + /// Time, Belarus Standard Time, Russian Standard Time, E. Africa + /// Standard Time, Iran Standard Time, Arabian Standard Time, + /// Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard + /// Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan + /// Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, + /// Pakistan Standard Time, India Standard Time, Sri Lanka Standard + /// Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh + /// Standard Time, N. Central Asia Standard Time, Myanmar Standard + /// Time, SE Asia Standard Time, North Asia Standard Time, China + /// Standard Time, North Asia East Standard Time, Singapore Standard + /// Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar + /// Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk + /// Standard Time, Cen. Australia Standard Time, AUS Central Standard + /// Time, E. Australia Standard Time, AUS Eastern Standard Time, West + /// Pacific Standard Time, Tasmania Standard Time, Magadan Standard + /// Time, Vladivostok Standard Time, Russia Time Zone 10, Central + /// Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + /// Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga + /// Standard Time, Samoa Standard Time, Line Islands Standard + /// Time + /// the collection of days that the profile takes + /// effect on. Possible values are Sunday through Saturday. + /// A collection of hours that the profile takes + /// effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM + /// times are not supported). + /// A collection of minutes at which the profile + /// takes effect at. + public RecurrentSchedule(string timeZone, System.Collections.Generic.IList days, System.Collections.Generic.IList hours, System.Collections.Generic.IList minutes) + { + TimeZone = timeZone; + Days = days; + Hours = hours; + Minutes = minutes; + } + + /// + /// Gets or sets the timezone for the hours of the profile. Some + /// examples of valid timezones are: Dateline Standard Time, UTC-11, + /// Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard + /// Time (Mexico), Pacific Standard Time, US Mountain Standard Time, + /// Mountain Standard Time (Mexico), Mountain Standard Time, Central + /// America Standard Time, Central Standard Time, Central Standard Time + /// (Mexico), Canada Central Standard Time, SA Pacific Standard Time, + /// Eastern Standard Time, US Eastern Standard Time, Venezuela Standard + /// Time, Paraguay Standard Time, Atlantic Standard Time, Central + /// Brazilian Standard Time, SA Western Standard Time, Pacific SA + /// Standard Time, Newfoundland Standard Time, E. South America + /// Standard Time, Argentina Standard Time, SA Eastern Standard Time, + /// Greenland Standard Time, Montevideo Standard Time, Bahia Standard + /// Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, + /// Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard + /// Time, Greenwich Standard Time, W. Europe Standard Time, Central + /// Europe Standard Time, Romance Standard Time, Central European + /// Standard Time, W. Central Africa Standard Time, Namibia Standard + /// Time, Jordan Standard Time, GTB Standard Time, Middle East Standard + /// Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard + /// Time, South Africa Standard Time, FLE Standard Time, Turkey + /// Standard Time, Israel Standard Time, Kaliningrad Standard Time, + /// Libya Standard Time, Arabic Standard Time, Arab Standard Time, + /// Belarus Standard Time, Russian Standard Time, E. Africa Standard + /// Time, Iran Standard Time, Arabian Standard Time, Azerbaijan + /// Standard Time, Russia Time Zone 3, Mauritius Standard Time, + /// Georgian Standard Time, Caucasus Standard Time, Afghanistan + /// Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, + /// Pakistan Standard Time, India Standard Time, Sri Lanka Standard + /// Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh + /// Standard Time, N. Central Asia Standard Time, Myanmar Standard + /// Time, SE Asia Standard Time, North Asia Standard Time, China + /// Standard Time, North Asia East Standard Time, Singapore Standard + /// Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar + /// Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk + /// Standard Time, Cen. Australia Standard Time, AUS Central Standard + /// Time, E. Australia Standard Time, AUS Eastern Standard Time, West + /// Pacific Standard Time, Tasmania Standard Time, Magadan Standard + /// Time, Vladivostok Standard Time, Russia Time Zone 10, Central + /// Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + /// Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga + /// Standard Time, Samoa Standard Time, Line Islands Standard Time + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + + /// + /// Gets or sets the collection of days that the profile takes effect + /// on. Possible values are Sunday through Saturday. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "days")] + public System.Collections.Generic.IList Days { get; set; } + + /// + /// Gets or sets a collection of hours that the profile takes effect + /// on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times + /// are not supported). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "hours")] + public System.Collections.Generic.IList Hours { get; set; } + + /// + /// Gets or sets a collection of minutes at which the profile takes + /// effect at. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "minutes")] + public System.Collections.Generic.IList Minutes { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TimeZone == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TimeZone"); + } + if (Days == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Days"); + } + if (Hours == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Hours"); + } + if (Minutes == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Minutes"); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs new file mode 100644 index 000000000000..d88f372468a9 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs @@ -0,0 +1,84 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// An azure resource object + /// + public partial class Resource : Microsoft.Rest.Azure.IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() { } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Resource location + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + } + + /// + /// Gets azure resource Id + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets or sets azure resource name + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets azure resource type + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs new file mode 100644 index 000000000000..e2ac102af6c4 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs @@ -0,0 +1,61 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Specifies the retention policy for the log. + /// + public partial class RetentionPolicy + { + /// + /// Initializes a new instance of the RetentionPolicy class. + /// + public RetentionPolicy() { } + + /// + /// Initializes a new instance of the RetentionPolicy class. + /// + /// a value indicating whether the retention + /// policy is enabled. + /// the number of days for the retention in days. A + /// value of 0 will retain the events indefinitely. + public RetentionPolicy(bool enabled, int days) + { + Enabled = enabled; + Days = days; + } + + /// + /// Gets or sets a value indicating whether the retention policy is + /// enabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool Enabled { get; set; } + + /// + /// Gets or sets the number of days for the retention in days. A value + /// of 0 will retain the events indefinitely. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "days")] + public int Days { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs new file mode 100644 index 000000000000..cc2906ee8607 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs @@ -0,0 +1,26 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The action that is performed when the alert rule becomes active, and + /// when an alert condition is resolved. + /// + public partial class RuleAction + { + /// + /// Initializes a new instance of the RuleAction class. + /// + public RuleAction() { } + + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs new file mode 100644 index 000000000000..35ae6fa4a972 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs @@ -0,0 +1,25 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The condition that results in the alert rule being activated. + /// + public partial class RuleCondition + { + /// + /// Initializes a new instance of the RuleCondition class. + /// + public RuleCondition() { } + + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs new file mode 100644 index 000000000000..b267fdde56b8 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs @@ -0,0 +1,25 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The resource from which the rule collects its data. + /// + public partial class RuleDataSource + { + /// + /// Initializes a new instance of the RuleDataSource class. + /// + public RuleDataSource() { } + + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs new file mode 100644 index 000000000000..7fd91a30a6eb --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs @@ -0,0 +1,55 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Specifies the action to send email when the rule condition is + /// evaluated. The discriminator is always RuleEmailAction in this case. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleEmailAction")] + public partial class RuleEmailAction : RuleAction + { + /// + /// Initializes a new instance of the RuleEmailAction class. + /// + public RuleEmailAction() { } + + /// + /// Initializes a new instance of the RuleEmailAction class. + /// + /// Whether the administrators + /// (service and co-adiminstrators) of the service should be notified + /// when the alert is activated. + /// the list of administrator's custom email + /// addresses notifiy of the activation of the alert. + public RuleEmailAction(bool? sendToServiceOwners = default(bool?), System.Collections.Generic.IList customEmails = default(System.Collections.Generic.IList)) + { + SendToServiceOwners = sendToServiceOwners; + CustomEmails = customEmails; + } + + /// + /// Gets or sets whether the administrators (service and + /// co-adiminstrators) of the service should be notified when the alert + /// is activated. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sendToServiceOwners")] + public bool? SendToServiceOwners { get; set; } + + /// + /// Gets or sets the list of administrator's custom email addresses + /// notifiy of the activation of the alert. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "customEmails")] + public System.Collections.Generic.IList CustomEmails { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs new file mode 100644 index 000000000000..8d98ca69adaf --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs @@ -0,0 +1,41 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The claims for a rule management event data source. + /// + public partial class RuleManagementEventClaimsDataSource + { + /// + /// Initializes a new instance of the + /// RuleManagementEventClaimsDataSource class. + /// + public RuleManagementEventClaimsDataSource() { } + + /// + /// Initializes a new instance of the + /// RuleManagementEventClaimsDataSource class. + /// + /// the email address. + public RuleManagementEventClaimsDataSource(string emailAddress = default(string)) + { + EmailAddress = emailAddress; + } + + /// + /// Gets or sets the email address. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "emailAddress")] + public string EmailAddress { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs new file mode 100644 index 000000000000..848374b55a30 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs @@ -0,0 +1,122 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// A rule management event data source. The discriminator fields is always + /// RuleManagementEventDataSource in this case. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleManagementEventDataSource")] + public partial class RuleManagementEventDataSource : RuleDataSource + { + /// + /// Initializes a new instance of the RuleManagementEventDataSource + /// class. + /// + public RuleManagementEventDataSource() { } + + /// + /// Initializes a new instance of the RuleManagementEventDataSource + /// class. + /// + /// the event name. + /// the event source. + /// the level. + /// The name of the operation that should + /// be checked for. If no name is provided, any operation will + /// match. + /// the resource group name. + /// the resource provider + /// name. + /// the resource uri. + /// The status of the operation that should be + /// checked for. If no status is provided, any status will + /// match. + /// the substatus. + /// the claims. + public RuleManagementEventDataSource(string eventName = default(string), string eventSource = default(string), string level = default(string), string operationName = default(string), string resourceGroupName = default(string), string resourceProviderName = default(string), string resourceUri = default(string), string status = default(string), string subStatus = default(string), RuleManagementEventClaimsDataSource claims = default(RuleManagementEventClaimsDataSource)) + { + EventName = eventName; + EventSource = eventSource; + Level = level; + OperationName = operationName; + ResourceGroupName = resourceGroupName; + ResourceProviderName = resourceProviderName; + ResourceUri = resourceUri; + Status = status; + SubStatus = subStatus; + Claims = claims; + } + + /// + /// Gets or sets the event name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] + public string EventName { get; set; } + + /// + /// Gets or sets the event source. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eventSource")] + public string EventSource { get; set; } + + /// + /// Gets or sets the level. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "level")] + public string Level { get; set; } + + /// + /// Gets or sets the name of the operation that should be checked for. + /// If no name is provided, any operation will match. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operationName")] + public string OperationName { get; set; } + + /// + /// Gets or sets the resource group name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroupName")] + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets the resource provider name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceProviderName")] + public string ResourceProviderName { get; set; } + + /// + /// Gets or sets the resource uri. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceUri")] + public string ResourceUri { get; set; } + + /// + /// Gets or sets the status of the operation that should be checked + /// for. If no status is provided, any status will match. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the substatus. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subStatus")] + public string SubStatus { get; set; } + + /// + /// Gets or sets the claims. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "claims")] + public RuleManagementEventClaimsDataSource Claims { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs new file mode 100644 index 000000000000..ee06756d0dba --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs @@ -0,0 +1,53 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// A rule metric data source. The discriminator value is always + /// RuleMetricDataSource in this case. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleMetricDataSource")] + public partial class RuleMetricDataSource : RuleDataSource + { + /// + /// Initializes a new instance of the RuleMetricDataSource class. + /// + public RuleMetricDataSource() { } + + /// + /// Initializes a new instance of the RuleMetricDataSource class. + /// + /// the resource identifier of the resource + /// the rule monitors. + /// the name of the metric that defines what + /// the rule monitors. + public RuleMetricDataSource(string resourceUri = default(string), string metricName = default(string)) + { + ResourceUri = resourceUri; + MetricName = metricName; + } + + /// + /// Gets or sets the resource identifier of the resource the rule + /// monitors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceUri")] + public string ResourceUri { get; set; } + + /// + /// Gets or sets the name of the metric that defines what the rule + /// monitors. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metricName")] + public string MetricName { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs new file mode 100644 index 000000000000..a2b99e51d316 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs @@ -0,0 +1,54 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Specifies the action to post to service when the rule condition is + /// evaluated. The discriminator is always RuleWebhookAction in this case. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleWebhookAction")] + public partial class RuleWebhookAction : RuleAction + { + /// + /// Initializes a new instance of the RuleWebhookAction class. + /// + public RuleWebhookAction() { } + + /// + /// Initializes a new instance of the RuleWebhookAction class. + /// + /// the service uri to Post the notitication + /// when the alert activates or resolves. + /// the dictionary of custom properties to + /// include with the post operation. These data are appended to the + /// webhook payload. + public RuleWebhookAction(string serviceUri = default(string), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary)) + { + ServiceUri = serviceUri; + Properties = properties; + } + + /// + /// Gets or sets the service uri to Post the notitication when the + /// alert activates or resolves. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceUri")] + public string ServiceUri { get; set; } + + /// + /// Gets or sets the dictionary of custom properties to include with + /// the post operation. These data are appended to the webhook payload. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public System.Collections.Generic.IDictionary Properties { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs new file mode 100644 index 000000000000..3e7bd688daa7 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs @@ -0,0 +1,88 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The parameters for the scaling action. + /// + public partial class ScaleAction + { + /// + /// Initializes a new instance of the ScaleAction class. + /// + public ScaleAction() { } + + /// + /// Initializes a new instance of the ScaleAction class. + /// + /// the scale direction. Whether the scaling + /// action increases or decreases the number of instances. Possible + /// values include: 'None', 'Increase', 'Decrease' + /// the type of action that should occur when the + /// scale rule fires. Possible values include: 'ChangeCount', + /// 'PercentChangeCount', 'ExactCount' + /// the amount of time to wait since the last + /// scaling action before this action occurs. It must be between 1 week + /// and 1 minute in ISO 8601 format. + /// the number of instances that are involved in + /// the scaling action. This value must be 1 or greater. The default + /// value is 1. + public ScaleAction(ScaleDirection direction, ScaleType type, System.TimeSpan cooldown, string value = default(string)) + { + Direction = direction; + Type = type; + Value = value; + Cooldown = cooldown; + } + + /// + /// Gets or sets the scale direction. Whether the scaling action + /// increases or decreases the number of instances. Possible values + /// include: 'None', 'Increase', 'Decrease' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + public ScaleDirection Direction { get; set; } + + /// + /// Gets or sets the type of action that should occur when the scale + /// rule fires. Possible values include: 'ChangeCount', + /// 'PercentChangeCount', 'ExactCount' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public ScaleType Type { get; set; } + + /// + /// Gets or sets the number of instances that are involved in the + /// scaling action. This value must be 1 or greater. The default value + /// is 1. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets the amount of time to wait since the last scaling + /// action before this action occurs. It must be between 1 week and 1 + /// minute in ISO 8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cooldown")] + public System.TimeSpan Cooldown { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs new file mode 100644 index 000000000000..3846c71cdfe1 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs @@ -0,0 +1,86 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// The number of instances that can be used during this profile. + /// + public partial class ScaleCapacity + { + /// + /// Initializes a new instance of the ScaleCapacity class. + /// + public ScaleCapacity() { } + + /// + /// Initializes a new instance of the ScaleCapacity class. + /// + /// the minimum number of instances for the + /// resource. + /// the maximum number of instances for the + /// resource. The actual maximum number of instances is limited by the + /// cores that are available in the subscription. + /// the number of instances that will be + /// set if metrics are not available for evaluation. The default is + /// only used if the current instance count is lower than the + /// default. + public ScaleCapacity(string minimum, string maximum, string defaultProperty) + { + Minimum = minimum; + Maximum = maximum; + DefaultProperty = defaultProperty; + } + + /// + /// Gets or sets the minimum number of instances for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "minimum")] + public string Minimum { get; set; } + + /// + /// Gets or sets the maximum number of instances for the resource. The + /// actual maximum number of instances is limited by the cores that are + /// available in the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maximum")] + public string Maximum { get; set; } + + /// + /// Gets or sets the number of instances that will be set if metrics + /// are not available for evaluation. The default is only used if the + /// current instance count is lower than the default. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "default")] + public string DefaultProperty { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Minimum == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Minimum"); + } + if (Maximum == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Maximum"); + } + if (DefaultProperty == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DefaultProperty"); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs new file mode 100644 index 000000000000..b2738ce2bd16 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs @@ -0,0 +1,25 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for ScaleDirection. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ScaleDirection + { + [System.Runtime.Serialization.EnumMember(Value = "None")] + None, + [System.Runtime.Serialization.EnumMember(Value = "Increase")] + Increase, + [System.Runtime.Serialization.EnumMember(Value = "Decrease")] + Decrease + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs new file mode 100644 index 000000000000..80072773e03a --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs @@ -0,0 +1,74 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// A rule that provide the triggers and parameters for the scaling action. + /// + public partial class ScaleRule + { + /// + /// Initializes a new instance of the ScaleRule class. + /// + public ScaleRule() { } + + /// + /// Initializes a new instance of the ScaleRule class. + /// + /// the trigger that results in a scaling + /// action. + /// the parameters for the scaling + /// action. + public ScaleRule(MetricTrigger metricTrigger, ScaleAction scaleAction) + { + MetricTrigger = metricTrigger; + ScaleAction = scaleAction; + } + + /// + /// Gets or sets the trigger that results in a scaling action. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metricTrigger")] + public MetricTrigger MetricTrigger { get; set; } + + /// + /// Gets or sets the parameters for the scaling action. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scaleAction")] + public ScaleAction ScaleAction { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MetricTrigger == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricTrigger"); + } + if (ScaleAction == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ScaleAction"); + } + if (this.MetricTrigger != null) + { + this.MetricTrigger.Validate(); + } + if (this.ScaleAction != null) + { + this.ScaleAction.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs new file mode 100644 index 000000000000..445f5d0ff670 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs @@ -0,0 +1,25 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for ScaleType. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum ScaleType + { + [System.Runtime.Serialization.EnumMember(Value = "ChangeCount")] + ChangeCount, + [System.Runtime.Serialization.EnumMember(Value = "PercentChangeCount")] + PercentChangeCount, + [System.Runtime.Serialization.EnumMember(Value = "ExactCount")] + ExactCount + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs new file mode 100644 index 000000000000..372ccd38a57e --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs @@ -0,0 +1,125 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Description of a service diagnostic setting + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class ServiceDiagnosticSettingsResource : Resource + { + /// + /// Initializes a new instance of the ServiceDiagnosticSettingsResource + /// class. + /// + public ServiceDiagnosticSettingsResource() { } + + /// + /// Initializes a new instance of the ServiceDiagnosticSettingsResource + /// class. + /// + /// Resource location + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + /// The resource ID of the storage + /// account to which you would like to send Diagnostic Logs. + /// The service bus rule ID of the + /// service bus namespace in which you would like to have Event Hubs + /// created for streaming Diagnostic Logs. The rule ID is of the + /// format: '{service bus resource ID}/authorizationrules/{key + /// name}'. + /// the list of metric settings. + /// the list of logs settings. + /// The workspace ID (resource ID of a Log + /// Analytics workspace) for a Log Analytics workspace to which you + /// would like to send Diagnostic Logs. Example: + /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + public ServiceDiagnosticSettingsResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList metrics = default(System.Collections.Generic.IList), System.Collections.Generic.IList logs = default(System.Collections.Generic.IList), string workspaceId = default(string)) + : base(location, id, name, type, tags) + { + StorageAccountId = storageAccountId; + ServiceBusRuleId = serviceBusRuleId; + Metrics = metrics; + Logs = logs; + WorkspaceId = workspaceId; + } + + /// + /// Gets or sets the resource ID of the storage account to which you + /// would like to send Diagnostic Logs. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] + public string StorageAccountId { get; set; } + + /// + /// Gets or sets the service bus rule ID of the service bus namespace + /// in which you would like to have Event Hubs created for streaming + /// Diagnostic Logs. The rule ID is of the format: '{service bus + /// resource ID}/authorizationrules/{key name}'. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] + public string ServiceBusRuleId { get; set; } + + /// + /// Gets or sets the list of metric settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.metrics")] + public System.Collections.Generic.IList Metrics { get; set; } + + /// + /// Gets or sets the list of logs settings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.logs")] + public System.Collections.Generic.IList Logs { get; set; } + + /// + /// Gets or sets the workspace ID (resource ID of a Log Analytics + /// workspace) for a Log Analytics workspace to which you would like to + /// send Diagnostic Logs. Example: + /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceId")] + public string WorkspaceId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (this.Metrics != null) + { + foreach (var element in this.Metrics) + { + if (element != null) + { + element.Validate(); + } + } + } + if (this.Logs != null) + { + foreach (var element1 in this.Logs) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs new file mode 100644 index 000000000000..e42c1aa06b39 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs @@ -0,0 +1,102 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// A rule condition based on a metric crossing a threshold. + /// + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.ThresholdRuleCondition")] + public partial class ThresholdRuleCondition : RuleCondition + { + /// + /// Initializes a new instance of the ThresholdRuleCondition class. + /// + public ThresholdRuleCondition() { } + + /// + /// Initializes a new instance of the ThresholdRuleCondition class. + /// + /// the operator used to compare the + /// data and the threshold. Possible values include: 'GreaterThan', + /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + /// the threshold value that activates the + /// alert. + /// the resource from which the rule collects + /// its data. For this type dataSource will always be of type + /// RuleMetricDataSource. + /// the period of time (in ISO 8601 duration + /// format) that is used to monitor alert activity based on the + /// threshold. If specified then it must be between 5 minutes and 1 + /// day. + /// the time aggregation operator. How + /// the data that are collected should be combined over time. The + /// default value is the PrimaryAggregationType of the Metric. Possible + /// values include: 'Average', 'Minimum', 'Maximum', 'Total', + /// 'Last' + public ThresholdRuleCondition(ConditionOperator operatorProperty, double threshold, RuleDataSource dataSource = default(RuleDataSource), System.TimeSpan? windowSize = default(System.TimeSpan?), TimeAggregationOperator? timeAggregation = default(TimeAggregationOperator?)) + { + DataSource = dataSource; + OperatorProperty = operatorProperty; + Threshold = threshold; + WindowSize = windowSize; + TimeAggregation = timeAggregation; + } + + /// + /// Gets or sets the resource from which the rule collects its data. + /// For this type dataSource will always be of type + /// RuleMetricDataSource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] + public RuleDataSource DataSource { get; set; } + + /// + /// Gets or sets the operator used to compare the data and the + /// threshold. Possible values include: 'GreaterThan', + /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + public ConditionOperator OperatorProperty { get; set; } + + /// + /// Gets or sets the threshold value that activates the alert. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + public double Threshold { get; set; } + + /// + /// Gets or sets the period of time (in ISO 8601 duration format) that + /// is used to monitor alert activity based on the threshold. If + /// specified then it must be between 5 minutes and 1 day. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "windowSize")] + public System.TimeSpan? WindowSize { get; set; } + + /// + /// Gets or sets the time aggregation operator. How the data that are + /// collected should be combined over time. The default value is the + /// PrimaryAggregationType of the Metric. Possible values include: + /// 'Average', 'Minimum', 'Maximum', 'Total', 'Last' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeAggregation")] + public TimeAggregationOperator? TimeAggregation { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs new file mode 100644 index 000000000000..d563a04cee10 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs @@ -0,0 +1,29 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for TimeAggregationOperator. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TimeAggregationOperator + { + [System.Runtime.Serialization.EnumMember(Value = "Average")] + Average, + [System.Runtime.Serialization.EnumMember(Value = "Minimum")] + Minimum, + [System.Runtime.Serialization.EnumMember(Value = "Maximum")] + Maximum, + [System.Runtime.Serialization.EnumMember(Value = "Total")] + Total, + [System.Runtime.Serialization.EnumMember(Value = "Last")] + Last + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs new file mode 100644 index 000000000000..f6cd123ab4ed --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs @@ -0,0 +1,29 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for TimeAggregationType. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum TimeAggregationType + { + [System.Runtime.Serialization.EnumMember(Value = "Average")] + Average, + [System.Runtime.Serialization.EnumMember(Value = "Minimum")] + Minimum, + [System.Runtime.Serialization.EnumMember(Value = "Maximum")] + Maximum, + [System.Runtime.Serialization.EnumMember(Value = "Total")] + Total, + [System.Runtime.Serialization.EnumMember(Value = "Count")] + Count + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs new file mode 100644 index 000000000000..1466f0c69f1b --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs @@ -0,0 +1,150 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// A specific date-time for the profile. + /// + public partial class TimeWindow + { + /// + /// Initializes a new instance of the TimeWindow class. + /// + public TimeWindow() { } + + /// + /// Initializes a new instance of the TimeWindow class. + /// + /// the start time for the profile in ISO 8601 + /// format. + /// the end time for the profile in ISO 8601 + /// format. + /// the timezone of the start and end times for + /// the profile. Some examples of valid timezones are: Dateline + /// Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard + /// Time, Pacific Standard Time (Mexico), Pacific Standard Time, US + /// Mountain Standard Time, Mountain Standard Time (Mexico), Mountain + /// Standard Time, Central America Standard Time, Central Standard + /// Time, Central Standard Time (Mexico), Canada Central Standard Time, + /// SA Pacific Standard Time, Eastern Standard Time, US Eastern + /// Standard Time, Venezuela Standard Time, Paraguay Standard Time, + /// Atlantic Standard Time, Central Brazilian Standard Time, SA Western + /// Standard Time, Pacific SA Standard Time, Newfoundland Standard + /// Time, E. South America Standard Time, Argentina Standard Time, SA + /// Eastern Standard Time, Greenland Standard Time, Montevideo Standard + /// Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, + /// Azores Standard Time, Cape Verde Standard Time, Morocco Standard + /// Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe + /// Standard Time, Central Europe Standard Time, Romance Standard Time, + /// Central European Standard Time, W. Central Africa Standard Time, + /// Namibia Standard Time, Jordan Standard Time, GTB Standard Time, + /// Middle East Standard Time, Egypt Standard Time, Syria Standard + /// Time, E. Europe Standard Time, South Africa Standard Time, FLE + /// Standard Time, Turkey Standard Time, Israel Standard Time, + /// Kaliningrad Standard Time, Libya Standard Time, Arabic Standard + /// Time, Arab Standard Time, Belarus Standard Time, Russian Standard + /// Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard + /// Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius + /// Standard Time, Georgian Standard Time, Caucasus Standard Time, + /// Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg + /// Standard Time, Pakistan Standard Time, India Standard Time, Sri + /// Lanka Standard Time, Nepal Standard Time, Central Asia Standard + /// Time, Bangladesh Standard Time, N. Central Asia Standard Time, + /// Myanmar Standard Time, SE Asia Standard Time, North Asia Standard + /// Time, China Standard Time, North Asia East Standard Time, Singapore + /// Standard Time, W. Australia Standard Time, Taipei Standard Time, + /// Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard + /// Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS + /// Central Standard Time, E. Australia Standard Time, AUS Eastern + /// Standard Time, West Pacific Standard Time, Tasmania Standard Time, + /// Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone + /// 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand + /// Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, + /// Tonga Standard Time, Samoa Standard Time, Line Islands Standard + /// Time + public TimeWindow(System.DateTime start, System.DateTime end, string timeZone = default(string)) + { + TimeZone = timeZone; + Start = start; + End = end; + } + + /// + /// Gets or sets the timezone of the start and end times for the + /// profile. Some examples of valid timezones are: Dateline Standard + /// Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, + /// Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain + /// Standard Time, Mountain Standard Time (Mexico), Mountain Standard + /// Time, Central America Standard Time, Central Standard Time, Central + /// Standard Time (Mexico), Canada Central Standard Time, SA Pacific + /// Standard Time, Eastern Standard Time, US Eastern Standard Time, + /// Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard + /// Time, Central Brazilian Standard Time, SA Western Standard Time, + /// Pacific SA Standard Time, Newfoundland Standard Time, E. South + /// America Standard Time, Argentina Standard Time, SA Eastern Standard + /// Time, Greenland Standard Time, Montevideo Standard Time, Bahia + /// Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard + /// Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT + /// Standard Time, Greenwich Standard Time, W. Europe Standard Time, + /// Central Europe Standard Time, Romance Standard Time, Central + /// European Standard Time, W. Central Africa Standard Time, Namibia + /// Standard Time, Jordan Standard Time, GTB Standard Time, Middle East + /// Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe + /// Standard Time, South Africa Standard Time, FLE Standard Time, + /// Turkey Standard Time, Israel Standard Time, Kaliningrad Standard + /// Time, Libya Standard Time, Arabic Standard Time, Arab Standard + /// Time, Belarus Standard Time, Russian Standard Time, E. Africa + /// Standard Time, Iran Standard Time, Arabian Standard Time, + /// Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard + /// Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan + /// Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, + /// Pakistan Standard Time, India Standard Time, Sri Lanka Standard + /// Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh + /// Standard Time, N. Central Asia Standard Time, Myanmar Standard + /// Time, SE Asia Standard Time, North Asia Standard Time, China + /// Standard Time, North Asia East Standard Time, Singapore Standard + /// Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar + /// Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk + /// Standard Time, Cen. Australia Standard Time, AUS Central Standard + /// Time, E. Australia Standard Time, AUS Eastern Standard Time, West + /// Pacific Standard Time, Tasmania Standard Time, Magadan Standard + /// Time, Vladivostok Standard Time, Russia Time Zone 10, Central + /// Pacific Standard Time, Russia Time Zone 11, New Zealand Standard + /// Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga + /// Standard Time, Samoa Standard Time, Line Islands Standard Time + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] + public string TimeZone { get; set; } + + /// + /// Gets or sets the start time for the profile in ISO 8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "start")] + public System.DateTime Start { get; set; } + + /// + /// Gets or sets the end time for the profile in ISO 8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "end")] + public System.DateTime End { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs new file mode 100644 index 000000000000..e21afb3b78b9 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs @@ -0,0 +1,49 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using System.Linq; + + /// + /// Webhook notification of an autoscale event. + /// + public partial class WebhookNotification + { + /// + /// Initializes a new instance of the WebhookNotification class. + /// + public WebhookNotification() { } + + /// + /// Initializes a new instance of the WebhookNotification class. + /// + /// the service address to receive the + /// notification. + /// a property bag of settings. This value can + /// be empty. + public WebhookNotification(string serviceUri = default(string), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary)) + { + ServiceUri = serviceUri; + Properties = properties; + } + + /// + /// Gets or sets the service address to receive the notification. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "serviceUri")] + public string ServiceUri { get; set; } + + /// + /// Gets or sets a property bag of settings. This value can be empty. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public System.Collections.Generic.IDictionary Properties { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs new file mode 100644 index 000000000000..1650727616e1 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs @@ -0,0 +1,335 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Composite Swagger for Monitor Management Client + /// + public partial class MonitorManagementClient : Microsoft.Rest.ServiceClient, IMonitorManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + + /// + /// The Azure subscription Id. + /// + public string SubscriptionId { get; set; } + + /// + /// Gets or sets the preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running Operations. + /// Default value is 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IAutoscaleSettingsOperations. + /// + public virtual IAutoscaleSettingsOperations AutoscaleSettings { get; private set; } + + /// + /// Gets the IServiceDiagnosticSettingsOperations. + /// + public virtual IServiceDiagnosticSettingsOperations ServiceDiagnosticSettings { get; private set; } + + /// + /// Gets the IAlertRulesOperations. + /// + public virtual IAlertRulesOperations AlertRules { get; private set; } + + /// + /// Gets the IAlertRuleIncidentsOperations. + /// + public virtual IAlertRuleIncidentsOperations AlertRuleIncidents { get; private set; } + + /// + /// Gets the ILogProfilesOperations. + /// + public virtual ILogProfilesOperations LogProfiles { get; private set; } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MonitorManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + { + this.Initialize(); + } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MonitorManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + this.Initialize(); + } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected MonitorManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected MonitorManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MonitorManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + this.AutoscaleSettings = new AutoscaleSettingsOperations(this); + this.ServiceDiagnosticSettings = new ServiceDiagnosticSettingsOperations(this); + this.AlertRules = new AlertRulesOperations(this); + this.AlertRuleIncidents = new AlertRuleIncidentsOperations(this); + this.LogProfiles = new LogProfilesOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("odata.type")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("odata.type")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("odata.type")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("odata.type")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("odata.type")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("odata.type")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs new file mode 100644 index 000000000000..704a3827ba58 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs @@ -0,0 +1,423 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// ServiceDiagnosticSettingsOperations operations. + /// + internal partial class ServiceDiagnosticSettingsOperations : Microsoft.Rest.IServiceOperations, IServiceDiagnosticSettingsOperations + { + /// + /// Initializes a new instance of the ServiceDiagnosticSettingsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorManagementClient + /// + public MonitorManagementClient Client { get; private set; } + + /// + /// Gets the active diagnostic settings for the specified resource. + /// + /// + /// The identifier of the resource. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceUri, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceUri == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-07-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceUri", resourceUri); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/service").ToString(); + _url = _url.Replace("{resourceUri}", System.Uri.EscapeDataString(resourceUri)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update new diagnostic settings for the specified resource. + /// + /// + /// The identifier of the resource. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceUri == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + } + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-07-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceUri", resourceUri); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/service").ToString(); + _url = _url.Replace("{resourceUri}", System.Uri.EscapeDataString(resourceUri)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs new file mode 100644 index 000000000000..8edc7829de3e --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs @@ -0,0 +1,95 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ServiceDiagnosticSettingsOperations. + /// + public static partial class ServiceDiagnosticSettingsOperationsExtensions + { + /// + /// Gets the active diagnostic settings for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + public static ServiceDiagnosticSettingsResource Get(this IServiceDiagnosticSettingsOperations operations, string resourceUri) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IServiceDiagnosticSettingsOperations)s).GetAsync(resourceUri), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Gets the active diagnostic settings for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update new diagnostic settings for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// Parameters supplied to the operation. + /// + public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IServiceDiagnosticSettingsOperations)s).CreateOrUpdateAsync(resourceUri, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Create or update new diagnostic settings for the specified resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// Parameters supplied to the operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceUri, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs new file mode 100644 index 000000000000..c96f5892f246 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs @@ -0,0 +1,443 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// ActivityLogsOperations operations. + /// + internal partial class ActivityLogsOperations : Microsoft.Rest.IServiceOperations, IActivityLogsOperations + { + /// + /// Initializes a new instance of the ActivityLogsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ActivityLogsOperations(MonitorClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorClient + /// + public MonitorClient Client { get; private set; } + + /// + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: + /// authorization, channels, claims, correlationId, description, eventDataId, + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("select", select); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs new file mode 100644 index 000000000000..f391a5ea31aa --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs @@ -0,0 +1,173 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ActivityLogsOperations. + /// + public static partial class ActivityLogsOperationsExtensions + { + /// + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: + /// authorization, channels, claims, correlationId, description, eventDataId, + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId + /// + public static Microsoft.Rest.Azure.IPage List(this IActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string)) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IActivityLogsOperations)s).ListAsync(odataQuery, select), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: + /// authorization, channels, claims, correlationId, description, eventDataId, + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, select, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IActivityLogsOperations operations, string nextPageLink) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IActivityLogsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Provides the list of events. The **$filter** is very restricted and allows + /// only the following patterns. - List events for a resource group: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceGroupName eq '<ResourceGroupName>'. - List events for + /// resource: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le + /// '<End Time>' and eventChannels eq 'Admin, Operation'. -List events + /// for a resource provider: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceProvider eq '<ResourceProviderName>'. - List + /// events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IActivityLogsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs new file mode 100644 index 000000000000..9d9b65bac136 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs @@ -0,0 +1,210 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// EventCategoriesOperations operations. + /// + internal partial class EventCategoriesOperations : Microsoft.Rest.IServiceOperations, IEventCategoriesOperations + { + /// + /// Initializes a new instance of the EventCategoriesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal EventCategoriesOperations(MonitorClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorClient + /// + public MonitorClient Client { get; private set; } + + /// + /// get the list of available event categories supported in the Activity Log + /// Service. The current list includes the following: Aministrative, Security, + /// ServiceHealth, Alert, Recommendation, Policy. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventcategories").ToString(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs new file mode 100644 index 000000000000..0b33471de77e --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs @@ -0,0 +1,53 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for EventCategoriesOperations. + /// + public static partial class EventCategoriesOperationsExtensions + { + /// + /// get the list of available event categories supported in the Activity Log + /// Service. The current list includes the following: Aministrative, Security, + /// ServiceHealth, Alert, Recommendation, Policy. + /// + /// + /// The operations group for this extension method. + /// + public static System.Collections.Generic.IEnumerable List(this IEventCategoriesOperations operations) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IEventCategoriesOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// get the list of available event categories supported in the Activity Log + /// Service. The current list includes the following: Aministrative, Security, + /// ServiceHealth, Alert, Recommendation, Policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IEventCategoriesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs new file mode 100644 index 000000000000..c4c236c61c18 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs @@ -0,0 +1,111 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// ActivityLogsOperations operations. + /// + public partial interface IActivityLogsOperations + { + /// + /// Provides the list of events. The **$filter** is very restricted and + /// allows only the following patterns. - List events for a resource + /// group: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceUri eq + /// '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation'. + /// -List events for a resource provider: $filter=eventTimestamp ge + /// '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is + /// a comma separated list of property names to be returned. Possible + /// values are: authorization, channels, claims, correlationId, + /// description, eventDataId, eventName, eventTimestamp, httpRequest, + /// level, operationId, operationName, properties, resourceGroupName, + /// resourceProviderName, resourceId, status, submissionTimestamp, + /// subStatus, subscriptionId + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Provides the list of events. The **$filter** is very restricted and + /// allows only the following patterns. - List events for a resource + /// group: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceUri eq + /// '<ResourceURI>'. - List events for a subscription: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation'. + /// -List events for a resource provider: $filter=eventTimestamp ge + /// '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs new file mode 100644 index 000000000000..caaa8eb71232 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs @@ -0,0 +1,42 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// EventCategoriesOperations operations. + /// + public partial interface IEventCategoriesOperations + { + /// + /// get the list of available event categories supported in the + /// Activity Log Service. The current list includes the following: + /// Aministrative, Security, ServiceHealth, Alert, Recommendation, + /// Policy. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs new file mode 100644 index 000000000000..7a7bd234883f --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs @@ -0,0 +1,51 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// MetricDefinitionsOperations operations. + /// + public partial interface IMetricDefinitionsOperations + { + /// + /// Lists the metric definitions for the resource. The **$filter** + /// parameter is optional, and can be used to only retrieve certain + /// metric definitions. For example, get just the definition for the + /// CPU percentage counter: $filter=name.value eq '\Processor(_Total)\% + /// Processor Time'. This $filter is very restricted and allows only + /// these 'name eq <value>' clauses separated by or operators. No + /// other syntax is allowed. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs new file mode 100644 index 000000000000..02e437baae10 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs @@ -0,0 +1,66 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// MetricsOperations operations. + /// + public partial interface IMetricsOperations + { + /// + /// **Lists the metric values for a resource**.<br>The + /// **$filter** is used to reduce the set of metric data returned. Some + /// common properties for this expression will be: name.value, + /// aggregationType, startTime, endTime, timeGrain. The filter + /// expression uses these properties with comparison operators (eg. eq, + /// gt, lt) and multiple expressions can be combined with parentheses + /// and 'and/or' operators.<br>Some example filter expressions + /// are:<br>- $filter=(name.value eq 'RunsSucceeded') and + /// aggregationType eq 'Total' and startTime eq 2016-02-20 and endTime + /// eq 2016-02-21 and timeGrain eq duration'PT1M',<br>- + /// $filter=(name.value eq 'RunsSucceeded') and (aggregationType eq + /// 'Total' or aggregationType eq 'Average') and startTime eq + /// 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1H',<br>- $filter=(name.value eq + /// 'ActionsCompleted' or name.value eq 'RunsSucceeded') and + /// (aggregationType eq 'Total' or aggregationType eq 'Average') and + /// startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + /// duration'PT1M'.<br><br> >**NOTE**: When a metrics + /// query comes in with multiple metrics, but with no aggregation types + /// defined, the service will pick the Primary aggregation type of the + /// first metrics to be used as the default aggregation type for all + /// the metrics. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs new file mode 100644 index 000000000000..f33cc532e0b8 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs @@ -0,0 +1,94 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Composite Swagger for Monitor Client + /// + public partial interface IMonitorClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + Microsoft.Rest.ServiceClientCredentials Credentials { get; } + + /// + /// The Azure subscription Id. + /// + string SubscriptionId { get; set; } + + /// + /// Gets or sets the preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running + /// Operations. Default value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IUsageMetricsOperations. + /// + IUsageMetricsOperations UsageMetrics { get; } + + /// + /// Gets the IEventCategoriesOperations. + /// + IEventCategoriesOperations EventCategories { get; } + + /// + /// Gets the IActivityLogsOperations. + /// + IActivityLogsOperations ActivityLogs { get; } + + /// + /// Gets the ITenantActivityLogsOperations. + /// + ITenantActivityLogsOperations TenantActivityLogs { get; } + + /// + /// Gets the IMetricDefinitionsOperations. + /// + IMetricDefinitionsOperations MetricDefinitions { get; } + + /// + /// Gets the IMetricsOperations. + /// + IMetricsOperations Metrics { get; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs new file mode 100644 index 000000000000..cf7ae81a092e --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs @@ -0,0 +1,123 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// TenantActivityLogsOperations operations. + /// + public partial interface ITenantActivityLogsOperations + { + /// + /// get the Activity Logs for the Tenant. Everything that is applicable + /// to the API to get the Activity Log for the subscription is + /// applicable to this API (the parameters, $filter, etc.). One thing + /// to point out here is that this API does *not* retrieve the logs at + /// the individual subscription of the tenant but only surfaces the + /// logs that were generated at the tenant level. The **$filter** is + /// very restricted and allows only the following patterns. - List + /// events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceGroupName eq + /// '<ResourceGroupName>'. - List events for resource: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceProvider eq '<ResourceProviderName>'. - List events + /// for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is + /// a comma separated list of property names to be returned. Possible + /// values are: authorization, channels, claims, correlationId, + /// description, eventDataId, eventName, eventTimestamp, httpRequest, + /// level, operationId, operationName, properties, resourceGroupName, + /// resourceProviderName, resourceId, status, submissionTimestamp, + /// subStatus, subscriptionId + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// get the Activity Logs for the Tenant. Everything that is applicable + /// to the API to get the Activity Log for the subscription is + /// applicable to this API (the parameters, $filter, etc.). One thing + /// to point out here is that this API does *not* retrieve the logs at + /// the individual subscription of the tenant but only surfaces the + /// logs that were generated at the tenant level. The **$filter** is + /// very restricted and allows only the following patterns. - List + /// events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceGroupName eq + /// '<ResourceGroupName>'. - List events for resource: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: + /// $filter=eventTimestamp ge '<Start Time>' and eventTimestamp + /// le '<End Time>' and eventChannels eq 'Admin, Operation' and + /// resourceProvider eq '<ResourceProviderName>'. - List events + /// for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, + /// Operation' and correlationId eq '<CorrelationID>'. No other + /// syntax is allowed. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs new file mode 100644 index 000000000000..80acedaab2c8 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs @@ -0,0 +1,48 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// UsageMetricsOperations operations. + /// + public partial interface IUsageMetricsOperations + { + /// + /// The List operation lists the usage metrics for the resource. + /// + /// + /// The identifier of the resource. + /// + /// + /// The client Api Version. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs new file mode 100644 index 000000000000..7f598b1f0c72 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs @@ -0,0 +1,237 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// MetricDefinitionsOperations operations. + /// + internal partial class MetricDefinitionsOperations : Microsoft.Rest.IServiceOperations, IMetricDefinitionsOperations + { + /// + /// Initializes a new instance of the MetricDefinitionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MetricDefinitionsOperations(MonitorClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorClient + /// + public MonitorClient Client { get; private set; } + + /// + /// Lists the metric definitions for the resource. The **$filter** parameter is + /// optional, and can be used to only retrieve certain metric definitions. For + /// example, get just the definition for the CPU percentage counter: + /// $filter=name.value eq '\Processor(_Total)\% Processor Time'. This $filter + /// is very restricted and allows only these 'name eq <value>' clauses + /// separated by or operators. No other syntax is allowed. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceUri == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + } + string apiVersion = "2016-03-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceUri", resourceUri); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metricDefinitions").ToString(); + _url = _url.Replace("{resourceUri}", resourceUri); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs new file mode 100644 index 000000000000..756ee99295a8 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs @@ -0,0 +1,71 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for MetricDefinitionsOperations. + /// + public static partial class MetricDefinitionsOperationsExtensions + { + /// + /// Lists the metric definitions for the resource. The **$filter** parameter is + /// optional, and can be used to only retrieve certain metric definitions. For + /// example, get just the definition for the CPU percentage counter: + /// $filter=name.value eq '\Processor(_Total)\% Processor Time'. This $filter + /// is very restricted and allows only these 'name eq <value>' clauses + /// separated by or operators. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + public static System.Collections.Generic.IEnumerable List(this IMetricDefinitionsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IMetricDefinitionsOperations)s).ListAsync(resourceUri, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// Lists the metric definitions for the resource. The **$filter** parameter is + /// optional, and can be used to only retrieve certain metric definitions. For + /// example, get just the definition for the CPU percentage counter: + /// $filter=name.value eq '\Processor(_Total)\% Processor Time'. This $filter + /// is very restricted and allows only these 'name eq <value>' clauses + /// separated by or operators. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IMetricDefinitionsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs new file mode 100644 index 000000000000..72802b83c315 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs @@ -0,0 +1,250 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// MetricsOperations operations. + /// + internal partial class MetricsOperations : Microsoft.Rest.IServiceOperations, IMetricsOperations + { + /// + /// Initializes a new instance of the MetricsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MetricsOperations(MonitorClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorClient + /// + public MonitorClient Client { get; private set; } + + /// + /// **Lists the metric values for a resource**.<br>The **$filter** is + /// used to reduce the set of metric data returned. Some common properties for + /// this expression will be: name.value, aggregationType, startTime, endTime, + /// timeGrain. The filter expression uses these properties with comparison + /// operators (eg. eq, gt, lt) and multiple expressions can be combined with + /// parentheses and 'and/or' operators.<br>Some example filter + /// expressions are:<br>- $filter=(name.value eq 'RunsSucceeded') and + /// aggregationType eq 'Total' and startTime eq 2016-02-20 and endTime eq + /// 2016-02-21 and timeGrain eq duration'PT1M',<br>- $filter=(name.value + /// eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq + /// 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and + /// timeGrain eq duration'PT1H',<br>- $filter=(name.value eq + /// 'ActionsCompleted' or name.value eq 'RunsSucceeded') and (aggregationType + /// eq 'Total' or aggregationType eq 'Average') and startTime eq 2016-02-20 and + /// endTime eq 2016-02-21 and timeGrain eq duration'PT1M'.<br><br> + /// >**NOTE**: When a metrics query comes in with multiple metrics, but with + /// no aggregation types defined, the service will pick the Primary aggregation + /// type of the first metrics to be used as the default aggregation type for + /// all the metrics. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceUri == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + } + string apiVersion = "2016-09-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceUri", resourceUri); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metrics").ToString(); + _url = _url.Replace("{resourceUri}", resourceUri); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs new file mode 100644 index 000000000000..a27c756589f5 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs @@ -0,0 +1,97 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for MetricsOperations. + /// + public static partial class MetricsOperationsExtensions + { + /// + /// **Lists the metric values for a resource**.<br>The **$filter** is + /// used to reduce the set of metric data returned. Some common properties for + /// this expression will be: name.value, aggregationType, startTime, endTime, + /// timeGrain. The filter expression uses these properties with comparison + /// operators (eg. eq, gt, lt) and multiple expressions can be combined with + /// parentheses and 'and/or' operators.<br>Some example filter + /// expressions are:<br>- $filter=(name.value eq 'RunsSucceeded') and + /// aggregationType eq 'Total' and startTime eq 2016-02-20 and endTime eq + /// 2016-02-21 and timeGrain eq duration'PT1M',<br>- $filter=(name.value + /// eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq + /// 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and + /// timeGrain eq duration'PT1H',<br>- $filter=(name.value eq + /// 'ActionsCompleted' or name.value eq 'RunsSucceeded') and (aggregationType + /// eq 'Total' or aggregationType eq 'Average') and startTime eq 2016-02-20 and + /// endTime eq 2016-02-21 and timeGrain eq duration'PT1M'.<br><br> + /// >**NOTE**: When a metrics query comes in with multiple metrics, but with + /// no aggregation types defined, the service will pick the Primary aggregation + /// type of the first metrics to be used as the default aggregation type for + /// all the metrics. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + public static System.Collections.Generic.IEnumerable List(this IMetricsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IMetricsOperations)s).ListAsync(resourceUri, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// **Lists the metric values for a resource**.<br>The **$filter** is + /// used to reduce the set of metric data returned. Some common properties for + /// this expression will be: name.value, aggregationType, startTime, endTime, + /// timeGrain. The filter expression uses these properties with comparison + /// operators (eg. eq, gt, lt) and multiple expressions can be combined with + /// parentheses and 'and/or' operators.<br>Some example filter + /// expressions are:<br>- $filter=(name.value eq 'RunsSucceeded') and + /// aggregationType eq 'Total' and startTime eq 2016-02-20 and endTime eq + /// 2016-02-21 and timeGrain eq duration'PT1M',<br>- $filter=(name.value + /// eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq + /// 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and + /// timeGrain eq duration'PT1H',<br>- $filter=(name.value eq + /// 'ActionsCompleted' or name.value eq 'RunsSucceeded') and (aggregationType + /// eq 'Total' or aggregationType eq 'Average') and startTime eq 2016-02-20 and + /// endTime eq 2016-02-21 and timeGrain eq duration'PT1M'.<br><br> + /// >**NOTE**: When a metrics query comes in with multiple metrics, but with + /// no aggregation types defined, the service will pick the Primary aggregation + /// type of the first metrics to be used as the default aggregation type for + /// all the metrics. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IMetricsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs new file mode 100644 index 000000000000..89baa1637e02 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs @@ -0,0 +1,31 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + + /// + /// Defines values for AggregationType. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum AggregationType + { + [System.Runtime.Serialization.EnumMember(Value = "None")] + None, + [System.Runtime.Serialization.EnumMember(Value = "Average")] + Average, + [System.Runtime.Serialization.EnumMember(Value = "Count")] + Count, + [System.Runtime.Serialization.EnumMember(Value = "Minimum")] + Minimum, + [System.Runtime.Serialization.EnumMember(Value = "Maximum")] + Maximum, + [System.Runtime.Serialization.EnumMember(Value = "Total")] + Total + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs new file mode 100644 index 000000000000..6a99aa4f7821 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs @@ -0,0 +1,333 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// The Azure event log entries are of type EventData + /// + public partial class EventData + { + /// + /// Initializes a new instance of the EventData class. + /// + public EventData() { } + + /// + /// Initializes a new instance of the EventData class. + /// + /// the event level. Possible values include: + /// 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' + /// the timestamp of when the event was + /// generated by the Azure service processing the request corresponding + /// the event. It in ISO 8601 format. + /// the timestamp of when the event + /// became available for querying via this API. It is in ISO 8601 + /// format. This value should not be confused eventTimestamp. As there + /// might be a delay between the occurence time of the event, and the + /// time that the event is submitted to the Azure logging + /// infrastructure. + /// the authorization used by the user who + /// has performed the operation that led to this event. This captures + /// the RBAC properties of the event. These usually include the + /// 'action', 'role' and the 'scope' + /// key value pairs to identify ARM + /// permissions. + /// the email address of the user who has + /// performed the operation, the UPN claim or SPN claim based on + /// availability. + /// the description of the event. + /// the Id of this event as required by ARM for RBAC. + /// It contains the EventDataID and a timestamp information. + /// the event data Id. This is a unique + /// identifier for an event. + /// the correlation Id, usually a GUID in + /// the string format. The correlation Id is shared among the events + /// that belong to the same uber operation. + /// the event name. This value should not be + /// confused with OperationName. For practical purposes, OperationName + /// might be more appealing to end users. + /// the event category. + /// the HTTP request info. Usually includes + /// the 'clientRequestId', 'clientIpAddress' (IP address of the user + /// who initiated the event) and 'method' (HTTP method e.g. + /// PUT). + /// the resource group name of the + /// impacted resource. + /// the resource provider name of + /// the impacted resource. + /// the resource uri that uniquely identifies + /// the resource that caused this event. + /// the resource type + /// It is usually a GUID shared among the + /// events corresponding to single operation. This value should not be + /// confused with EventName. + /// the operation name. + /// the set of <Key, Value> pairs + /// (usually a Dictionary<String, String>) that includes details + /// about the event. + /// a string describing the status of the + /// operation. Some typical values are: Started, In progress, + /// Succeeded, Failed, Resolved. + /// the event sub status. Most of the time, + /// when included, this captures the HTTP status code of the REST call. + /// Common values are: OK (HTTP Status Code: 200), Created (HTTP Status + /// Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP + /// Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found + /// (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal + /// Server Error (HTTP Status Code: 500), Service Unavailable (HTTP + /// Status Code:503), Gateway Timeout (HTTP Status Code: 504) + /// the Azure subscription Id usually a + /// GUID. + /// the Azure tenant Id + public EventData(EventLevel level, System.DateTime eventTimestamp, System.DateTime submissionTimestamp, SenderAuthorization authorization = default(SenderAuthorization), System.Collections.Generic.IDictionary claims = default(System.Collections.Generic.IDictionary), string caller = default(string), string description = default(string), string id = default(string), string eventDataId = default(string), string correlationId = default(string), LocalizableString eventName = default(LocalizableString), LocalizableString category = default(LocalizableString), HttpRequestInfo httpRequest = default(HttpRequestInfo), string resourceGroupName = default(string), LocalizableString resourceProviderName = default(LocalizableString), string resourceId = default(string), LocalizableString resourceType = default(LocalizableString), string operationId = default(string), LocalizableString operationName = default(LocalizableString), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary), LocalizableString status = default(LocalizableString), LocalizableString subStatus = default(LocalizableString), string subscriptionId = default(string), string tenantId = default(string)) + { + Authorization = authorization; + Claims = claims; + Caller = caller; + Description = description; + Id = id; + EventDataId = eventDataId; + CorrelationId = correlationId; + EventName = eventName; + Category = category; + HttpRequest = httpRequest; + Level = level; + ResourceGroupName = resourceGroupName; + ResourceProviderName = resourceProviderName; + ResourceId = resourceId; + ResourceType = resourceType; + OperationId = operationId; + OperationName = operationName; + Properties = properties; + Status = status; + SubStatus = subStatus; + EventTimestamp = eventTimestamp; + SubmissionTimestamp = submissionTimestamp; + SubscriptionId = subscriptionId; + TenantId = tenantId; + } + + /// + /// Gets or sets the authorization used by the user who has performed + /// the operation that led to this event. This captures the RBAC + /// properties of the event. These usually include the 'action', 'role' + /// and the 'scope' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "authorization")] + public SenderAuthorization Authorization { get; set; } + + /// + /// Gets or sets key value pairs to identify ARM permissions. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "claims")] + public System.Collections.Generic.IDictionary Claims { get; set; } + + /// + /// Gets or sets the email address of the user who has performed the + /// operation, the UPN claim or SPN claim based on availability. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "caller")] + public string Caller { get; set; } + + /// + /// Gets or sets the description of the event. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the Id of this event as required by ARM for RBAC. It + /// contains the EventDataID and a timestamp information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the event data Id. This is a unique identifier for an + /// event. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eventDataId")] + public string EventDataId { get; set; } + + /// + /// Gets or sets the correlation Id, usually a GUID in the string + /// format. The correlation Id is shared among the events that belong + /// to the same uber operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "correlationId")] + public string CorrelationId { get; set; } + + /// + /// Gets or sets the event name. This value should not be confused with + /// OperationName. For practical purposes, OperationName might be more + /// appealing to end users. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] + public LocalizableString EventName { get; set; } + + /// + /// Gets or sets the event category. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + public LocalizableString Category { get; set; } + + /// + /// Gets or sets the HTTP request info. Usually includes the + /// 'clientRequestId', 'clientIpAddress' (IP address of the user who + /// initiated the event) and 'method' (HTTP method e.g. PUT). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "httpRequest")] + public HttpRequestInfo HttpRequest { get; set; } + + /// + /// Gets or sets the event level. Possible values include: 'Critical', + /// 'Error', 'Warning', 'Informational', 'Verbose' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "level")] + public EventLevel Level { get; set; } + + /// + /// Gets or sets the resource group name of the impacted resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroupName")] + public string ResourceGroupName { get; set; } + + /// + /// Gets or sets the resource provider name of the impacted resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceProviderName")] + public LocalizableString ResourceProviderName { get; set; } + + /// + /// Gets or sets the resource uri that uniquely identifies the resource + /// that caused this event. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets the resource type + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + public LocalizableString ResourceType { get; set; } + + /// + /// Gets or sets it is usually a GUID shared among the events + /// corresponding to single operation. This value should not be + /// confused with EventName. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } + + /// + /// Gets or sets the operation name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operationName")] + public LocalizableString OperationName { get; set; } + + /// + /// Gets or sets the set of &lt;Key, Value&gt; pairs (usually a + /// Dictionary&lt;String, String&gt;) that includes details + /// about the event. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public System.Collections.Generic.IDictionary Properties { get; set; } + + /// + /// Gets or sets a string describing the status of the operation. Some + /// typical values are: Started, In progress, Succeeded, Failed, + /// Resolved. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public LocalizableString Status { get; set; } + + /// + /// Gets or sets the event sub status. Most of the time, when included, + /// this captures the HTTP status code of the REST call. Common values + /// are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), + /// Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: + /// 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status + /// Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error + /// (HTTP Status Code: 500), Service Unavailable (HTTP Status + /// Code:503), Gateway Timeout (HTTP Status Code: 504) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subStatus")] + public LocalizableString SubStatus { get; set; } + + /// + /// Gets or sets the timestamp of when the event was generated by the + /// Azure service processing the request corresponding the event. It in + /// ISO 8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eventTimestamp")] + public System.DateTime EventTimestamp { get; set; } + + /// + /// Gets or sets the timestamp of when the event became available for + /// querying via this API. It is in ISO 8601 format. This value should + /// not be confused eventTimestamp. As there might be a delay between + /// the occurence time of the event, and the time that the event is + /// submitted to the Azure logging infrastructure. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "submissionTimestamp")] + public System.DateTime SubmissionTimestamp { get; set; } + + /// + /// Gets or sets the Azure subscription Id usually a GUID. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + public string SubscriptionId { get; set; } + + /// + /// Gets or sets the Azure tenant Id + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.EventName != null) + { + this.EventName.Validate(); + } + if (this.Category != null) + { + this.Category.Validate(); + } + if (this.ResourceProviderName != null) + { + this.ResourceProviderName.Validate(); + } + if (this.ResourceType != null) + { + this.ResourceType.Validate(); + } + if (this.OperationName != null) + { + this.OperationName.Validate(); + } + if (this.Status != null) + { + this.Status.Validate(); + } + if (this.SubStatus != null) + { + this.SubStatus.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs new file mode 100644 index 000000000000..21acfeb0e81e --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs @@ -0,0 +1,29 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + + /// + /// Defines values for EventLevel. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum EventLevel + { + [System.Runtime.Serialization.EnumMember(Value = "Critical")] + Critical, + [System.Runtime.Serialization.EnumMember(Value = "Error")] + Error, + [System.Runtime.Serialization.EnumMember(Value = "Warning")] + Warning, + [System.Runtime.Serialization.EnumMember(Value = "Informational")] + Informational, + [System.Runtime.Serialization.EnumMember(Value = "Verbose")] + Verbose + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs new file mode 100644 index 000000000000..d6185239272c --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs @@ -0,0 +1,63 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// The Http request info. + /// + public partial class HttpRequestInfo + { + /// + /// Initializes a new instance of the HttpRequestInfo class. + /// + public HttpRequestInfo() { } + + /// + /// Initializes a new instance of the HttpRequestInfo class. + /// + /// the client request id. + /// the client Ip Address + /// the Http request method. + /// the Uri. + public HttpRequestInfo(string clientRequestId = default(string), string clientIpAddress = default(string), string method = default(string), string uri = default(string)) + { + ClientRequestId = clientRequestId; + ClientIpAddress = clientIpAddress; + Method = method; + Uri = uri; + } + + /// + /// Gets or sets the client request id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clientRequestId")] + public string ClientRequestId { get; set; } + + /// + /// Gets or sets the client Ip Address + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "clientIpAddress")] + public string ClientIpAddress { get; set; } + + /// + /// Gets or sets the Http request method. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "method")] + public string Method { get; set; } + + /// + /// Gets or sets the Uri. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + public string Uri { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs new file mode 100644 index 000000000000..be4a11ab35fb --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs @@ -0,0 +1,60 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// The localizable string class. + /// + public partial class LocalizableString + { + /// + /// Initializes a new instance of the LocalizableString class. + /// + public LocalizableString() { } + + /// + /// Initializes a new instance of the LocalizableString class. + /// + /// the invariant value. + /// the locale specific value. + public LocalizableString(string value, string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + } + + /// + /// Gets or sets the invariant value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets the locale specific value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs new file mode 100644 index 000000000000..e5743f872266 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs @@ -0,0 +1,93 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// A set of metric values in a time range. + /// + public partial class Metric + { + /// + /// Initializes a new instance of the Metric class. + /// + public Metric() { } + + /// + /// Initializes a new instance of the Metric class. + /// + /// the name and the display name of the metric, + /// i.e. it is localizable string. + /// the unit of the metric. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + /// 'Percent', 'MilliSeconds' + /// Array of data points representing the metric + /// values. + public Metric(LocalizableString name, Unit unit, System.Collections.Generic.IList data) + { + Name = name; + Unit = unit; + Data = data; + } + + /// + /// Gets or sets the name and the display name of the metric, i.e. it + /// is localizable string. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public LocalizableString Name { get; set; } + + /// + /// Gets or sets the unit of the metric. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + /// 'Percent', 'MilliSeconds' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public Unit Unit { get; set; } + + /// + /// Gets or sets array of data points representing the metric values. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public System.Collections.Generic.IList Data { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + } + if (Data == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Data"); + } + if (this.Name != null) + { + this.Name.Validate(); + } + if (this.Data != null) + { + foreach (var element in this.Data) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs new file mode 100644 index 000000000000..c9c92e57c537 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs @@ -0,0 +1,54 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// Metric availability specifies the time grain (aggregation interval or + /// frequency) and the retention period for that time grain. + /// + public partial class MetricAvailability + { + /// + /// Initializes a new instance of the MetricAvailability class. + /// + public MetricAvailability() { } + + /// + /// Initializes a new instance of the MetricAvailability class. + /// + /// the time grain specifies the aggregation + /// interval for the metric. Expressed as a duration 'PT1M', 'P1D', + /// etc. + /// the retention period for the metric at the + /// specified timegrain. Expressed as a duration 'PT1M', 'P1D', + /// etc. + public MetricAvailability(System.TimeSpan? timeGrain = default(System.TimeSpan?), System.TimeSpan? retention = default(System.TimeSpan?)) + { + TimeGrain = timeGrain; + Retention = retention; + } + + /// + /// Gets or sets the time grain specifies the aggregation interval for + /// the metric. Expressed as a duration 'PT1M', 'P1D', etc. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] + public System.TimeSpan? TimeGrain { get; set; } + + /// + /// Gets or sets the retention period for the metric at the specified + /// timegrain. Expressed as a duration 'PT1M', 'P1D', etc. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retention")] + public System.TimeSpan? Retention { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs new file mode 100644 index 000000000000..6b8124ffa93f --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs @@ -0,0 +1,108 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// Metric definition class specifies the metadata for a metric. + /// + public partial class MetricDefinition + { + /// + /// Initializes a new instance of the MetricDefinition class. + /// + public MetricDefinition() { } + + /// + /// Initializes a new instance of the MetricDefinition class. + /// + /// the resource identifier of the resource + /// that emitted the metric. + /// the name and the display name of the metric, + /// i.e. it is a localizable string. + /// the unit of the metric. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + /// 'Percent', 'MilliSeconds' + /// the primary aggregation type + /// value defining how to use the values for display. Possible values + /// include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', + /// 'Total' + /// the collection of what + /// aggregation intervals are available to be queried. + /// the resource identifier of the metric + /// definition. + public MetricDefinition(string resourceId = default(string), LocalizableString name = default(LocalizableString), Unit? unit = default(Unit?), AggregationType? primaryAggregationType = default(AggregationType?), System.Collections.Generic.IList metricAvailabilities = default(System.Collections.Generic.IList), string id = default(string)) + { + ResourceId = resourceId; + Name = name; + Unit = unit; + PrimaryAggregationType = primaryAggregationType; + MetricAvailabilities = metricAvailabilities; + Id = id; + } + + /// + /// Gets or sets the resource identifier of the resource that emitted + /// the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets the name and the display name of the metric, i.e. it + /// is a localizable string. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public LocalizableString Name { get; set; } + + /// + /// Gets or sets the unit of the metric. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', + /// 'Percent', 'MilliSeconds' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public Unit? Unit { get; set; } + + /// + /// Gets or sets the primary aggregation type value defining how to use + /// the values for display. Possible values include: 'None', 'Average', + /// 'Count', 'Minimum', 'Maximum', 'Total' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "primaryAggregationType")] + public AggregationType? PrimaryAggregationType { get; set; } + + /// + /// Gets or sets the collection of what aggregation intervals are + /// available to be queried. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "metricAvailabilities")] + public System.Collections.Generic.IList MetricAvailabilities { get; set; } + + /// + /// Gets or sets the resource identifier of the metric definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Name != null) + { + this.Name.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs new file mode 100644 index 000000000000..6d471dcea245 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs @@ -0,0 +1,95 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// Represents a metric value. + /// + public partial class MetricValue + { + /// + /// Initializes a new instance of the MetricValue class. + /// + public MetricValue() { } + + /// + /// Initializes a new instance of the MetricValue class. + /// + /// the timestamp for the metric value in ISO + /// 8601 format. + /// the average value in the time range. + /// the least value in the time range. + /// the greatest value in the time range. + /// the sum of all of the values in the time + /// range. + /// the number of samples in the time range. Can be + /// used to determine the number of values that contributed to the + /// average value. + public MetricValue(System.DateTime timeStamp, double? average = default(double?), double? minimum = default(double?), double? maximum = default(double?), double? total = default(double?), long? count = default(long?)) + { + TimeStamp = timeStamp; + Average = average; + Minimum = minimum; + Maximum = maximum; + Total = total; + Count = count; + } + + /// + /// Gets or sets the timestamp for the metric value in ISO 8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeStamp")] + public System.DateTime TimeStamp { get; set; } + + /// + /// Gets or sets the average value in the time range. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "average")] + public double? Average { get; set; } + + /// + /// Gets or sets the least value in the time range. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "minimum")] + public double? Minimum { get; set; } + + /// + /// Gets or sets the greatest value in the time range. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maximum")] + public double? Maximum { get; set; } + + /// + /// Gets or sets the sum of all of the values in the time range. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "total")] + public double? Total { get; set; } + + /// + /// Gets or sets the number of samples in the time range. Can be used + /// to determine the number of values that contributed to the average + /// value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public long? Count { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs new file mode 100644 index 000000000000..65cf5d45d3d9 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs @@ -0,0 +1,46 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs new file mode 100644 index 000000000000..ebbf9474324c --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs @@ -0,0 +1,46 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [Newtonsoft.Json.JsonObject] + public class Page1 : Microsoft.Rest.Azure.IPage + { + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs new file mode 100644 index 000000000000..fc16477d54c8 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs @@ -0,0 +1,58 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// The RBAC properties of the event. + /// + public partial class SenderAuthorization + { + /// + /// Initializes a new instance of the SenderAuthorization class. + /// + public SenderAuthorization() { } + + /// + /// Initializes a new instance of the SenderAuthorization class. + /// + /// the permissible actions. For instance: + /// microsoft.support/supporttickets/write + /// the role of the user. For instance: Subscription + /// Admin + /// the scope. + public SenderAuthorization(string action = default(string), string role = default(string), string scope = default(string)) + { + Action = action; + Role = role; + Scope = scope; + } + + /// + /// Gets or sets the permissible actions. For instance: + /// microsoft.support/supporttickets/write + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + public string Action { get; set; } + + /// + /// Gets or sets the role of the user. For instance: Subscription Admin + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "role")] + public string Role { get; set; } + + /// + /// Gets or sets the scope. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public string Scope { get; set; } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs new file mode 100644 index 000000000000..285ace3114c1 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs @@ -0,0 +1,33 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + + /// + /// Defines values for Unit. + /// + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum Unit + { + [System.Runtime.Serialization.EnumMember(Value = "Count")] + Count, + [System.Runtime.Serialization.EnumMember(Value = "Bytes")] + Bytes, + [System.Runtime.Serialization.EnumMember(Value = "Seconds")] + Seconds, + [System.Runtime.Serialization.EnumMember(Value = "CountPerSecond")] + CountPerSecond, + [System.Runtime.Serialization.EnumMember(Value = "BytesPerSecond")] + BytesPerSecond, + [System.Runtime.Serialization.EnumMember(Value = "Percent")] + Percent, + [System.Runtime.Serialization.EnumMember(Value = "MilliSeconds")] + MilliSeconds + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs new file mode 100644 index 000000000000..458268d5324f --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor.Models +{ + using System.Linq; + + /// + /// Usage Metric data. + /// + public partial class UsageMetric + { + /// + /// Initializes a new instance of the UsageMetric class. + /// + public UsageMetric() { } + + /// + /// Initializes a new instance of the UsageMetric class. + /// + /// the usage metric name and display name. + /// the current value for the usage + /// metric. + /// the id for the usage metric. + /// the quota limit the usage metric. + /// the unit for the usage metric. + /// the next reset time for the current + /// value. + /// the amount of time it takes to reset the + /// value. + public UsageMetric(LocalizableString name = default(LocalizableString), double? currentValue = default(double?), string id = default(string), double? limit = default(double?), string unit = default(string), System.DateTime? nextResetTime = default(System.DateTime?), System.TimeSpan? quotaPeriod = default(System.TimeSpan?)) + { + Name = name; + CurrentValue = currentValue; + Id = id; + Limit = limit; + Unit = unit; + NextResetTime = nextResetTime; + QuotaPeriod = quotaPeriod; + } + + /// + /// Gets or sets the usage metric name and display name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public LocalizableString Name { get; set; } + + /// + /// Gets or sets the current value for the usage metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + public double? CurrentValue { get; set; } + + /// + /// Gets or sets the id for the usage metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the quota limit the usage metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + public double? Limit { get; set; } + + /// + /// Gets or sets the unit for the usage metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets the next reset time for the current value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "nextResetTime")] + public System.DateTime? NextResetTime { get; set; } + + /// + /// Gets or sets the amount of time it takes to reset the value. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "quotaPeriod")] + public System.TimeSpan? QuotaPeriod { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Name != null) + { + this.Name.Validate(); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs new file mode 100644 index 000000000000..c9dee3ec8bf6 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs @@ -0,0 +1,333 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Composite Swagger for Monitor Client + /// + public partial class MonitorClient : Microsoft.Rest.ServiceClient, IMonitorClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + + /// + /// The Azure subscription Id. + /// + public string SubscriptionId { get; set; } + + /// + /// Gets or sets the preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running Operations. + /// Default value is 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IUsageMetricsOperations. + /// + public virtual IUsageMetricsOperations UsageMetrics { get; private set; } + + /// + /// Gets the IEventCategoriesOperations. + /// + public virtual IEventCategoriesOperations EventCategories { get; private set; } + + /// + /// Gets the IActivityLogsOperations. + /// + public virtual IActivityLogsOperations ActivityLogs { get; private set; } + + /// + /// Gets the ITenantActivityLogsOperations. + /// + public virtual ITenantActivityLogsOperations TenantActivityLogs { get; private set; } + + /// + /// Gets the IMetricDefinitionsOperations. + /// + public virtual IMetricDefinitionsOperations MetricDefinitions { get; private set; } + + /// + /// Gets the IMetricsOperations. + /// + public virtual IMetricsOperations Metrics { get; private set; } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MonitorClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + { + this.Initialize(); + } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected MonitorClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + this.Initialize(); + } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected MonitorClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected MonitorClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + this.BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the MonitorClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) + { + this.Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + this.UsageMetrics = new UsageMetricsOperations(this); + this.EventCategories = new EventCategoriesOperations(this); + this.ActivityLogs = new ActivityLogsOperations(this); + this.TenantActivityLogs = new TenantActivityLogsOperations(this); + this.MetricDefinitions = new MetricDefinitionsOperations(this); + this.Metrics = new MetricsOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List + { + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); + } + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs new file mode 100644 index 000000000000..24b14b8ee513 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs @@ -0,0 +1,443 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// TenantActivityLogsOperations operations. + /// + internal partial class TenantActivityLogsOperations : Microsoft.Rest.IServiceOperations, ITenantActivityLogsOperations + { + /// + /// Initializes a new instance of the TenantActivityLogsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TenantActivityLogsOperations(MonitorClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorClient + /// + public MonitorClient Client { get; private set; } + + /// + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: + /// authorization, channels, claims, correlationId, description, eventDataId, + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + string apiVersion = "2015-04-01"; + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("select", select); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventtypes/management/values").ToString(); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (select != null) + { + _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs new file mode 100644 index 000000000000..5e30a64da51d --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs @@ -0,0 +1,189 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for TenantActivityLogsOperations. + /// + public static partial class TenantActivityLogsOperationsExtensions + { + /// + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: + /// authorization, channels, claims, correlationId, description, eventDataId, + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId + /// + public static Microsoft.Rest.Azure.IPage List(this ITenantActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string)) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ITenantActivityLogsOperations)s).ListAsync(odataQuery, select), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// Used to fetch events with only the given properties. The filter is a comma + /// separated list of property names to be returned. Possible values are: + /// authorization, channels, claims, correlationId, description, eventDataId, + /// eventName, eventTimestamp, httpRequest, level, operationId, operationName, + /// properties, resourceGroupName, resourceProviderName, resourceId, status, + /// submissionTimestamp, subStatus, subscriptionId + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ITenantActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, select, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ITenantActivityLogsOperations operations, string nextPageLink) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((ITenantActivityLogsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// get the Activity Logs for the Tenant. Everything that is applicable to the + /// API to get the Activity Log for the subscription is applicable to this API + /// (the parameters, $filter, etc.). One thing to point out here is that this + /// API does *not* retrieve the logs at the individual subscription of the + /// tenant but only surfaces the logs that were generated at the tenant level. + /// The **$filter** is very restricted and allows only the following patterns. + /// - List events for a resource group: $filter=eventTimestamp ge '<Start + /// Time>' and eventTimestamp le '<End Time>' and eventChannels eq + /// 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'. - + /// List events for resource: $filter=eventTimestamp ge '<Start Time>' + /// and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation' and resourceUri eq '<ResourceURI>'. - List events for a + /// subscription: $filter=eventTimestamp ge '<Start Time>' and + /// eventTimestamp le '<End Time>' and eventChannels eq 'Admin, + /// Operation'. - List evetns for a resource provider: $filter=eventTimestamp + /// ge '<Start Time>' and eventTimestamp le '<End Time>' and + /// eventChannels eq 'Admin, Operation' and resourceProvider eq + /// '<ResourceProviderName>'. - List events for a correlation Id: + /// api-version=2014-04-01&$filter=eventTimestamp ge + /// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + /// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and + /// correlationId eq '<CorrelationID>'. No other syntax is allowed. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ITenantActivityLogsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs new file mode 100644 index 000000000000..b5200831caae --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs @@ -0,0 +1,243 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// UsageMetricsOperations operations. + /// + internal partial class UsageMetricsOperations : Microsoft.Rest.IServiceOperations, IUsageMetricsOperations + { + /// + /// Initializes a new instance of the UsageMetricsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsageMetricsOperations(MonitorClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MonitorClient + /// + public MonitorClient Client { get; private set; } + + /// + /// The List operation lists the usage metrics for the resource. + /// + /// + /// The identifier of the resource. + /// + /// + /// The client Api Version. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// 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 + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (resourceUri == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + } + if (apiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "apiVersion"); + } + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("odataQuery", odataQuery); + tracingParameters.Add("resourceUri", resourceUri); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/usages").ToString(); + _url = _url.Replace("{resourceUri}", resourceUri); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (odataQuery != null) + { + var _odataFilter = odataQuery.ToString(); + if (!string.IsNullOrEmpty(_odataFilter)) + { + _queryParameters.Add(_odataFilter); + } + } + 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 + System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs new file mode 100644 index 000000000000..471dc2b105bf --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs @@ -0,0 +1,67 @@ +// 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 1.0.0.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Monitor +{ + using System.Threading.Tasks; + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for UsageMetricsOperations. + /// + public static partial class UsageMetricsOperationsExtensions + { + /// + /// The List operation lists the usage metrics for the resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The client Api Version. + /// + /// + /// OData parameters to apply to the operation. + /// + public static System.Collections.Generic.IEnumerable List(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + { + return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageMetricsOperations)s).ListAsync(resourceUri, apiVersion, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + } + + /// + /// The List operation lists the usage metrics for the resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The identifier of the resource. + /// + /// + /// The client Api Version. + /// + /// + /// OData parameters to apply to the operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, apiVersion, odataQuery, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj new file mode 100644 index 000000000000..50fd34a8c69b --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj @@ -0,0 +1,18 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 8989ed12-b754-4ebd-bc97-efa7b11ffd49 + Monitor + .\obj + .\bin\ + + + 2.0 + + + \ No newline at end of file diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Properties/AssemblyInfo.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..3783bbc450a2 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Monitor Library")] +[assembly: AssemblyDescription("Provides Microsoft Azure Monitor operations.")] + +[assembly: AssemblyVersion("0.15.0.0")] +[assembly: AssemblyFileVersion("0.15.0.0")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd new file mode 100644 index 000000000000..b5020da84e66 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd @@ -0,0 +1,30 @@ +:: +:: Microsoft Azure SDK for Net - Generate library code +:: Copyright (C) Microsoft Corporation. All Rights Reserved. +:: + + +@echo off +set autoRestVersion=1.0.0-Nightly20161116 +if "%1" == "" ( + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1f823636981e779b6d4155aa18d042146e1270fb/monitor/compositeMonitorClient.json" +) else ( + set specFile="%1" +) +set repoRoot=%~dp0..\..\..\.. +set generateFolder=%~dp0Generated\Monitor + +if exist %generateFolder% rd /S /Q %generateFolder% +call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Monitor %autoRestVersion% %generateFolder% "-FT 1" + +if "%2" == "" ( + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1f823636981e779b6d4155aa18d042146e1270fb/arm-monitor/compositeMonitorManagementClient.json" +) else ( + set specFile="%2" +) + +set generateFolder=%~dp0Generated\Management\Monitor + +if exist %generateFolder% rd /S /Q %generateFolder% +call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Management.Monitor %autoRestVersion% %generateFolder% "-FT 1" + \ No newline at end of file diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/project.json b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/project.json new file mode 100644 index 000000000000..7bcd8cd35745 --- /dev/null +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/project.json @@ -0,0 +1,50 @@ +{ + "version": "0.15.0-preview", + "description": "Microsoft Azure Monitor Library", + "authors": [ "Microsoft" ], + + "packOptions": { + "summary": "Provides Microsoft Azure Monitor operations using Resource Manager", + "iconUrl": "http://go.microsoft.com/fwlink/?LinkID=288890", + "projectUrl": "https://github.com/Azure/azure-sdk-for-net", + "licenseUrl": "https://raw.githubusercontent.com/Microsoft/dotnet/master/LICENSE", + "tags": [ "Microsoft", "Microsoft Azure", "Azure", "Monitor", "monitoring", "monitoring services", "metrics", "alerts", "autoscale", "activityLogs", "events", "operations", "logs", "REST", "HTTP", "client", "azureofficial", "windowsazureofficial", "management services", "diagnostics", "telemetry", "analytics" ], + "requireLicenseAcceptance": false + }, + + "buildOptions": { + "delaySign": true, + "publicSign": false, + "keyFile": "../../../../tools/MSSharedLibKey.snk" + }, + "dependencies": { + "Microsoft.Rest.ClientRuntime.Azure": "[3.3.3,4.0.0)", + "Microsoft.Rest.ClientRuntime": "[2.3.3,3.0.0)" + }, + + "frameworks": { + "net45": { + "dependencies": { + "Microsoft.Net.Http": "[2.2.28,3.0.0)", + "Newtonsoft.Json": "[6.0.8,7.0.0)" + } + }, + "netstandard1.5": { + "imports": ["dnxcore50"], + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1", + "System.Diagnostics.Tools": "4.0.1", + "System.Net.Http": "4.1.0", + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Threading.Tasks": "4.0.11" + } + }, + "netstandard1.1": { + "imports": ["dnxcore50"], + "dependencies": { + "System.Runtime.Serialization.Primitives": "4.1.1", + "System.Net.Http": "4.1.0" + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs new file mode 100644 index 000000000000..5d48b069439e --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Management.Monitor; +using Microsoft.Azure.Management.Monitor.Models; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + public class AlertsTests : TestBase + { + [Fact] + public void GetIncidentTest() + { + var expectedIncident = GetIncidents().First(); + + var serializedObject = expectedIncident.ToJson(); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + var handler = new RecordedDelegatingHandler(expectedResponse); + var insightsClient = GetMonitorManagementClient(handler); + + var actualIncident = insightsClient.AlertRuleIncidents.Get( + resourceGroupName: "rg1", + ruleName: "r1", + incidentName: "i1"); + + AreEqual(expectedIncident, actualIncident); + } + + private static List GetIncidents() + { + return new List + { + new Incident( + activatedTime: DateTime.UtcNow, + isActive: false, + name: "i1", + resolvedTime: DateTime.UtcNow, + ruleName: "r1" + ) + }; + } + + private static void AreEqual(Incident exp, Incident act) + { + if (exp != null) + { + Assert.True(exp.ActivatedTime.HasValue); + Assert.True(act.ActivatedTime.HasValue); + Assert.Equal(exp.ActivatedTime.Value.ToUniversalTime(), act.ActivatedTime.Value.ToUniversalTime()); + Assert.Equal(exp.IsActive, act.IsActive); + Assert.Equal(exp.Name, act.Name); + + Assert.True(exp.ResolvedTime.HasValue); + Assert.True(act.ResolvedTime.HasValue); + Assert.Equal(exp.ResolvedTime.Value.ToUniversalTime(), act.ResolvedTime.Value.ToUniversalTime()); + Assert.Equal(exp.RuleName, act.RuleName); + } + } + + [Fact] + public void ListIncidentsTest() + { + var expectedIncidentsResponse = new List + { + new Incident( + activatedTime: DateTime.Parse("2014-08-01T00:00:00Z"), + isActive: false, + name: "i1", + resolvedTime: DateTime.Parse("2014-08-01T00:00:00Z"), + ruleName: "r1" + ) + }; + + HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", expectedIncidentsResponse.ToJson(), "}")) + }; + + var handler = new RecordedDelegatingHandler(response); + var insightsClient = GetMonitorManagementClient(handler); + + var actualIncidents = insightsClient.AlertRuleIncidents.ListByAlertRule( + resourceGroupName: "rg1", + ruleName: "r1"); + + AreEqual(expectedIncidentsResponse, actualIncidents.ToList()); + } + + private void AreEqual(IList exp, IList act) + { + if (exp != null) + { + for (int i = 0; i < exp.Count; i++) + { + AreEqual(exp[i], act[i]); + } + } + } + + private static void AreEqual(List exp, IList act) + { + if (exp != null) + { + for (int i = 0; i < exp.Count; i++) + { + AreEqual(exp[i], act[i]); + } + } + } + + [Fact] + public void CreateOrUpdateRuleTest() + { + AlertRuleResource expectedParameters = GetCreateOrUpdateRuleParameter(); + + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expectedParameters, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + var result = insightsClient.AlertRules.CreateOrUpdate(resourceGroupName: "rg1", ruleName: expectedParameters.Name, parameters: expectedParameters); + + AreEqual(expectedParameters, result); + } + + [Fact] + public void ListRulesTest() + { + var expResponse = GetRuleResourceCollection(); + + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", serializedObject, "}")) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + var actualResponse = insightsClient.AlertRules.ListByResourceGroup(resourceGroupName: " rg1", odataQuery: "resourceUri eq 'resUri'"); + + AreEqual(expResponse, actualResponse.ToList()); + } + + private void AreEqual(AlertRuleResource exp, AlertRuleResource act) + { + if (exp != null) + { + Assert.Equal(exp.Location, act.Location); + AreEqual(exp.Tags, act.Tags); + Assert.Equal(exp.Name, act.Name); + Assert.Equal(exp.Description, act.Description); + Assert.Equal(exp.IsEnabled,act.IsEnabled); + AreEqual(exp.Condition, act.Condition); + AreEqual(exp.Actions, act.Actions); + //Assert.Equal(exp.LastUpdatedTime, act.LastUpdatedTime); + } + } + + private void AreEqual(RuleCondition exp, RuleCondition act) + { + if (exp is LocationThresholdRuleCondition) + { + var expRuleCondition = exp as LocationThresholdRuleCondition; + var actRuleCondition = act as LocationThresholdRuleCondition; + + AreEqual(expRuleCondition.DataSource, actRuleCondition.DataSource); + Assert.Equal(expRuleCondition.FailedLocationCount, actRuleCondition.FailedLocationCount); + Assert.Equal(expRuleCondition.WindowSize, actRuleCondition.WindowSize); + } + } + + private void AreEqual(RuleDataSource exp, RuleDataSource act) + { + if (exp is RuleMetricDataSource) + { + var expMetricDataSource = exp as RuleMetricDataSource; + var actMetricDataSource = act as RuleMetricDataSource; + + Assert.Equal(expMetricDataSource.MetricName, actMetricDataSource.MetricName); + Assert.Equal(expMetricDataSource.ResourceUri, actMetricDataSource.ResourceUri); + } + } + + private void AreEqual(IList exp, IList act) + { + Assert.NotNull(exp); + Assert.NotNull(act); + + Assert.Equal(exp.Count, act.Count); + + for (int i = 0; i < exp.Count; i++) + { + AreEqual(exp[i], act[i]); + } + } + + private void AreEqual(RuleAction exp, RuleAction act) + { + if (exp is RuleEmailAction) + { + var expEmailRuleAction = exp as RuleEmailAction; + var actEmailRuleAction = act as RuleEmailAction; + + AreEqual(expEmailRuleAction.CustomEmails, actEmailRuleAction.CustomEmails); + Assert.Equal(expEmailRuleAction.SendToServiceOwners, actEmailRuleAction.SendToServiceOwners); + } + } + + private AlertRuleResource GetCreateOrUpdateRuleParameter() + { + List actions = new List(); + actions.Add(new RuleEmailAction() + { + CustomEmails = new List() + { + "emailid1" + }, + SendToServiceOwners = true + }); + + return new AlertRuleResource( + location: "location", + alertRuleResourceName: "name1", + actions: actions, + condition: new LocationThresholdRuleCondition() + { + DataSource = new RuleMetricDataSource() + { + MetricName = "CPUPercentage", + ResourceUri = "resourceUri" + }, + FailedLocationCount = 1, + WindowSize = TimeSpan.FromMinutes(30) + }, + description: "description", + isEnabled: true, + lastUpdatedTime: DateTime.UtcNow, + name: "name1", + tags: new Dictionary() + { + {"key1", "val1"} + } + ); + } + + private List GetRuleResourceCollection() + { + List actions = new List(); + actions.Add(new RuleEmailAction() + { + CustomEmails = new List() + { + "eamil1" + }, + SendToServiceOwners = true + }); + + return new List + { + new AlertRuleResource( + id: "id1", + location: "location1", + name: "name1", + alertRuleResourceName: "name1", + actions: actions, + condition: new LocationThresholdRuleCondition() + { + DataSource = new RuleMetricDataSource() + { + MetricName = "CpuPercentage", + ResourceUri = "resUri1" + }, + FailedLocationCount = 1, + WindowSize = TimeSpan.FromMinutes(30) + }, + description: "description1", + isEnabled: true, + lastUpdatedTime: DateTime.UtcNow, + tags: new Dictionary() + { + {"key1", "val1"} + } + ) + }; + } + + private void AreEqual(IList exp, IList act) + { + if (exp != null) + { + Assert.True(exp.Count == act.Count); + + for (int i = 0; i < exp.Count; i++) + { + AreEqual(exp[i], act[i]); + } + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs new file mode 100644 index 000000000000..2e2cd074dda5 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Management.Monitor; +using Microsoft.Azure.Management.Monitor.Models; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + public class AutoscaleTests : TestBase + { + private const string ResourceUri = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.web/serverFarms/DefaultServerFarm"; + + [Fact] + public void CreateOrUpdateSettingTest() + { + AutoscaleSettingResource expResponse = CreateAutoscaleSetting(location: "East US", resourceUri: ResourceUri, metricName: "CpuPercentage"); + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + var actualResponse = insightsClient.AutoscaleSettings.CreateOrUpdate(resourceGroupName: "resourceGroup1", autoscaleSettingName: "setting1", parameters: expResponse); + AreEqual(expResponse, actualResponse); + } + + [Fact] + public void Autoscale_GetSetting() + { + var expResponse = CreateAutoscaleSetting(ResourceUri, "CpuPercentage", string.Empty); + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + AutoscaleSettingResource actualResponse = insightsClient.AutoscaleSettings.Get(resourceGroupName: "resourceGroup1", autoscaleSettingName: "setting1"); + AreEqual(expResponse, actualResponse); + } + + private static AutoscaleSettingResource CreateAutoscaleSetting(string location, string resourceUri, string metricName) + { + var capacity = new ScaleCapacity() + { + DefaultProperty = "1", + Maximum = "100", + Minimum = "1" + }; + + var fixedDate = new TimeWindow() + { + End = DateTime.Parse("2014-04-16T21:06:11.7882792Z"), + Start = DateTime.Parse("2014-04-15T21:06:11.7882792Z"), + TimeZone = TimeZoneInfo.Utc.Id.ToString() + }; + + var recurrence = new Recurrence() + { + Frequency = RecurrenceFrequency.Week, + Schedule = new RecurrentSchedule() + { + Days = new List { "Monday" }, + Hours = new List { 0 }, + Minutes = new List { 10 }, + TimeZone = "UTC-11" + } + }; + + var rules = new ScaleRule[] + { + new ScaleRule() + { + MetricTrigger = new MetricTrigger + { + MetricName = metricName, + MetricResourceUri = resourceUri, + Statistic = MetricStatisticType.Average, + Threshold = 80.0, + TimeAggregation = TimeAggregationType.Maximum, + TimeGrain = TimeSpan.FromMinutes(1), + TimeWindow = TimeSpan.FromHours(1) + }, + ScaleAction = new ScaleAction + { + Cooldown = TimeSpan.FromMinutes(20), + Direction = ScaleDirection.Increase, + Value = "10" + } + } + }; + + AutoscaleSettingResource setting = new AutoscaleSettingResource + { + Name = "setting1", + AutoscaleSettingResourceName = "setting1", + TargetResourceUri = resourceUri, + Enabled = true, + Profiles = new AutoscaleProfile[] + { + new AutoscaleProfile() + { + Name = "Profile1", + Capacity = capacity, + FixedDate = fixedDate, + Recurrence = null, + Rules = rules + }, + new AutoscaleProfile() + { + Name = "Profile2", + Capacity = capacity, + FixedDate = null, + Recurrence = recurrence, + Rules = rules + } + }, + Location = "", + Tags = null, + Notifications = null + }; + + return setting; + } + + private static void AreEqual(AutoscaleSettingResource exp, AutoscaleSettingResource act) + { + if (exp != null) + { + Assert.Equal(exp.Enabled, act.Enabled); + Assert.Equal(exp.Name, act.Name); + Assert.Equal(exp.TargetResourceUri, act.TargetResourceUri); + + for (int i = 0; i < exp.Profiles.Count; i++) + { + var expectedProfile = exp.Profiles[i]; + var actualProfile = act.Profiles[i]; + AreEqual(expectedProfile, actualProfile); + } + } + } + + private static void AreEqual(AutoscaleProfile exp, AutoscaleProfile act) + { + if (exp != null) + { + Assert.Equal(exp.Name, act.Name); + AreEqual(exp.Capacity, act.Capacity); + AreEqual(exp.FixedDate, act.FixedDate); + AreEqual(exp.Recurrence, act.Recurrence); + for (int i = 0; i < exp.Rules.Count; i++) + { + AreEqual(exp.Rules[i], act.Rules[i]); + } + } + } + + private static void AreEqual(TimeWindow exp, TimeWindow act) + { + if (exp != null) + { + Assert.Equal(exp.End.ToUniversalTime(), act.End.ToUniversalTime()); + Assert.Equal(exp.Start.ToUniversalTime(), act.Start.ToUniversalTime()); + Assert.Equal(exp.TimeZone, act.TimeZone); + } + } + + private static void AreEqual(ScaleCapacity exp, ScaleCapacity act) + { + if (exp != null) + { + Assert.Equal(exp.DefaultProperty, act.DefaultProperty); + Assert.Equal(exp.Maximum, act.Maximum); + Assert.Equal(exp.Minimum, act.Minimum); + } + } + + private static void AreEqual(Recurrence exp, Recurrence act) + { + if (exp != null) + { + Assert.Equal(exp.Frequency, act.Frequency); + AreEqual(exp.Schedule, act.Schedule); + } + } + + private static void AreEqual(RecurrentSchedule exp, RecurrentSchedule act) + { + if (exp != null) + { + AreEqual(exp.Days, act.Days); + AreEqual(exp.Hours, act.Hours); + AreEqual(exp.Minutes, act.Minutes); + Assert.Equal(exp.TimeZone, act.TimeZone); + } + } + + private static bool AreEqual(IList exp, IList act) + { + if (exp != null) + { + if (act == null || exp.Count != act.Count) + { + return false; + } + + for (int i = 0; i < exp.Count; i++) + { + if (exp[i] != act[i]) + { + return false; + } + } + + return true; + } + + return act == null; + } + + private static void AreEqual(ScaleRule exp, ScaleRule act) + { + if (exp != null) + { + AreEqual(exp.MetricTrigger, act.MetricTrigger); + AreEqual(exp.ScaleAction, act.ScaleAction); + } + } + + private static void AreEqual(MetricTrigger exp, MetricTrigger act) + { + if (exp != null) + { + Assert.Equal(exp.MetricName, act.MetricName); + Assert.Equal(exp.MetricResourceUri, act.MetricResourceUri); + Assert.Equal(exp.Statistic, act.Statistic); + Assert.Equal(exp.Threshold, act.Threshold); + Assert.Equal(exp.TimeAggregation, act.TimeAggregation); + Assert.Equal(exp.TimeGrain, act.TimeGrain); + Assert.Equal(exp.TimeWindow, act.TimeWindow); + } + } + + private static void AreEqual(ScaleAction exp, ScaleAction act) + { + if (exp != null) + { + Assert.Equal(exp.Cooldown, act.Cooldown); + Assert.Equal(exp.Direction, act.Direction); + Assert.Equal(exp.Value, act.Value); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs new file mode 100644 index 000000000000..a41c438fd05b --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Monitor; +using Microsoft.Azure.Monitor.Models; +using Microsoft.Rest.Azure.OData; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + /// + /// Class to unit test the Insights API methods. + /// The goal of these tests is to find out if the serialization/deserialization is working properly. Testing other features is out of scope. + /// + public class EventDataInMemoryTests : TestBase + { + #region EventCountSummaryContent + +// private static string EventCountSummaryContent = +// @"{ +// 'eventPropertyName': 'ResourceUri', +// 'eventPropertyValue': '/subscriptions/6b483e7e-f352-4d25-b49d-e0cc8b0b78f6/resourcegroups/Default-Web-SouthCentralUS/providers/Microsoft.Web/sites/si', +// 'startTime': '2014-08-20T00:00:00Z', +// 'endTime': '2014-08-21T00:00:00Z', +// 'timeGrain': 'P1D', +// 'id': '/subscriptions/6b483e7e-f352-4d25-b49d-e0cc8b0b78f6/resourcegroups/Default-Web-SouthCentralUS/providers/Microsoft.Web/sites/si/managementSummariesCount', +// 'summaryItems': [{ +// 'eventTime': '2014-08-21T00:00:00Z', +// 'totalEventsCount': 2, +// 'failedEventsCount': 1 +// }, +// { +// 'eventTime': '2014-08-20T00:00:00Z', +// 'totalEventsCount': 0, +// 'failedEventsCount': 0 +// }] +// }"; + + #endregion + + /// + /// Test for the ListEvents API method + /// + [Fact] + public void ListEventsTest() + { + List expectedEventDataCollection = GetEventDataCollection(); + var response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", expectedEventDataCollection.ToJson(), ", \"nextLink\":\"\"}")) + }; + + var handler = new RecordedDelegatingHandler(response) { StatusCodeToReturn = HttpStatusCode.OK }; + + var startTime = DateTimeOffset.Parse("2014-03-11T01:00:00.00Z"); + var endTime = DateTimeOffset.Parse("2014-03-11T02:00:00.00Z"); + + var insightsClient = GetMonitorClient(handler); + + var filterString = new ODataQuery(p => (p.EventTimestamp >= startTime) && (p.EventTimestamp < endTime)); + + var actualEventDataCollection = insightsClient.ActivityLogs.List(filterString); + + Assert.True(string.IsNullOrWhiteSpace(actualEventDataCollection.NextPageLink)); + AreEqual(expectedEventDataCollection, actualEventDataCollection.GetEnumerator()); + } + + /// + /// Test for the ListEventsNext method + /// + [Fact] + public void ListEventsNextTest() + { + List expectedEventDataCollection = GetEventDataCollection(); + var response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", expectedEventDataCollection.ToJson(), ", \"nextLink\":\"\"}")) + }; + + var handler = new RecordedDelegatingHandler(response) { StatusCodeToReturn = HttpStatusCode.OK }; + var insightsClient = GetMonitorClient(handler); + + var actualEventDataCollection = insightsClient.ActivityLogs.ListNext("http://www.microsoft.com"); + + Assert.True(string.IsNullOrWhiteSpace(actualEventDataCollection.NextPageLink)); + AreEqual(expectedEventDataCollection, actualEventDataCollection.GetEnumerator()); + } + + #region private methods + + private static void AreEqual(IEnumerable exp, IEnumerator act) + { + if (exp != null) + { + List expList = exp.ToList(); + List actList = new List(); + while (act.MoveNext()) + { + actList.Add(act.Current); + } + + Assert.Equal(expList.Count, actList.Count); + + for (int i=0;i GetEventDataCollection() + { + return new List() + { + new EventData( + authorization: new SenderAuthorization(action: "action", role: "role" , scope: "scope"), + claims: new Dictionary { {"prop1", "val1"} }, + correlationId: Guid.NewGuid().ToString("N"), + description: "description", + eventDataId: Guid.NewGuid().ToString("N"), + eventName: new LocalizableString( + localizedValue: "Event Name", + value: "EventName"), + category: new LocalizableString( + localizedValue: "Administrative", + value: "Administrative"), + eventTimestamp: DateTime.UtcNow, + httpRequest: new HttpRequestInfo( + clientIpAddress: "1.1.1.1", + clientRequestId: Guid.NewGuid().ToString("N"), + method: "method", + uri: "http://localhost"), + level: EventLevel.Critical, + operationId: Guid.NewGuid().ToString("N"), + operationName: new LocalizableString( + localizedValue: "Operation Name", + value: "OperationName"), + properties: new Dictionary() + { + {"prop1", "val1"} + }, + resourceGroupName: "rg1", + resourceProviderName: new LocalizableString( + localizedValue: "Resource provider name", + value: "ResourceProviderName"), + resourceId: "/subscriptions/sub1", + status: new LocalizableString( + localizedValue: "Is Ready", + value: "IsReady"), + subStatus: new LocalizableString( + localizedValue: "sub 1", + value: "sub1"), + submissionTimestamp: DateTime.UtcNow, + subscriptionId: Guid.NewGuid().ToString("N")) + }; + } + + #endregion + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs new file mode 100644 index 000000000000..4386e7cde241 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Management.Monitor; +using Microsoft.Azure.Management.Monitor.Models; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + public class LogProfilesTests : TestBase + { + private const string ResourceId = "/subscriptions/0e44ac0a-5911-482b-9edd-3e67625d45b5/providers/microsoft.insights/logprofiles/default"; + + private static string DefaultName = "default"; + + [Fact] + public void LogProfiles_CreateOrUpdateTest() + { + LogProfileResource expResponse = CreateLogProfile(); + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + var parameters = CreateLogProfileParams(); + + LogProfileResource actualResponse = insightsClient.LogProfiles.CreateOrUpdate(logProfileName: DefaultName, parameters: parameters); + + AreEqual(expResponse, actualResponse); + } + + [Fact] + public void LogProfiles_DeleteTest() + { + HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Empty) + }; + + var handler = new RecordedDelegatingHandler(response); + MonitorManagementClient customClient = this.GetMonitorManagementClient(handler); + + customClient.LogProfiles.Delete(logProfileName: DefaultName); + } + + [Fact] + public void LogProfiles_GetTest() + { + var expResponse = CreateLogProfile(); + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + LogProfileResource actualResponse = insightsClient.LogProfiles.Get(logProfileName: DefaultName); + AreEqual(expResponse, actualResponse); + } + + [Fact] + public void LogProfiles_ListTest() + { + var logProfile = CreateLogProfile(); + var expResponse = new List + { + logProfile + }; + + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", serializedObject, "}")) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + IList actualResponse = insightsClient.LogProfiles.List().ToList(); + + Assert.Equal(expResponse.Count, actualResponse.Count); + AreEqual(expResponse[0], actualResponse[0]); + } + + private static LogProfileResource CreateLogProfile() + { + return new LogProfileResource + { + StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", + ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/sb1/authorizationrules/ar1", + Categories = new List { "Delete", "Write" }, + Locations = new List { "global", "eastus" }, + RetentionPolicy = new RetentionPolicy + { + Days = 4, + Enabled = true, + } + }; + } + + private static LogProfileResource CreateLogProfileParams() + { + return new LogProfileResource + { + StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", + ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/sb1/authorizationrules/ar1", + Categories = new List { "Delete", "Write" }, + Locations = new List { "global", "eastus" }, + RetentionPolicy = new RetentionPolicy + { + Days = 4, + Enabled = true, + }, + Location = "" + }; + } + + private static void AreEqual(LogProfileResource exp, LogProfileResource act) + { + if (exp != null) + { + CompareListString(exp.Categories, act.Categories); + CompareListString(exp.Locations, act.Locations); + + Assert.Equal(exp.RetentionPolicy.Enabled, act.RetentionPolicy.Enabled); + Assert.Equal(exp.RetentionPolicy.Days, act.RetentionPolicy.Days); + Assert.Equal(exp.ServiceBusRuleId, act.ServiceBusRuleId); + Assert.Equal(exp.StorageAccountId, act.StorageAccountId); + } + } + + private static void CompareListString(IList exp, IList act) + { + if (exp == act) + { + return; + } + + if (exp == null) + { + Assert.Equal(null, act); + } + + Assert.False(act == null, "List can't be null"); + + for (int i = 0; i < exp.Count; i++) + { + if (i >= act.Count) + { + Assert.Equal(exp.Count, act.Count); + } + + string cat1 = exp[i]; + string cat2 = act[i]; + Assert.Equal(cat1, cat2); + } + + Assert.Equal(exp.Count, act.Count); + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs new file mode 100644 index 000000000000..f368d7c57593 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Monitor; +using Microsoft.Azure.Monitor.Models; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + public class MetricsTests : TestBase + { + private const string ResourceUri = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.web/serverFarms/DefaultServerFarm"; + + [Fact] + public void GetMetricDefinitionsTest() + { + IList expectedMetricDefinitionCollection = GetMetricDefinitionCollection(ResourceUri); + var response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", expectedMetricDefinitionCollection.ToJson(), "}")) + }; + + RecordedDelegatingHandler handler = new RecordedDelegatingHandler(response); + var insightsClient = GetMonitorClient(handler); + + var filterString = new Microsoft.Rest.Azure.OData.ODataQuery("names eq 'CpuPercentage'"); + var actualMetricDefinitions = insightsClient.MetricDefinitions.ListAsync(resourceUri: ResourceUri, odataQuery: filterString, cancellationToken: new CancellationToken()).Result; + + AreEqual(expectedMetricDefinitionCollection, actualMetricDefinitions.ToList()); + } + + [Fact] + public void GetMetricsTest() + { + IList expectedMetricCollection = GetMetricCollection(ResourceUri); + var response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", expectedMetricCollection.ToJson(), "}")) + }; + + RecordedDelegatingHandler handler = new RecordedDelegatingHandler(response); + var insightsClient = GetMonitorClient(handler); + + var filterString = new Microsoft.Rest.Azure.OData.ODataQuery("timeGrain eq duration'PT1M' and startTime eq 2014-01-01T06:00:00Z and endTime eq 2014-01-10T06:00:00Z"); + var actualMetrics = insightsClient.Metrics.ListAsync(resourceUri: ResourceUri, odataQuery: filterString, cancellationToken: CancellationToken.None).Result; + + AreEqual(expectedMetricCollection, actualMetrics.ToList()); + } + + private IList GetMetricCollection(string resourceId) + { + return new List + { + new Metric + { + Name = new LocalizableString {LocalizedValue = "CPU Percentage", Value = "CpuPercentage"}, + Unit = Unit.Percent, + Data = new List + { + new MetricValue + { + Average = 10.0, + Count = 1, + Maximum = 10.0, + Minimum = 10.0, + TimeStamp = DateTime.Parse("2014-08-20T12:15:23.00Z"), + Total = 10.0 + } + } + } + }; + } + + private void AreEqual(IList exp, IList act) + { + if (exp != null) + { + for (int i = 0; i < exp.Count; i++) + { + AreEqual(exp[i], act[i]); + } + } + } + + private void AreEqual(Metric exp, Metric act) + { + if (exp != null) + { + AreEqual(exp.Name, act.Name); + Assert.Equal(exp.Unit, act.Unit); + + if (exp.Data != null) + { + for (int i = 0; i < exp.Data.Count; i++) + { + AreEqual(exp.Data[i], act.Data[i]); + } + } + } + } + + private void AreEqual(MetricValue exp, MetricValue act) + { + if (exp != null) + { + Assert.Equal(exp.Average, act.Average); + Assert.Equal(exp.Count, act.Count); + Assert.Equal(exp.Maximum, act.Maximum); + Assert.Equal(exp.Minimum, act.Minimum); + Assert.Equal(exp.TimeStamp.ToUniversalTime(), act.TimeStamp.ToUniversalTime()); + Assert.Equal(exp.Total, act.Total); + } + } + + #region MetricDefinition helpers + + private static void AreEqual(IList exp, IList act) + { + if (exp != null) + { + for (int i = 0; i < exp.Count; i++) + { + AreEqual(exp[i], act[i]); + } + } + } + + private static void AreEqual(MetricDefinition exp, MetricDefinition act) + { + if (exp != null) + { + AreEqual(exp.Name, act.Name); + Assert.Equal(exp.ResourceId, act.ResourceId); + Assert.Equal(exp.Unit, act.Unit); + Assert.Equal(exp.PrimaryAggregationType, act.PrimaryAggregationType); + + if (exp.MetricAvailabilities != null) + { + for (int i = 0; i < exp.MetricAvailabilities.Count; i++) + { + AreEqual(exp.MetricAvailabilities[i], act.MetricAvailabilities[i]); + } + } + } + } + + private static void AreEqual(MetricAvailability exp, MetricAvailability act) + { + if (exp != null) + { + Assert.Equal(exp.Retention, act.Retention); + Assert.Equal(exp.TimeGrain, act.TimeGrain); + } + } + + private IList GetMetricDefinitionCollection(string resourceUri) + { + var metriAvailabilities = new List() + { + new MetricAvailability(timeGrain: TimeSpan.FromMinutes(10), retention: TimeSpan.FromDays(30)) + }; + + MetricDefinition[] metricDefinitions = new MetricDefinition[1]; + metricDefinitions[0] = new MetricDefinition + { + MetricAvailabilities = metriAvailabilities, + Name = new LocalizableString() { LocalizedValue = "CPU Percentage", Value = "CpuPercentage" }, + PrimaryAggregationType = AggregationType.Average, + ResourceId = resourceUri, + Unit = Unit.Bytes + }; + return metricDefinitions; + } + + #endregion + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs new file mode 100644 index 000000000000..b8353b47b9fd --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Management.Monitor; +using Microsoft.Azure.Management.Monitor.Models; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + public class ServiceDiagnosticSettingsTests : TestBase + { + private const string ResourceUri = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.web/serverFarms/DefaultServerFarm"; + + [Fact] + public void LogProfiles_PutTest() + { + var expResponse = CreateDiagnosticSettings(); + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + var parameters = CreateDiagnosticSettingsParams(); + + ServiceDiagnosticSettingsResource response = insightsClient.ServiceDiagnosticSettings.CreateOrUpdate(resourceUri: ResourceUri, parameters: parameters); + AreEqual(expResponse, response); + } + + [Fact] + public void LogProfiles_GetTest() + { + var expResponse = CreateDiagnosticSettings(); + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorManagementClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expResponse, insightsClient.SerializationSettings); + var expectedResponse = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(serializedObject) + }; + + handler = new RecordedDelegatingHandler(expectedResponse); + insightsClient = GetMonitorManagementClient(handler); + + ServiceDiagnosticSettingsResource actualResponse = insightsClient.ServiceDiagnosticSettings.Get(resourceUri: ResourceUri); + AreEqual(expResponse, actualResponse); + } + + private static ServiceDiagnosticSettingsResource CreateDiagnosticSettingsParams() + { + return new ServiceDiagnosticSettingsResource + { + StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", + ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/ns1/authorizationRules/authrule", + WorkspaceId = "wsId", + Logs = new List + { + new LogSettings + { + RetentionPolicy = new RetentionPolicy + { + Days = 90, + Enabled = true + } + } + }, + Metrics = new List + { + new MetricSettings + { + Enabled = true, + RetentionPolicy = new RetentionPolicy + { + Enabled = true, + Days = 90 + }, + TimeGrain = TimeSpan.FromMinutes(1) + } + }, + Location = "" + }; + } + + private static ServiceDiagnosticSettingsResource CreateDiagnosticSettings() + { + return new ServiceDiagnosticSettingsResource + { + StorageAccountId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.storage/storageaccounts/sa1", + ServiceBusRuleId = "/subscriptions/4d7e91d4-e930-4bb5-a93d-163aa358e0dc/resourceGroups/Default-Web-westus/providers/microsoft.servicebus/namespaces/ns1/authorizationRules/authrule", + WorkspaceId = "wsId", + Logs = new List + { + new LogSettings + { + RetentionPolicy = new RetentionPolicy + { + Days = 90, + Enabled = true + } + } + }, + Metrics = new List + { + new MetricSettings + { + Enabled = true, + RetentionPolicy = new RetentionPolicy + { + Enabled = true, + Days = 90 + }, + TimeGrain = TimeSpan.FromMinutes(1) + } + } + }; + } + + private static void AreEqual(ServiceDiagnosticSettingsResource exp, ServiceDiagnosticSettingsResource act) + { + if (exp == act) + { + return; + } + + if (exp == null) + { + Assert.Equal(null, act); + } + + Assert.False(act == null, "Actual value can't be null"); + + CompareLists(exp.Logs, act.Logs); + CompareLists(exp.Metrics, act.Metrics); + + Assert.Equal(exp.StorageAccountId, act.StorageAccountId); + Assert.Equal(exp.WorkspaceId, act.WorkspaceId); + Assert.Equal(exp.ServiceBusRuleId, act.ServiceBusRuleId); + } + + private static void Compare(T exp, T act) + { + Type t = typeof(T); + if (t == typeof(LogSettings)) + { + Compare(exp as LogSettings, act as LogSettings); + } + else if (t == typeof(LogSettings)) + { + Compare(exp as MetricSettings, act as MetricSettings); + } + } + + private static void Compare(LogSettings exp, LogSettings act) + { + Assert.Equal(exp.Enabled, act.Enabled); + Assert.Equal(exp.Category, act.Category); + Compare(exp.RetentionPolicy, act.RetentionPolicy); + } + + private static void Compare(RetentionPolicy exp, RetentionPolicy act) + { + Assert.Equal(exp.Enabled, act.Enabled); + Assert.Equal(exp.Days, act.Days); + } + + private static void CompareLists(IList exp, IList act) + { + if (exp == act) + { + return; + } + + if (exp == null) + { + Assert.Equal(null, act); + } + + Assert.False(act == null, "Actual value can't be null"); + + for (int i = 0; i < exp.Count; i++) + { + if (i >= act.Count) + { + Assert.Equal(exp.Count, act.Count); + } + + T cat1 = exp[i]; + T cat2 = act[i]; + Compare(cat1, cat2); + } + + Assert.Equal(exp.Count, act.Count); + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs new file mode 100644 index 000000000000..f5287a968569 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Monitor; +using Microsoft.Azure.Monitor.Models; +using Microsoft.Azure.Management.Monitor; +using Microsoft.Rest; +using Xunit; + +namespace Monitor.Tests.BasicTests +{ + public class TestBase + { + protected MonitorClient GetMonitorClient(RecordedDelegatingHandler handler) + { + handler.IsPassThrough = false; + var tokenProvider = new StringTokenProvider("granted", "SimpleString"); + var id = Guid.NewGuid().ToString(); + var token = new TokenCredentials(tokenProvider: tokenProvider, tenantId: id, callerId: id); + var client = new MonitorClient(token, handler); + token.InitializeServiceClient(client); + client.SubscriptionId = id; + + return client; + } + + protected MonitorManagementClient GetMonitorManagementClient(RecordedDelegatingHandler handler) + { + handler.IsPassThrough = false; + var tokenProvider = new StringTokenProvider("granted", "SimpleString"); + var id = Guid.NewGuid().ToString(); + var token = new TokenCredentials(tokenProvider: tokenProvider, tenantId: id, callerId: id); + var client = new MonitorManagementClient(token, handler); + token.InitializeServiceClient(client); + client.SubscriptionId = id; + + return client; + } + + protected static void AreEqual(IList exp, IList act) + { + if (exp != null) + { + for (int i = 0; i < exp.Count; i++) + { + Assert.Equal(exp[i], act[i]); + } + } + } + + protected static void AreEqual(IList exp, IList act) + { + if (exp != null) + { + for (int i = 0; i < exp.Count; i++) + { + Assert.Equal(exp[i].LocalizedValue, act[i].LocalizedValue); + Assert.Equal(exp[i].Value, act[i].Value); + } + } + } + + protected static void AreEqual(IList exp, IList act) + { + if (exp != null) + { + for (int i = 0; i < exp.Count; i++) + { + Assert.Equal(exp[i], act[i]); + } + } + } + + protected static void AreEqual(LocalizableString exp, LocalizableString act) + { + if (exp != null) + { + Assert.Equal(exp.LocalizedValue, act.LocalizedValue); + Assert.Equal(exp.Value, act.Value); + } + } + + protected static void AreEqual(IDictionary exp, IDictionary act) + { + if (exp != null) + { + foreach (var key in exp.Keys) + { + Assert.Equal(exp[key], act[key]); + } + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs new file mode 100644 index 000000000000..ba02443d5f42 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using Monitor.Tests.Helpers; +using Microsoft.Azure.Monitor; +using Microsoft.Azure.Monitor.Models; +using Xunit; +using Newtonsoft.Json; + +namespace Monitor.Tests.BasicTests +{ + public class UsagesTests : TestBase + { + [Fact] + public void ListUsageTest() + { + string resourceUri = "/subscriptions/123456789/resourceGroups/rg/providers/rp/rUri"; + List expectedUsageMetricCollection = GetUsageMetricCollection(resourceUri); + + var handler = new RecordedDelegatingHandler(); + var insightsClient = GetMonitorClient(handler); + var serializedObject = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(expectedUsageMetricCollection, insightsClient.SerializationSettings); + + var response = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = new StringContent(string.Concat("{ \"value\":", serializedObject, "}")) + }; + + handler = new RecordedDelegatingHandler(response) { StatusCodeToReturn = HttpStatusCode.OK }; + insightsClient = GetMonitorClient(handler); + + string filterString = "name.value eq 'CPUTime' or name.value eq 'Requests'"; + IEnumerable actualRespose = insightsClient.UsageMetrics.List(resourceUri: resourceUri, apiVersion: "2014-04-01", odataQuery: filterString); + + AreEqual(expectedUsageMetricCollection, actualRespose.GetEnumerator()); + } + + private static List GetUsageMetricCollection(string resourceUri) + { + return new List() + { + new UsageMetric( + id: "The id", + currentValue: 10.1, + limit: 100.2, + name: new LocalizableString( + localizedValue: "Cpu Percentage", + value: "CpuPercentage"), + nextResetTime: DateTime.UtcNow.AddDays(1), + quotaPeriod: TimeSpan.FromDays(1), + unit: Unit.Percent.ToString() + ) + }; + } + + private static void AreEqual(List exp, IEnumerator act) + { + if (exp != null) + { + List actList = new List(); + while (act.MoveNext()) + { + actList.Add(act.Current); + } + + Assert.Equal(exp.Count, actList.Count); + + for (int i = 0; i < exp.Count; i++) + { + AreEqual(exp[i], actList[i]); + } + } + else + { + Assert.Null(act); + } + } + + private static void AreEqual(UsageMetric exp, UsageMetric act) + { + if (exp != null) + { + Assert.Equal(exp.CurrentValue, act.CurrentValue); + Assert.Equal(exp.Limit, act.Limit); + Assert.Equal(exp.NextResetTime, act.NextResetTime); + Assert.Equal(exp.QuotaPeriod, act.QuotaPeriod); + Assert.Equal(exp.Unit, act.Unit); + AreEqual(exp.Name, act.Name); + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs b/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs new file mode 100644 index 000000000000..4860590638a4 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using System.Xml; +using Microsoft.Azure.Management.Monitor.Models; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Serialization; + +namespace Monitor.Tests.Helpers +{ + public static class JsonExtensions + { + /// + /// The JSON serialization settings + /// + public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings + { + Converters = new List + { + new TimeSpanConverter(), + new StringEnumConverter {CamelCaseText = false}, + new IsoDateTimeConverter {DateTimeStyles = DateTimeStyles.AssumeUniversal}, + new PolymorphicTypeConverter(), + new PolymorphicTypeConverter(), + new PolymorphicTypeConverter() + }, + ContractResolver = new CamelCasePropertyNamesContractResolver() + }; + + /// + /// Serialize object to the JSON. + /// + /// The object. + /// JSON representation of object + public static string ToJson(this object obj) + { + return JsonConvert.SerializeObject(obj, JsonExtensions.Settings); + } + + /// + /// Deserialize object from the JSON. + /// + /// Type of object + /// JSON representation of object + /// Deserialized object + public static T FromJson(this string json) + { + return JsonConvert.DeserializeObject(json, JsonExtensions.Settings); + } + + /// + /// TimeSpanConverter based on ISO 8601 format + /// + private class TimeSpanConverter : JsonConverter + { + /// + /// Writes the json. + /// + /// The writer. + /// The value. + /// The serializer. + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + serializer.Serialize(writer, XmlConvert.ToString((TimeSpan)value)); + } + + /// + /// Reads the json. + /// + /// The reader. + /// Type of the object. + /// The existing value. + /// The serializer. + /// Deserialized object + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) + { + return null; + } + + string timeSpanString = serializer.Deserialize(reader); + TimeSpan timeSpan; + if (TimeSpan.TryParse(timeSpanString, out timeSpan)) + { + return timeSpan; + } + + return XmlConvert.ToTimeSpan(timeSpanString); + } + + /// + /// Determines whether this instance can convert the specified object type. + /// + /// Type of the object. + /// + /// true if this instance can convert the specified object type; otherwise, false. + /// + public override bool CanConvert(Type objectType) + { + return objectType == typeof(TimeSpan) || objectType == typeof(TimeSpan?); + } + } + + public class PolymorphicTypeConverter : CustomCreationConverter + { + public const string ClientNamespace = "Microsoft.Azure.Management.Monitor.Models"; + + private readonly string[] namespaceMappings; + + /// + /// Initializes a new instance of the PolymorphicTypeConverter class. + /// + /// The optional list of namespacing mappings that should convert to this type. + public PolymorphicTypeConverter(string[] namespaceMappings = null) + { + this.namespaceMappings = namespaceMappings ?? new []{ ClientNamespace }; + } + + /// + /// Convert the JSON to object. + /// + /// Json reader. + /// Object type. + /// Existing value. + /// Json serializer. + /// Created object. + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + // Load JObject from stream + JObject jsonObject = JObject.Load(reader); + JToken type = jsonObject["odata.type"] ?? jsonObject["$type"]; + if (type != null) + { + string incomingTypeString = this.GetTypeString(type); + + // This assumes that the concrete classes are in the same assembly as the parent class (we can optimize this later by caching the possible types in the constructor + // If the type from the user is invalid, null object will be created which will be detected by the Create method + return base.ReadJson(jsonObject.CreateReader(), typeof(T).GetTypeInfo().Assembly.GetType(incomingTypeString), existingValue, serializer); + } + + return null; + } + + /// + /// Create the object. + /// + /// The object type. + /// The created object. + public override T Create(Type objectType) + { + // Check if the object extends T, if objectType is null, the call will return false + if (typeof(T).IsAssignableFrom(objectType)) + { + return (T)Activator.CreateInstance(objectType); + } + + return default(T); + } + + private string GetTypeString(JToken type) + { + string typeString = type.Value(); + + if (this.namespaceMappings != null) + { + foreach (string namespaceMapping in this.namespaceMappings) + { + if (typeString.StartsWith(namespaceMapping, StringComparison.OrdinalIgnoreCase)) + { + // Use the namespace from typeof(T) and the class name from typeString + int lastIndex = typeString.LastIndexOf('.'); + if (lastIndex >= 0) + { + typeString = typeof(T).Namespace + typeString.Substring(lastIndex); + break; + } + } + } + } + + return typeString; + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/RecordedDelegatingHandler.cs b/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/RecordedDelegatingHandler.cs new file mode 100644 index 000000000000..5b7f3e9b162e --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/RecordedDelegatingHandler.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; + +namespace Monitor.Tests.Helpers +{ + public class RecordedDelegatingHandler : DelegatingHandler + { + private HttpResponseMessage _response; + + public RecordedDelegatingHandler() + { + StatusCodeToReturn = HttpStatusCode.Created; + SubsequentStatusCodeToReturn = StatusCodeToReturn; + } + + public RecordedDelegatingHandler(HttpResponseMessage response) + { + StatusCodeToReturn = HttpStatusCode.Created; + SubsequentStatusCodeToReturn = StatusCodeToReturn; + _response = response; + } + + public HttpStatusCode StatusCodeToReturn { get; set; } + + public HttpStatusCode SubsequentStatusCodeToReturn { get; set; } + + public string Request { get; private set; } + + public HttpRequestHeaders RequestHeaders { get; private set; } + + public HttpContentHeaders ContentHeaders { get; private set; } + + public HttpMethod Method { get; private set; } + + public Uri Uri { get; private set; } + + public bool IsPassThrough { get; set; } + + private int counter; + + protected override async Task SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) + { + counter++; + // Save request + if (request.Content == null) + { + Request = string.Empty; + } + else + { + Request = await request.Content.ReadAsStringAsync(); + } + RequestHeaders = request.Headers; + if (request.Content != null) + { + ContentHeaders = request.Content.Headers; + } + Method = request.Method; + Uri = request.RequestUri; + + // Prepare response + if (IsPassThrough) + { + return await base.SendAsync(request, cancellationToken); + } + else + { + if (_response != null && counter == 1) + { + return _response; + } + else + { + var statusCode = StatusCodeToReturn; + if (counter > 1) + statusCode = SubsequentStatusCodeToReturn; + HttpResponseMessage response = new HttpResponseMessage(statusCode); + response.Content = new StringContent(""); + return response; + } + } + } + } +} diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj b/src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj new file mode 100644 index 000000000000..fc46a7fcfc08 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 2684f7eb-16b8-487e-a0ab-f4b3091c9197 + Monitor.Tests + .\obj + .\bin\ + + + 2.0 + + + + + + \ No newline at end of file diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/Properties/AssemblyInfo.cs b/src/ResourceManagement/Monitor/Monitor.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..e8726da59bfd --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Monitoring.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("MSIT")] +[assembly: AssemblyProduct("Monitoring.Tests")] +[assembly: AssemblyCopyright("Copyright © MSIT 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1445b75d-caff-454d-b7b8-8c750db40299")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/project.json b/src/ResourceManagement/Monitor/Monitor.Tests/project.json new file mode 100644 index 000000000000..01606b813896 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.Tests/project.json @@ -0,0 +1,41 @@ +{ + "version": "1.0.0-*", + "description": "Monitor.Tests Class library", + "authors": [ "Microsoft" ], + + "packOptions": { + "summary": "Monitor.Tests Tests", + "projectUrl": "", + "licenseUrl": "", + "tags": [ "" ] + }, + + "buildOptions": { + "delaySign": true, + "publicSign": false, + "keyFile": "../../../../tools/MSSharedLibKey.snk", + "compile": "../../../../tools/DisableTestRunParallel.cs" + }, + + "testRunner": "xunit", + "frameworks": { + "netcoreapp1.0": { + "imports": [ "dnxcore50", "portable-net45+win8" ], + "dependencies": { + "System.Diagnostics.Tracing": "4.1.0" + } + } + }, + + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + }, + "Microsoft.Azure.Test.HttpRecorder": "[1.6.7-preview,2.0.0)", + "Microsoft.Rest.ClientRuntime.Azure.TestFramework": "[1.5.0-preview,2.0.0)", + "xunit": "2.2.0-beta2-build3300", + "dotnet-test-xunit": "2.2.0-preview2-build1029", + "Microsoft.Azure.Monitor": "0.15.0-preview" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/Monitor/Monitor.sln b/src/ResourceManagement/Monitor/Monitor.sln new file mode 100644 index 000000000000..2a8d74819b05 --- /dev/null +++ b/src/ResourceManagement/Monitor/Monitor.sln @@ -0,0 +1,118 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Monitor.Tests", "Monitor.Tests\Monitor.Tests.xproj", "{2684F7EB-16B8-487E-A0AB-F4B3091C9197}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HttpRecorder", "..\..\TestFramework\Microsoft.Azure.Test.HttpRecorder\HttpRecorder.xproj", "{5D12D45A-E55F-410E-B8AF-9DC90E81B237}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestFramework", "..\..\TestFramework\Microsoft.Rest.ClientRuntime.Azure.TestFramework\TestFramework.xproj", "{C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Monitor", "Microsoft.Azure.Monitor\Microsoft.Azure.Monitor.xproj", "{8989ED12-B754-4EBD-BC97-EFA7B11FFD49}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime\Microsoft.Rest.ClientRuntime.xproj", "{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure\Microsoft.Rest.ClientRuntime.Azure.xproj", "{D5296EAB-C13E-4A88-9532-BD0677D18EC9}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure.Authentication", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure.Authentication\Microsoft.Rest.ClientRuntime.Azure.Authentication.xproj", "{6319205D-BBFC-4150-BEAE-31B1C9B911DD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Net45-Debug|Any CPU = Net45-Debug|Any CPU + Net45-Release|Any CPU = Net45-Release|Any CPU + Portable-Debug|Any CPU = Portable-Debug|Any CPU + Portable-Release|Any CPU = Portable-Release|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Release|Any CPU.ActiveCfg = Debug|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Release|Any CPU.Build.0 = Debug|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Debug|Any CPU.ActiveCfg = Release|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Debug|Any CPU.Build.0 = Release|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Release|Any CPU.Build.0 = Release|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Net45-Release|Any CPU.Build.0 = Release|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Release|Any CPU.Build.0 = Release|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Net45-Release|Any CPU.Build.0 = Release|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.Build.0 = Release|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Release|Any CPU.Build.0 = Release|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Release|Any CPU.Build.0 = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Net45-Release|Any CPU.Build.0 = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.Build.0 = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Net45-Release|Any CPU.Build.0 = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.Build.0 = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Net45-Release|Any CPU.Build.0 = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/ResourceManagement/Monitor/NuGet.Config b/src/ResourceManagement/Monitor/NuGet.Config new file mode 100644 index 000000000000..ffd4ee71e642 --- /dev/null +++ b/src/ResourceManagement/Monitor/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/ResourceManagement/Monitor/global.json b/src/ResourceManagement/Monitor/global.json new file mode 100644 index 000000000000..ad853eebe37b --- /dev/null +++ b/src/ResourceManagement/Monitor/global.json @@ -0,0 +1,3 @@ +{ + "projects": [ "Microsoft.Azure.Monitor", "Monitor.Tests"] +} From 2c1e03327c2a81cd517a9375e3176f8aa67350b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Thu, 16 Feb 2017 10:18:35 -0800 Subject: [PATCH 6/8] Using code generated from monitor and arm-monitor (already merged) --- .../Monitor/AlertRuleIncidentsOperations.cs | 2 +- .../AlertRuleIncidentsOperationsExtensions.cs | 2 +- .../Monitor/AlertRulesOperations.cs | 2 +- .../Monitor/AlertRulesOperationsExtensions.cs | 2 +- .../Monitor/AutoscaleSettingsOperations.cs | 2 +- .../AutoscaleSettingsOperationsExtensions.cs | 2 +- .../Monitor/IAlertRuleIncidentsOperations.cs | 2 +- .../Monitor/IAlertRulesOperations.cs | 2 +- .../Monitor/IAutoscaleSettingsOperations.cs | 2 +- .../Monitor/ILogProfilesOperations.cs | 2 +- .../Monitor/IMonitorManagementClient.cs | 2 +- .../IServiceDiagnosticSettingsOperations.cs | 2 +- .../Monitor/LogProfilesOperations.cs | 2 +- .../LogProfilesOperationsExtensions.cs | 2 +- .../Monitor/Models/AlertRuleResource.cs | 2 +- .../Monitor/Models/AutoscaleNotification.cs | 2 +- .../Monitor/Models/AutoscaleProfile.cs | 2 +- .../Models/AutoscaleSettingResource.cs | 2 +- .../Monitor/Models/ComparisonOperationType.cs | 2 +- .../Monitor/Models/ConditionOperator.cs | 2 +- .../Monitor/Models/EmailNotification.cs | 2 +- .../Management/Monitor/Models/Incident.cs | 2 +- .../Models/LocationThresholdRuleCondition.cs | 4 ++-- .../Monitor/Models/LogProfileResource.cs | 2 +- .../Management/Monitor/Models/LogSettings.cs | 2 +- .../ManagementEventAggregationCondition.cs | 2 +- .../Models/ManagementEventRuleCondition.cs | 4 ++-- .../Monitor/Models/MetricSettings.cs | 2 +- .../Monitor/Models/MetricStatisticType.cs | 2 +- .../Monitor/Models/MetricTrigger.cs | 2 +- .../Management/Monitor/Models/Page.cs | 2 +- .../Management/Monitor/Models/Page1.cs | 2 +- .../Management/Monitor/Models/Recurrence.cs | 2 +- .../Monitor/Models/RecurrenceFrequency.cs | 2 +- .../Monitor/Models/RecurrentSchedule.cs | 2 +- .../Management/Monitor/Models/Resource.cs | 2 +- .../Monitor/Models/RetentionPolicy.cs | 2 +- .../Management/Monitor/Models/RuleAction.cs | 2 +- .../Monitor/Models/RuleCondition.cs | 2 +- .../Monitor/Models/RuleDataSource.cs | 2 +- .../Monitor/Models/RuleEmailAction.cs | 4 ++-- .../RuleManagementEventClaimsDataSource.cs | 2 +- .../Models/RuleManagementEventDataSource.cs | 4 ++-- .../Monitor/Models/RuleMetricDataSource.cs | 4 ++-- .../Monitor/Models/RuleWebhookAction.cs | 4 ++-- .../Management/Monitor/Models/ScaleAction.cs | 2 +- .../Monitor/Models/ScaleCapacity.cs | 2 +- .../Monitor/Models/ScaleDirection.cs | 2 +- .../Management/Monitor/Models/ScaleRule.cs | 2 +- .../Management/Monitor/Models/ScaleType.cs | 2 +- .../ServiceDiagnosticSettingsResource.cs | 2 +- .../Monitor/Models/ThresholdRuleCondition.cs | 4 ++-- .../Monitor/Models/TimeAggregationOperator.cs | 2 +- .../Monitor/Models/TimeAggregationType.cs | 2 +- .../Management/Monitor/Models/TimeWindow.cs | 2 +- .../Monitor/Models/WebhookNotification.cs | 2 +- .../Monitor/MonitorManagementClient.cs | 2 +- .../ServiceDiagnosticSettingsOperations.cs | 12 +---------- ...eDiagnosticSettingsOperationsExtensions.cs | 2 +- .../Monitor/ActivityLogsOperations.cs | 2 +- .../ActivityLogsOperationsExtensions.cs | 2 +- .../Monitor/EventCategoriesOperations.cs | 2 +- .../EventCategoriesOperationsExtensions.cs | 2 +- .../Monitor/IActivityLogsOperations.cs | 2 +- .../Monitor/IEventCategoriesOperations.cs | 2 +- .../Monitor/IMetricDefinitionsOperations.cs | 2 +- .../Generated/Monitor/IMetricsOperations.cs | 2 +- .../Generated/Monitor/IMonitorClient.cs | 2 +- .../Monitor/ITenantActivityLogsOperations.cs | 2 +- .../Monitor/IUsageMetricsOperations.cs | 2 +- .../Monitor/MetricDefinitionsOperations.cs | 2 +- .../MetricDefinitionsOperationsExtensions.cs | 2 +- .../Generated/Monitor/MetricsOperations.cs | 2 +- .../Monitor/MetricsOperationsExtensions.cs | 2 +- .../Monitor/Models/AggregationType.cs | 2 +- .../Generated/Monitor/Models/EventData.cs | 2 +- .../Generated/Monitor/Models/EventLevel.cs | 2 +- .../Monitor/Models/HttpRequestInfo.cs | 2 +- .../Monitor/Models/LocalizableString.cs | 2 +- .../Generated/Monitor/Models/Metric.cs | 21 +++++++++++++++++-- .../Monitor/Models/MetricAvailability.cs | 2 +- .../Monitor/Models/MetricDefinition.cs | 2 +- .../Generated/Monitor/Models/MetricValue.cs | 2 +- .../Generated/Monitor/Models/Page.cs | 2 +- .../Generated/Monitor/Models/Page1.cs | 2 +- .../Monitor/Models/SenderAuthorization.cs | 2 +- .../Generated/Monitor/Models/Unit.cs | 2 +- .../Generated/Monitor/Models/UsageMetric.cs | 2 +- .../Generated/Monitor/MonitorClient.cs | 2 +- .../Monitor/TenantActivityLogsOperations.cs | 2 +- .../TenantActivityLogsOperationsExtensions.cs | 2 +- .../Monitor/UsageMetricsOperations.cs | 2 +- .../UsageMetricsOperationsExtensions.cs | 2 +- .../Microsoft.Azure.Monitor/generate.cmd | 8 +++---- .../Monitor.Tests/BasicTests/AlertsTests.cs | 4 ++-- .../BasicTests/AutoscaleTests.cs | 4 ++-- .../BasicTests/EventDataTests.cs | 4 ++-- .../BasicTests/LogProfilesTests.cs | 4 ++-- .../Monitor.Tests/BasicTests/MetricsTests.cs | 4 ++-- .../ServiceDiagnosticSettingsTests.cs | 4 ++-- .../Monitor.Tests/BasicTests/TestBaseTests.cs | 6 +++--- .../Monitor.Tests/BasicTests/UsagesTests.cs | 4 ++-- .../Monitor.Tests/Helpers/JsonExtensions.cs | 4 ++-- 103 files changed, 141 insertions(+), 134 deletions(-) diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs index a63388df2131..ceb1aac57c01 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs index 28985a393b35..b53f11593eea 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs index 0b0810fd368e..56389c32ce87 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs index 789ec96fb732..363e35b947e8 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs index e3832994e930..81051350647b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs index 6d04b53e28a4..2b6bb599cab2 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs index afa8a9a27cc3..258f36fc2307 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs index 2743782850d4..daa38172b621 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs index bf63b945e959..6806f73655cc 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs index 7c29513a7d37..92d006d4d42b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs index ae10881bfd6b..21825a24882c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using Microsoft.Rest; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs index 83ba8af739a4..864608358b26 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs index a35b918a14ab..ae547b19fb2d 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs index 8c28aac7819e..0582e546bb47 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs index 3fb1f9a577ff..b2f354a862e5 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs index 429ceaaee534..63d0e1754530 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs index c0630fecdb47..d84a0f6358d1 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs index 49abc19505f3..8b8be9eb35e0 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs index 7e8f008f77ac..3506b4f380a5 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs index 4cbf188dc3b7..9c6ca37a10f6 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs index 3dc3debc80b3..a8fa1f179313 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs index f5265dc413c3..eefbe85edb73 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs index 4ef77a17dbaf..9d55a40f575c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs @@ -6,14 +6,14 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; /// /// A rule condition based on a certain number of locations failing. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.LocationThresholdRuleCondition")] + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition")] public partial class LocationThresholdRuleCondition : RuleCondition { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs index 407a81934811..0ebeb90cb615 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs index bc3aabca8ca4..38e10d17dc59 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs index f7d9adca503d..1708cdc91ac5 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs index bd876c36bb86..1b21c7b6001f 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs @@ -6,14 +6,14 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; /// /// A management event rule condition. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.ManagementEventRuleCondition")] + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition")] public partial class ManagementEventRuleCondition : RuleCondition { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs index 9e4a27950755..b52b101be9ba 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs index 01450b9f3d4d..5baf73f84408 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs index d7b2c3ae7f9a..db22ded56f7a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs index 69c4c496e56d..d517340cdb2a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs index 28a3519f753d..69676959c407 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs index edc855290964..51c2b1dc84f8 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs index 84ce4f31fe64..81137fd8db6a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs index f65146399687..4f90a5a2b31f 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs index d88f372468a9..1844e6ddbda3 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs index e2ac102af6c4..cc010ea24097 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs index cc2906ee8607..34e5df7ea29d 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs index 35ae6fa4a972..fd25240b7bab 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs index b267fdde56b8..3ff121627a2a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs index 7fd91a30a6eb..618f41b22a95 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Monitor.Models /// Specifies the action to send email when the rule condition is /// evaluated. The discriminator is always RuleEmailAction in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleEmailAction")] + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleEmailAction")] public partial class RuleEmailAction : RuleAction { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs index 8d98ca69adaf..7e2acff3deb6 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs index 848374b55a30..2f4cab87a8be 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Monitor.Models /// A rule management event data source. The discriminator fields is always /// RuleManagementEventDataSource in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleManagementEventDataSource")] + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource")] public partial class RuleManagementEventDataSource : RuleDataSource { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs index ee06756d0dba..76ced5891bf5 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Monitor.Models /// A rule metric data source. The discriminator value is always /// RuleMetricDataSource in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleMetricDataSource")] + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")] public partial class RuleMetricDataSource : RuleDataSource { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs index a2b99e51d316..f781bdef0b04 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Monitor.Models /// Specifies the action to post to service when the rule condition is /// evaluated. The discriminator is always RuleWebhookAction in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.RuleWebhookAction")] + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleWebhookAction")] public partial class RuleWebhookAction : RuleAction { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs index 3e7bd688daa7..e7894a6c3d86 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs index 3846c71cdfe1..95b5dbce0dbe 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs index b2738ce2bd16..9973ffedc81f 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs index 80072773e03a..e495486a0a97 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs index 445f5d0ff670..f890f163e600 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs index 372ccd38a57e..f69b4b8391e4 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs index e42c1aa06b39..fcb1be4f4d06 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs @@ -6,14 +6,14 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; /// /// A rule condition based on a metric crossing a threshold. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Monitor.Models.ThresholdRuleCondition")] + [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")] public partial class ThresholdRuleCondition : RuleCondition { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs index d563a04cee10..4b09fee4ab69 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs index f6cd123ab4ed..25d280cab005 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs index 1466f0c69f1b..900dd61616f2 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs index e21afb3b78b9..f05ac63ec22b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor.Models +namespace Microsoft.Azure.Management.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs index 1650727616e1..5c081a38d66b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs index 704a3827ba58..9cd0387dc6d5 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Linq; using Microsoft.Rest; @@ -71,10 +71,6 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-07-01"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -92,7 +88,6 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/service").ToString(); _url = _url.Replace("{resourceUri}", System.Uri.EscapeDataString(resourceUri)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { @@ -262,10 +257,6 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) { parameters.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } string apiVersion = "2015-07-01"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -284,7 +275,6 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/service").ToString(); _url = _url.Replace("{resourceUri}", System.Uri.EscapeDataString(resourceUri)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs index 8edc7829de3e..aa8b53d811cc 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Management.Monitor +namespace Microsoft.Azure.Management.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs index c96f5892f246..6d189bb64ba0 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs index f391a5ea31aa..0b29165df177 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs index 9d9b65bac136..a819aca0050c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs index 0b33471de77e..35167a713c31 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs index c4c236c61c18..9c525b6d9337 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs index caaa8eb71232..0d1e7f6c1a55 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs index 7a7bd234883f..257c9edc38b3 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs index 02e437baae10..35b0816b904e 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs index f33cc532e0b8..addfaddcdb12 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using Microsoft.Rest; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs index cf7ae81a092e..1dfb34d328b2 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs index 80acedaab2c8..7de1d078bbde 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using Microsoft.Rest.Azure; using Models; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs index 7f598b1f0c72..52feec5721cf 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs index 756ee99295a8..a15ff262a5c8 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs index 72802b83c315..699548d6231b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs index a27c756589f5..eb23313bd0ca 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs index 89baa1637e02..af98affd34d9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs index 6a99aa4f7821..850d6c323b45 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs index 21acfeb0e81e..de80b1b60efc 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs index d6185239272c..52405fc6a672 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs index be4a11ab35fb..0473a143203e 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs index e5743f872266..6130c17abe11 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; @@ -30,13 +30,30 @@ public Metric() { } /// 'Percent', 'MilliSeconds' /// Array of data points representing the metric /// values. - public Metric(LocalizableString name, Unit unit, System.Collections.Generic.IList data) + /// the id, resourceId, of the metric. + /// the resource type of the metric + /// resource. + public Metric(LocalizableString name, Unit unit, System.Collections.Generic.IList data, string id = default(string), string type = default(string)) { + Id = id; + Type = type; Name = name; Unit = unit; Data = data; } + /// + /// Gets or sets the id, resourceId, of the metric. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the resource type of the metric resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type { get; set; } + /// /// Gets or sets the name and the display name of the metric, i.e. it /// is localizable string. diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs index c9c92e57c537..a358beacfec8 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs index 6b8124ffa93f..72c618568142 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs index 6d471dcea245..ed93e020c462 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs index 65cf5d45d3d9..92e2a6b0a157 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs index ebbf9474324c..48ed67f34acd 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs index fc16477d54c8..252f03e03705 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs index 285ace3114c1..ddc1f81c334a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { /// diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs index 458268d5324f..8192c4e83b27 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor.Models +namespace Microsoft.Azure.Insights.Models { using System.Linq; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs index c9dee3ec8bf6..e5b00c6b38af 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs index 24b14b8ee513..7254a792c2d8 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs index 5e30a64da51d..dd4231172d7b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs index b5200831caae..84427c5b86e6 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Linq; using Microsoft.Rest; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs index 471dc2b105bf..e7b1921b2a4c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs @@ -6,7 +6,7 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -namespace Microsoft.Azure.Monitor +namespace Microsoft.Azure.Insights { using System.Threading.Tasks; using Microsoft.Rest.Azure; diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd index b5020da84e66..72957ab82406 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd @@ -7,7 +7,7 @@ @echo off set autoRestVersion=1.0.0-Nightly20161116 if "%1" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1f823636981e779b6d4155aa18d042146e1270fb/monitor/compositeMonitorClient.json" + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/efed63280648eebdec8be513470cd6c23783efb6/monitor/compositeMonitorClient.json" ) else ( set specFile="%1" ) @@ -15,10 +15,10 @@ set repoRoot=%~dp0..\..\..\.. set generateFolder=%~dp0Generated\Monitor if exist %generateFolder% rd /S /Q %generateFolder% -call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Monitor %autoRestVersion% %generateFolder% "-FT 1" +call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Insights %autoRestVersion% %generateFolder% "-FT 1" if "%2" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1f823636981e779b6d4155aa18d042146e1270fb/arm-monitor/compositeMonitorManagementClient.json" + set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/efed63280648eebdec8be513470cd6c23783efb6/arm-monitor/compositeMonitorManagementClient.json" ) else ( set specFile="%2" ) @@ -26,5 +26,5 @@ if "%2" == "" ( set generateFolder=%~dp0Generated\Management\Monitor if exist %generateFolder% rd /S /Q %generateFolder% -call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Management.Monitor %autoRestVersion% %generateFolder% "-FT 1" +call "%repoRoot%\tools\autorest.composite.gen.cmd" %specFile% Microsoft.Azure.Management.Insights %autoRestVersion% %generateFolder% "-FT 1" \ No newline at end of file diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs index 5d48b069439e..0aeb3880dd5a 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AlertsTests.cs @@ -7,8 +7,8 @@ using System.Net; using System.Net.Http; using Monitor.Tests.Helpers; -using Microsoft.Azure.Management.Monitor; -using Microsoft.Azure.Management.Monitor.Models; +using Microsoft.Azure.Management.Insights; +using Microsoft.Azure.Management.Insights.Models; using Xunit; namespace Monitor.Tests.BasicTests diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs index 2e2cd074dda5..954ee55b84bf 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/AutoscaleTests.cs @@ -6,8 +6,8 @@ using System.Net; using System.Net.Http; using Monitor.Tests.Helpers; -using Microsoft.Azure.Management.Monitor; -using Microsoft.Azure.Management.Monitor.Models; +using Microsoft.Azure.Management.Insights; +using Microsoft.Azure.Management.Insights.Models; using Xunit; namespace Monitor.Tests.BasicTests diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs index a41c438fd05b..cb5368ecca89 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/EventDataTests.cs @@ -7,8 +7,8 @@ using System.Net; using System.Net.Http; using Monitor.Tests.Helpers; -using Microsoft.Azure.Monitor; -using Microsoft.Azure.Monitor.Models; +using Microsoft.Azure.Insights; +using Microsoft.Azure.Insights.Models; using Microsoft.Rest.Azure.OData; using Xunit; diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs index 4386e7cde241..aa546d77759d 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/LogProfilesTests.cs @@ -6,8 +6,8 @@ using System.Net; using System.Net.Http; using Monitor.Tests.Helpers; -using Microsoft.Azure.Management.Monitor; -using Microsoft.Azure.Management.Monitor.Models; +using Microsoft.Azure.Management.Insights; +using Microsoft.Azure.Management.Insights.Models; using Xunit; namespace Monitor.Tests.BasicTests diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs index f368d7c57593..1a8310342e66 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/MetricsTests.cs @@ -8,8 +8,8 @@ using System.Net.Http; using System.Threading; using Monitor.Tests.Helpers; -using Microsoft.Azure.Monitor; -using Microsoft.Azure.Monitor.Models; +using Microsoft.Azure.Insights; +using Microsoft.Azure.Insights.Models; using Xunit; namespace Monitor.Tests.BasicTests diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs index b8353b47b9fd..2ae62f2fb518 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/ServiceDiagnosticSettingsTests.cs @@ -6,8 +6,8 @@ using System.Net; using System.Net.Http; using Monitor.Tests.Helpers; -using Microsoft.Azure.Management.Monitor; -using Microsoft.Azure.Management.Monitor.Models; +using Microsoft.Azure.Management.Insights; +using Microsoft.Azure.Management.Insights.Models; using Xunit; namespace Monitor.Tests.BasicTests diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs index f5287a968569..8370fd47baaa 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/TestBaseTests.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; using Monitor.Tests.Helpers; -using Microsoft.Azure.Monitor; -using Microsoft.Azure.Monitor.Models; -using Microsoft.Azure.Management.Monitor; +using Microsoft.Azure.Insights; +using Microsoft.Azure.Insights.Models; +using Microsoft.Azure.Management.Insights; using Microsoft.Rest; using Xunit; diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs index ba02443d5f42..e9987f1f539f 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/BasicTests/UsagesTests.cs @@ -6,8 +6,8 @@ using System.Net; using System.Net.Http; using Monitor.Tests.Helpers; -using Microsoft.Azure.Monitor; -using Microsoft.Azure.Monitor.Models; +using Microsoft.Azure.Insights; +using Microsoft.Azure.Insights.Models; using Xunit; using Newtonsoft.Json; diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs b/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs index 4860590638a4..110d4eaa94cf 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs +++ b/src/ResourceManagement/Monitor/Monitor.Tests/Helpers/JsonExtensions.cs @@ -6,7 +6,7 @@ using System.Globalization; using System.Reflection; using System.Xml; -using Microsoft.Azure.Management.Monitor.Models; +using Microsoft.Azure.Management.Insights.Models; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; @@ -110,7 +110,7 @@ public override bool CanConvert(Type objectType) public class PolymorphicTypeConverter : CustomCreationConverter { - public const string ClientNamespace = "Microsoft.Azure.Management.Monitor.Models"; + public const string ClientNamespace = "Microsoft.Azure.Management.Insights.Models"; private readonly string[] namespaceMappings; From bcbbc33bddc2e49e533ffe979bd7d84cb463a6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Thu, 16 Feb 2017 11:45:35 -0800 Subject: [PATCH 7/8] Updating README.md --- Documentation/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/README.md b/Documentation/README.md index d35fe7effc49..98895a87abeb 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -18,6 +18,7 @@ These SDKs depend on Microsoft.Azure.Common | HdInsight | Microsoft.Azure.Management.HDInsight, Microsoft.Azure.Management.HDInsight.Job | | Insights | Microsoft.Azure.Insights | | Media Services | Microsoft.WindowsAzure.Management.MediaServices | +| Monitor | Microsoft.Azure.Monitor | | Monitoring | Microsoft.WindowsAzure.Management.Monitoring | | Operational Insights | Microsoft.Azure.Management.OperationalInsights | | Recovery Services | Microsoft.Azure.Management.RecoveryServices, Microsoft.Azure.Management.RecoveryServices.Backup | From 882c32b6461ca7000464e049986777fa4cd863cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Calder=C3=B3n=5FMeza?= Date: Thu, 16 Feb 2017 16:31:32 -0800 Subject: [PATCH 8/8] Verifying correct generation of code and some minor changes --- .../Monitor/AlertRuleIncidentsOperations.cs | 184 ++++---- .../AlertRuleIncidentsOperationsExtensions.cs | 23 +- .../Monitor/AlertRulesOperations.cs | 337 ++++++++------- .../Monitor/AlertRulesOperationsExtensions.cs | 32 +- .../Monitor/AutoscaleSettingsOperations.cs | 406 ++++++++++-------- .../AutoscaleSettingsOperationsExtensions.cs | 36 +- .../Monitor/IAlertRuleIncidentsOperations.cs | 16 +- .../Monitor/IAlertRulesOperations.cs | 21 +- .../Monitor/IAutoscaleSettingsOperations.cs | 23 +- .../Monitor/ILogProfilesOperations.cs | 20 +- .../Monitor/IMonitorManagementClient.cs | 16 +- .../IServiceDiagnosticSettingsOperations.cs | 16 +- .../Monitor/LogProfilesOperations.cs | 320 +++++++------- .../LogProfilesOperationsExtensions.cs | 31 +- .../Monitor/Models/AlertRuleResource.cs | 35 +- .../Monitor/Models/AutoscaleNotification.cs | 19 +- .../Monitor/Models/AutoscaleProfile.cs | 48 ++- .../Models/AutoscaleSettingResource.cs | 43 +- .../Monitor/Models/ComparisonOperationType.cs | 24 +- .../Monitor/Models/ConditionOperator.cs | 20 +- .../Monitor/Models/EmailNotification.cs | 19 +- .../Management/Monitor/Models/Incident.cs | 27 +- .../Models/LocationThresholdRuleCondition.cs | 17 +- .../Monitor/Models/LogProfileResource.cs | 37 +- .../Management/Monitor/Models/LogSettings.cs | 19 +- .../ManagementEventAggregationCondition.cs | 13 +- .../Models/ManagementEventRuleCondition.cs | 13 +- .../Monitor/Models/MetricSettings.cs | 19 +- .../Monitor/Models/MetricStatisticType.cs | 20 +- .../Monitor/Models/MetricTrigger.cs | 30 +- .../Management/Monitor/Models/Page.cs | 29 +- .../Management/Monitor/Models/Page1.cs | 29 +- .../Management/Monitor/Models/Recurrence.cs | 20 +- .../Monitor/Models/RecurrenceFrequency.cs | 28 +- .../Monitor/Models/RecurrentSchedule.cs | 36 +- .../Management/Monitor/Models/Resource.cs | 35 +- .../Monitor/Models/RetentionPolicy.cs | 13 +- .../Management/Monitor/Models/RuleAction.cs | 6 +- .../Monitor/Models/RuleCondition.cs | 6 +- .../Monitor/Models/RuleDataSource.cs | 6 +- .../Monitor/Models/RuleEmailAction.cs | 19 +- .../RuleManagementEventClaimsDataSource.cs | 9 +- .../Models/RuleManagementEventDataSource.cs | 29 +- .../Monitor/Models/RuleMetricDataSource.cs | 13 +- .../Monitor/Models/RuleWebhookAction.cs | 19 +- .../Management/Monitor/Models/ScaleAction.cs | 17 +- .../Monitor/Models/ScaleCapacity.cs | 22 +- .../Monitor/Models/ScaleDirection.cs | 18 +- .../Management/Monitor/Models/ScaleRule.cs | 26 +- .../Management/Monitor/Models/ScaleType.cs | 18 +- .../ServiceDiagnosticSettingsResource.cs | 39 +- .../Monitor/Models/ThresholdRuleCondition.cs | 21 +- .../Monitor/Models/TimeAggregationOperator.cs | 22 +- .../Monitor/Models/TimeAggregationType.cs | 22 +- .../Management/Monitor/Models/TimeWindow.cs | 15 +- .../Monitor/Models/WebhookNotification.cs | 17 +- .../Monitor/MonitorManagementClient.cs | 141 +++--- .../ServiceDiagnosticSettingsOperations.cs | 170 ++++---- ...eDiagnosticSettingsOperationsExtensions.cs | 19 +- .../Monitor/ActivityLogsOperations.cs | 170 ++++---- .../ActivityLogsOperationsExtensions.cs | 23 +- .../Monitor/EventCategoriesOperations.cs | 87 ++-- .../EventCategoriesOperationsExtensions.cs | 18 +- .../Monitor/IActivityLogsOperations.cs | 16 +- .../Monitor/IEventCategoriesOperations.cs | 13 +- .../Monitor/IMetricDefinitionsOperations.cs | 14 +- .../Generated/Monitor/IMetricsOperations.cs | 14 +- .../Generated/Monitor/IMonitorClient.cs | 15 +- .../Monitor/ITenantActivityLogsOperations.cs | 16 +- .../Monitor/IUsageMetricsOperations.cs | 17 +- .../Monitor/MetricDefinitionsOperations.cs | 97 +++-- .../MetricDefinitionsOperationsExtensions.cs | 19 +- .../Generated/Monitor/MetricsOperations.cs | 97 +++-- .../Monitor/MetricsOperationsExtensions.cs | 19 +- .../Monitor/Models/AggregationType.cs | 23 +- .../Generated/Monitor/Models/EventData.cs | 92 ++-- .../Generated/Monitor/Models/EventLevel.cs | 21 +- .../Monitor/Models/HttpRequestInfo.cs | 14 +- .../Monitor/Models/LocalizableString.cs | 15 +- .../Generated/Monitor/Models/Metric.cs | 37 +- .../Monitor/Models/MetricAvailability.cs | 10 +- .../Monitor/Models/MetricDefinition.cs | 30 +- .../Generated/Monitor/Models/MetricValue.cs | 20 +- .../Generated/Monitor/Models/Page.cs | 28 +- .../Generated/Monitor/Models/Page1.cs | 28 +- .../Monitor/Models/SenderAuthorization.cs | 12 +- .../Generated/Monitor/Models/Unit.cs | 25 +- .../Generated/Monitor/Models/UsageMetric.cs | 26 +- .../Generated/Monitor/MonitorClient.cs | 126 +++--- .../Monitor/TenantActivityLogsOperations.cs | 159 ++++--- .../TenantActivityLogsOperationsExtensions.cs | 23 +- .../Monitor/UsageMetricsOperations.cs | 107 ++--- .../UsageMetricsOperationsExtensions.cs | 25 +- .../Microsoft.Azure.Monitor.xproj | 2 +- .../Microsoft.Azure.Monitor/generate.cmd | 2 +- .../Monitor/Monitor.Tests/Monitor.Tests.xproj | 4 +- src/ResourceManagement/Monitor/Monitor.sln | 52 +-- 97 files changed, 2518 insertions(+), 1746 deletions(-) diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs index ceb1aac57c01..750029ea92c4 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// AlertRuleIncidentsOperations operations. /// - internal partial class AlertRuleIncidentsOperations : Microsoft.Rest.IServiceOperations, IAlertRuleIncidentsOperations + internal partial class AlertRuleIncidentsOperations : IServiceOperations, IAlertRuleIncidentsOperations { /// /// Initializes a new instance of the AlertRuleIncidentsOperations class. @@ -29,11 +38,11 @@ internal partial class AlertRuleIncidentsOperations : Microsoft.Rest.IServiceOpe /// internal AlertRuleIncidentsOperations(MonitorManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -59,59 +68,62 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, string incidentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, string incidentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (ruleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); } if (incidentName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "incidentName"); + throw new ValidationException(ValidationRules.CannotBeNull, "incidentName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("incidentName", incidentName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents/{incidentName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{incidentName}", System.Uri.EscapeDataString(incidentName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -121,23 +133,25 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,51 +167,51 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -207,7 +221,7 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -220,21 +234,21 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -254,53 +268,56 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (ruleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByAlertRule", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByAlertRule", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}/incidents").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -310,23 +327,25 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -342,51 +361,51 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -396,7 +415,7 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -409,24 +428,25 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs index b53f11593eea..761c281d646b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRuleIncidentsOperationsExtensions.cs @@ -1,16 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for AlertRuleIncidentsOperations. @@ -34,7 +40,7 @@ public static partial class AlertRuleIncidentsOperationsExtensions /// public static Incident Get(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRuleIncidentsOperations)s).GetAsync(resourceGroupName, ruleName, incidentName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, ruleName, incidentName).GetAwaiter().GetResult(); } /// @@ -55,7 +61,7 @@ public static Incident Get(this IAlertRuleIncidentsOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, string incidentName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ruleName, incidentName, null, cancellationToken).ConfigureAwait(false)) { @@ -75,9 +81,9 @@ public static Incident Get(this IAlertRuleIncidentsOperations operations, string /// /// The name of the rule. /// - public static System.Collections.Generic.IEnumerable ListByAlertRule(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName) + public static IEnumerable ListByAlertRule(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRuleIncidentsOperations)s).ListByAlertRuleAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByAlertRuleAsync(resourceGroupName, ruleName).GetAwaiter().GetResult(); } /// @@ -95,7 +101,7 @@ public static System.Collections.Generic.IEnumerable ListByAlertRule(t /// /// The cancellation token. /// - public static async Task> ListByAlertRuleAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListByAlertRuleAsync(this IAlertRuleIncidentsOperations operations, string resourceGroupName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByAlertRuleWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)) { @@ -105,3 +111,4 @@ public static System.Collections.Generic.IEnumerable ListByAlertRule(t } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs index 56389c32ce87..e0e83c11d3de 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs @@ -1,22 +1,32 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// AlertRulesOperations operations. /// - internal partial class AlertRulesOperations : Microsoft.Rest.IServiceOperations, IAlertRulesOperations + internal partial class AlertRulesOperations : IServiceOperations, IAlertRulesOperations { /// /// Initializes a new instance of the AlertRulesOperations class. @@ -29,11 +39,11 @@ internal partial class AlertRulesOperations : Microsoft.Rest.IServiceOperations< /// internal AlertRulesOperations(MonitorManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -61,62 +71,65 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (ruleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { parameters.Validate(); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -126,23 +139,25 @@ internal AlertRulesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -159,56 +174,56 @@ internal AlertRulesOperations(MonitorManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -218,7 +233,7 @@ internal AlertRulesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -231,16 +246,16 @@ internal AlertRulesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -249,21 +264,21 @@ internal AlertRulesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -283,50 +298,53 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (ruleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -336,23 +354,25 @@ internal AlertRulesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -368,43 +388,43 @@ internal AlertRulesOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204 && (int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); } else { _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -414,7 +434,7 @@ internal AlertRulesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -423,7 +443,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -443,53 +463,56 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (ruleName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ruleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("ruleName", ruleName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -499,23 +522,25 @@ internal AlertRulesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -531,51 +556,51 @@ internal AlertRulesOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -585,7 +610,7 @@ internal AlertRulesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -598,21 +623,21 @@ internal AlertRulesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -632,52 +657,55 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (odataQuery != null) { var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } @@ -691,23 +719,25 @@ internal AlertRulesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -723,51 +753,51 @@ internal AlertRulesOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -777,7 +807,7 @@ internal AlertRulesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -790,24 +820,25 @@ internal AlertRulesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs index 363e35b947e8..38929e4267f7 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs @@ -1,16 +1,23 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for AlertRulesOperations. @@ -36,7 +43,7 @@ public static partial class AlertRulesOperationsExtensions /// public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).CreateOrUpdateAsync(resourceGroupName, ruleName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, ruleName, parameters).GetAwaiter().GetResult(); } /// @@ -59,7 +66,7 @@ public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operat /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResource parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, ruleName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -81,7 +88,7 @@ public static AlertRuleResource CreateOrUpdate(this IAlertRulesOperations operat /// public static void Delete(this IAlertRulesOperations operations, string resourceGroupName, string ruleName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).DeleteAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, ruleName).GetAwaiter().GetResult(); } /// @@ -99,7 +106,7 @@ public static void Delete(this IAlertRulesOperations operations, string resource /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false); } @@ -118,7 +125,7 @@ public static void Delete(this IAlertRulesOperations operations, string resource /// public static AlertRuleResource Get(this IAlertRulesOperations operations, string resourceGroupName, string ruleName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).GetAsync(resourceGroupName, ruleName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, ruleName).GetAwaiter().GetResult(); } /// @@ -136,7 +143,7 @@ public static AlertRuleResource Get(this IAlertRulesOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)) { @@ -156,9 +163,9 @@ public static AlertRuleResource Get(this IAlertRulesOperations operations, strin /// /// OData parameters to apply to the operation. /// - public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IAlertRulesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static IEnumerable ListByResourceGroup(this IAlertRulesOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAlertRulesOperations)s).ListByResourceGroupAsync(resourceGroupName, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByResourceGroupAsync(resourceGroupName, odataQuery).GetAwaiter().GetResult(); } /// @@ -176,7 +183,7 @@ public static AlertRuleResource Get(this IAlertRulesOperations operations, strin /// /// The cancellation token. /// - public static async Task> ListByResourceGroupAsync(this IAlertRulesOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListByResourceGroupAsync(this IAlertRulesOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { @@ -186,3 +193,4 @@ public static AlertRuleResource Get(this IAlertRulesOperations operations, strin } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs index 81051350647b..4d0e46213236 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs @@ -1,22 +1,32 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// AutoscaleSettingsOperations operations. /// - internal partial class AutoscaleSettingsOperations : Microsoft.Rest.IServiceOperations, IAutoscaleSettingsOperations + internal partial class AutoscaleSettingsOperations : IServiceOperations, IAutoscaleSettingsOperations { /// /// Initializes a new instance of the AutoscaleSettingsOperations class. @@ -29,11 +39,11 @@ internal partial class AutoscaleSettingsOperations : Microsoft.Rest.IServiceOper /// internal AutoscaleSettingsOperations(MonitorManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -56,52 +66,55 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2015-04-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (odataQuery != null) { var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } @@ -115,23 +128,25 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -147,51 +162,51 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -201,7 +216,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -214,21 +229,21 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -251,62 +266,65 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (autoscaleSettingName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "autoscaleSettingName"); + throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName"); } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { parameters.Validate(); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2015-04-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("autoscaleSettingName", autoscaleSettingName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -316,23 +334,25 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -349,56 +369,56 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -408,7 +428,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -421,16 +441,16 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -439,21 +459,21 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -473,50 +493,53 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (autoscaleSettingName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "autoscaleSettingName"); + throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2015-04-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("autoscaleSettingName", autoscaleSettingName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -526,23 +549,25 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -558,43 +583,43 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); } else { _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -604,7 +629,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -613,7 +638,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -633,53 +658,56 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (autoscaleSettingName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "autoscaleSettingName"); + throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2015-04-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("autoscaleSettingName", autoscaleSettingName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -689,23 +717,25 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -721,51 +751,51 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -775,7 +805,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -788,21 +818,21 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -819,61 +849,66 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -889,51 +924,51 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -943,7 +978,7 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -956,24 +991,25 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs index 2b6bb599cab2..5baee5c6d5e5 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs @@ -1,16 +1,21 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for AutoscaleSettingsOperations. @@ -29,9 +34,9 @@ public static partial class AutoscaleSettingsOperationsExtensions /// /// OData parameters to apply to the operation. /// - public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IAutoscaleSettingsOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static IPage ListByResourceGroup(this IAutoscaleSettingsOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).ListByResourceGroupAsync(resourceGroupName, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByResourceGroupAsync(resourceGroupName, odataQuery).GetAwaiter().GetResult(); } /// @@ -49,7 +54,7 @@ public static partial class AutoscaleSettingsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListByResourceGroupAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListByResourceGroupAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { @@ -74,7 +79,7 @@ public static partial class AutoscaleSettingsOperationsExtensions /// public static AutoscaleSettingResource CreateOrUpdate(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).CreateOrUpdateAsync(resourceGroupName, autoscaleSettingName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, autoscaleSettingName, parameters).GetAwaiter().GetResult(); } /// @@ -95,7 +100,7 @@ public static AutoscaleSettingResource CreateOrUpdate(this IAutoscaleSettingsOpe /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, autoscaleSettingName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -117,7 +122,7 @@ public static AutoscaleSettingResource CreateOrUpdate(this IAutoscaleSettingsOpe /// public static void Delete(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).DeleteAsync(resourceGroupName, autoscaleSettingName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, autoscaleSettingName).GetAwaiter().GetResult(); } /// @@ -135,7 +140,7 @@ public static void Delete(this IAutoscaleSettingsOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, autoscaleSettingName, null, cancellationToken).ConfigureAwait(false); } @@ -154,7 +159,7 @@ public static void Delete(this IAutoscaleSettingsOperations operations, string r /// public static AutoscaleSettingResource Get(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).GetAsync(resourceGroupName, autoscaleSettingName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, autoscaleSettingName).GetAwaiter().GetResult(); } /// @@ -172,7 +177,7 @@ public static AutoscaleSettingResource Get(this IAutoscaleSettingsOperations ope /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, autoscaleSettingName, null, cancellationToken).ConfigureAwait(false)) { @@ -189,9 +194,9 @@ public static AutoscaleSettingResource Get(this IAutoscaleSettingsOperations ope /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IAutoscaleSettingsOperations operations, string nextPageLink) + public static IPage ListByResourceGroupNext(this IAutoscaleSettingsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IAutoscaleSettingsOperations)s).ListByResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -206,7 +211,7 @@ public static Microsoft.Rest.Azure.IPage ListByResourc /// /// The cancellation token. /// - public static async Task> ListByResourceGroupNextAsync(this IAutoscaleSettingsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListByResourceGroupNextAsync(this IAutoscaleSettingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -216,3 +221,4 @@ public static Microsoft.Rest.Azure.IPage ListByResourc } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs index 258f36fc2307..2f38274e83cb 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRuleIncidentsOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// AlertRuleIncidentsOperations operations. @@ -43,7 +50,7 @@ public partial interface IAlertRuleIncidentsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, string incidentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, string incidentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of incidents associated to an alert rule /// @@ -68,6 +75,7 @@ public partial interface IAlertRuleIncidentsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs index daa38172b621..97369ced7e07 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs @@ -1,15 +1,23 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// AlertRulesOperations operations. @@ -45,7 +53,7 @@ public partial interface IAlertRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an alert rule /// @@ -67,7 +75,7 @@ public partial interface IAlertRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets an alert rule /// @@ -92,7 +100,7 @@ public partial interface IAlertRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List the alert rules within a resource group. /// @@ -117,6 +125,7 @@ public partial interface IAlertRulesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs index 6806f73655cc..03e9af83ab86 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs @@ -1,15 +1,23 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// AutoscaleSettingsOperations operations. @@ -40,7 +48,7 @@ public partial interface IAutoscaleSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates or updates an autoscale setting. /// @@ -68,7 +76,7 @@ public partial interface IAutoscaleSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes and autoscale setting /// @@ -90,7 +98,7 @@ public partial interface IAutoscaleSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets an autoscale setting /// @@ -115,7 +123,7 @@ public partial interface IAutoscaleSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the autoscale settings for a resource group /// @@ -137,6 +145,7 @@ public partial interface IAutoscaleSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs index 92d006d4d42b..5a6fa06c9eb6 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// LogProfilesOperations operations. @@ -34,7 +41,7 @@ public partial interface ILogProfilesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string logProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the log profile. /// @@ -56,7 +63,7 @@ public partial interface ILogProfilesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string logProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update a log profile in Azure Monitoring REST API. /// @@ -81,7 +88,7 @@ public partial interface ILogProfilesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List the log profiles. /// @@ -100,6 +107,7 @@ public partial interface ILogProfilesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs index 21825a24882c..4a23a8b6470d 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs @@ -1,16 +1,19 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; /// /// Composite Swagger for Monitor Management Client @@ -25,17 +28,17 @@ public partial interface IMonitorManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - Microsoft.Rest.ServiceClientCredentials Credentials { get; } + ServiceClientCredentials Credentials { get; } /// /// The Azure subscription Id. @@ -87,3 +90,4 @@ public partial interface IMonitorManagementClient : System.IDisposable } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs index 864608358b26..2f2ea8a94db8 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ServiceDiagnosticSettingsOperations operations. @@ -37,7 +44,7 @@ public partial interface IServiceDiagnosticSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceUri, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update new diagnostic settings for the specified /// resource. @@ -63,6 +70,7 @@ public partial interface IServiceDiagnosticSettingsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs index ae547b19fb2d..2da86d45fa5d 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// LogProfilesOperations operations. /// - internal partial class LogProfilesOperations : Microsoft.Rest.IServiceOperations, ILogProfilesOperations + internal partial class LogProfilesOperations : IServiceOperations, ILogProfilesOperations { /// /// Initializes a new instance of the LogProfilesOperations class. @@ -29,11 +38,11 @@ internal partial class LogProfilesOperations : Microsoft.Rest.IServiceOperations /// internal LogProfilesOperations(MonitorManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -53,44 +62,47 @@ internal LogProfilesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string logProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (logProfileName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "logProfileName"); + throw new ValidationException(ValidationRules.CannotBeNull, "logProfileName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("logProfileName", logProfileName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -100,23 +112,25 @@ internal LogProfilesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -132,43 +146,43 @@ internal LogProfilesOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); if (_httpResponse.Content != null) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); } else { _responseContent = string.Empty; } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -178,7 +192,7 @@ internal LogProfilesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -187,7 +201,7 @@ internal LogProfilesOperations(MonitorManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -204,47 +218,50 @@ internal LogProfilesOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string logProfileName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string logProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (logProfileName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "logProfileName"); + throw new ValidationException(ValidationRules.CannotBeNull, "logProfileName"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("logProfileName", logProfileName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -254,23 +271,25 @@ internal LogProfilesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -286,51 +305,51 @@ internal LogProfilesOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -340,7 +359,7 @@ internal LogProfilesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -353,21 +372,21 @@ internal LogProfilesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -387,56 +406,59 @@ internal LogProfilesOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (logProfileName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "logProfileName"); + throw new ValidationException(ValidationRules.CannotBeNull, "logProfileName"); } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { parameters.Validate(); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("logProfileName", logProfileName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString(); _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -446,23 +468,25 @@ internal LogProfilesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -479,56 +503,56 @@ internal LogProfilesOperations(MonitorManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -538,7 +562,7 @@ internal LogProfilesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -551,21 +575,21 @@ internal LogProfilesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -579,41 +603,44 @@ internal LogProfilesOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -623,23 +650,25 @@ internal LogProfilesOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -655,51 +684,51 @@ internal LogProfilesOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -709,7 +738,7 @@ internal LogProfilesOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -722,24 +751,25 @@ internal LogProfilesOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs index 0582e546bb47..edac4837df2a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs @@ -1,16 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for LogProfilesOperations. @@ -28,7 +34,7 @@ public static partial class LogProfilesOperationsExtensions /// public static void Delete(this ILogProfilesOperations operations, string logProfileName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).DeleteAsync(logProfileName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(logProfileName).GetAwaiter().GetResult(); } /// @@ -43,7 +49,7 @@ public static void Delete(this ILogProfilesOperations operations, string logProf /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ILogProfilesOperations operations, string logProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this ILogProfilesOperations operations, string logProfileName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(logProfileName, null, cancellationToken).ConfigureAwait(false); } @@ -59,7 +65,7 @@ public static void Delete(this ILogProfilesOperations operations, string logProf /// public static LogProfileResource Get(this ILogProfilesOperations operations, string logProfileName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).GetAsync(logProfileName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(logProfileName).GetAwaiter().GetResult(); } /// @@ -74,7 +80,7 @@ public static LogProfileResource Get(this ILogProfilesOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ILogProfilesOperations operations, string logProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this ILogProfilesOperations operations, string logProfileName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(logProfileName, null, cancellationToken).ConfigureAwait(false)) { @@ -96,7 +102,7 @@ public static LogProfileResource Get(this ILogProfilesOperations operations, str /// public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).CreateOrUpdateAsync(logProfileName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(logProfileName, parameters).GetAwaiter().GetResult(); } /// @@ -114,7 +120,7 @@ public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(logProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -128,9 +134,9 @@ public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations oper /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this ILogProfilesOperations operations) + public static IEnumerable List(this ILogProfilesOperations operations) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync().GetAwaiter().GetResult(); } /// @@ -142,7 +148,7 @@ public static System.Collections.Generic.IEnumerable List(th /// /// The cancellation token. /// - public static async Task> ListAsync(this ILogProfilesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ILogProfilesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -152,3 +158,4 @@ public static System.Collections.Generic.IEnumerable List(th } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs index b2f354a862e5..ba2980372e02 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AlertRuleResource.cs @@ -1,19 +1,27 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// The alert rule resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class AlertRuleResource : Resource { /// @@ -42,7 +50,7 @@ public AlertRuleResource() { } /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public AlertRuleResource(string location, string alertRuleResourceName, bool isEnabled, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string description = default(string), RuleCondition condition = default(RuleCondition), System.Collections.Generic.IList actions = default(System.Collections.Generic.IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + public AlertRuleResource(string location, string alertRuleResourceName, bool isEnabled, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), RuleCondition condition = default(RuleCondition), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) : base(location, id, name, type, tags) { AlertRuleResourceName = alertRuleResourceName; @@ -56,47 +64,47 @@ public AlertRuleResource() { } /// /// Gets or sets the name of the alert rule. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + [JsonProperty(PropertyName = "properties.name")] public string AlertRuleResourceName { get; set; } /// /// Gets or sets the description of the alert rule that will be /// included in the alert email. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.description")] + [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } /// /// Gets or sets the flag that indicates whether the alert rule is /// enabled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.isEnabled")] + [JsonProperty(PropertyName = "properties.isEnabled")] public bool IsEnabled { get; set; } /// /// Gets or sets the condition that results in the alert rule being /// activated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.condition")] + [JsonProperty(PropertyName = "properties.condition")] public RuleCondition Condition { get; set; } /// /// Gets or sets the array of actions that are performed when the alert /// rule becomes active, and when an alert condition is resolved. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.actions")] - public System.Collections.Generic.IList Actions { get; set; } + [JsonProperty(PropertyName = "properties.actions")] + public IList Actions { get; set; } /// /// Gets last time the rule was updated in ISO8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastUpdatedTime")] - public System.DateTime? LastUpdatedTime { get; private set; } + [JsonProperty(PropertyName = "properties.lastUpdatedTime")] + public System.DateTime? LastUpdatedTime { get; protected set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() @@ -104,8 +112,9 @@ public override void Validate() base.Validate(); if (AlertRuleResourceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AlertRuleResourceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "AlertRuleResourceName"); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs index 63d0e1754530..80dc3d6ae54c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleNotification.cs @@ -1,13 +1,19 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -26,7 +32,7 @@ public AutoscaleNotification() { } /// the email notification. /// the collection of webhook /// notifications. - public AutoscaleNotification(EmailNotification email = default(EmailNotification), System.Collections.Generic.IList webhooks = default(System.Collections.Generic.IList)) + public AutoscaleNotification(EmailNotification email = default(EmailNotification), IList webhooks = default(IList)) { Email = email; Webhooks = webhooks; @@ -42,21 +48,22 @@ static AutoscaleNotification() /// /// Gets or sets the email notification. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "email")] + [JsonProperty(PropertyName = "email")] public EmailNotification Email { get; set; } /// /// Gets or sets the collection of webhook notifications. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "webhooks")] - public System.Collections.Generic.IList Webhooks { get; set; } + [JsonProperty(PropertyName = "webhooks")] + public IList Webhooks { get; set; } /// /// the operation associated with the notification and its value must /// be "scale" /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + [JsonProperty(PropertyName = "operation")] public static string Operation { get; private set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs index d84a0f6358d1..290e6401c8a3 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleProfile.cs @@ -1,13 +1,20 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -34,7 +41,7 @@ public AutoscaleProfile() { } /// the repeating times at which this profile /// begins. This element is not used if the FixedDate element is /// used. - public AutoscaleProfile(string name, ScaleCapacity capacity, System.Collections.Generic.IList rules, TimeWindow fixedDate = default(TimeWindow), Recurrence recurrence = default(Recurrence)) + public AutoscaleProfile(string name, ScaleCapacity capacity, IList rules, TimeWindow fixedDate = default(TimeWindow), Recurrence recurrence = default(Recurrence)) { Name = name; Capacity = capacity; @@ -46,14 +53,14 @@ public AutoscaleProfile() { } /// /// Gets or sets the name of the profile. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets or sets the number of instances that can be used during this /// profile. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "capacity")] + [JsonProperty(PropertyName = "capacity")] public ScaleCapacity Capacity { get; set; } /// @@ -61,50 +68,50 @@ public AutoscaleProfile() { } /// parameters for the scaling action. A maximum of 10 rules can be /// specified. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "rules")] - public System.Collections.Generic.IList Rules { get; set; } + [JsonProperty(PropertyName = "rules")] + public IList Rules { get; set; } /// /// Gets or sets the specific date-time for the profile. This element /// is not used if the Recurrence element is used. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fixedDate")] + [JsonProperty(PropertyName = "fixedDate")] public TimeWindow FixedDate { get; set; } /// /// Gets or sets the repeating times at which this profile begins. This /// element is not used if the FixedDate element is used. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "recurrence")] + [JsonProperty(PropertyName = "recurrence")] public Recurrence Recurrence { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } if (Capacity == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Capacity"); + throw new ValidationException(ValidationRules.CannotBeNull, "Capacity"); } if (Rules == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Rules"); + throw new ValidationException(ValidationRules.CannotBeNull, "Rules"); } - if (this.Capacity != null) + if (Capacity != null) { - this.Capacity.Validate(); + Capacity.Validate(); } - if (this.Rules != null) + if (Rules != null) { - foreach (var element in this.Rules) + foreach (var element in Rules) { if (element != null) { @@ -112,14 +119,15 @@ public virtual void Validate() } } } - if (this.FixedDate != null) + if (FixedDate != null) { - this.FixedDate.Validate(); + FixedDate.Validate(); } - if (this.Recurrence != null) + if (Recurrence != null) { - this.Recurrence.Validate(); + Recurrence.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs index 8b8be9eb35e0..895823b4f43b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResource.cs @@ -1,19 +1,27 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// The autoscale setting resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class AutoscaleSettingResource : Resource { /// @@ -41,7 +49,7 @@ public AutoscaleSettingResource() { } /// 'true'. /// the resource identifier of the /// resource that the autoscale setting should be added to. - public AutoscaleSettingResource(string location, System.Collections.Generic.IList profiles, string autoscaleSettingResourceName, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList notifications = default(System.Collections.Generic.IList), bool? enabled = default(bool?), string targetResourceUri = default(string)) + public AutoscaleSettingResource(string location, IList profiles, string autoscaleSettingResourceName, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList notifications = default(IList), bool? enabled = default(bool?), string targetResourceUri = default(string)) : base(location, id, name, type, tags) { Profiles = profiles; @@ -56,39 +64,39 @@ public AutoscaleSettingResource() { } /// specify different scaling parameters for different time periods. A /// maximum of 20 profiles can be specified. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.profiles")] - public System.Collections.Generic.IList Profiles { get; set; } + [JsonProperty(PropertyName = "properties.profiles")] + public IList Profiles { get; set; } /// /// Gets or sets the collection of notifications. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.notifications")] - public System.Collections.Generic.IList Notifications { get; set; } + [JsonProperty(PropertyName = "properties.notifications")] + public IList Notifications { get; set; } /// /// Gets or sets the enabled flag. Specifies whether automatic scaling /// is enabled for the resource. The default value is 'true'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + [JsonProperty(PropertyName = "properties.enabled")] public bool? Enabled { get; set; } /// /// Gets or sets the name of the autoscale setting. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.name")] + [JsonProperty(PropertyName = "properties.name")] public string AutoscaleSettingResourceName { get; set; } /// /// Gets or sets the resource identifier of the resource that the /// autoscale setting should be added to. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.targetResourceUri")] + [JsonProperty(PropertyName = "properties.targetResourceUri")] public string TargetResourceUri { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() @@ -96,19 +104,19 @@ public override void Validate() base.Validate(); if (Profiles == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Profiles"); + throw new ValidationException(ValidationRules.CannotBeNull, "Profiles"); } if (AutoscaleSettingResourceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "AutoscaleSettingResourceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "AutoscaleSettingResourceName"); } - if (this.Profiles != null) + if (Profiles != null) { - if (this.Profiles.Count > 20) + if (Profiles.Count > 20) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxItems, "Profiles", 20); + throw new ValidationException(ValidationRules.MaxItems, "Profiles", 20); } - foreach (var element in this.Profiles) + foreach (var element in Profiles) { if (element != null) { @@ -119,3 +127,4 @@ public override void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs index 3506b4f380a5..e17824352841 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ComparisonOperationType.cs @@ -1,31 +1,39 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ComparisonOperationType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ComparisonOperationType { - [System.Runtime.Serialization.EnumMember(Value = "Equals")] + [EnumMember(Value = "Equals")] Equals, - [System.Runtime.Serialization.EnumMember(Value = "NotEquals")] + [EnumMember(Value = "NotEquals")] NotEquals, - [System.Runtime.Serialization.EnumMember(Value = "GreaterThan")] + [EnumMember(Value = "GreaterThan")] GreaterThan, - [System.Runtime.Serialization.EnumMember(Value = "GreaterThanOrEqual")] + [EnumMember(Value = "GreaterThanOrEqual")] GreaterThanOrEqual, - [System.Runtime.Serialization.EnumMember(Value = "LessThan")] + [EnumMember(Value = "LessThan")] LessThan, - [System.Runtime.Serialization.EnumMember(Value = "LessThanOrEqual")] + [EnumMember(Value = "LessThanOrEqual")] LessThanOrEqual } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs index 9c6ca37a10f6..a7bc85c2fb35 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ConditionOperator.cs @@ -1,27 +1,35 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ConditionOperator. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ConditionOperator { - [System.Runtime.Serialization.EnumMember(Value = "GreaterThan")] + [EnumMember(Value = "GreaterThan")] GreaterThan, - [System.Runtime.Serialization.EnumMember(Value = "GreaterThanOrEqual")] + [EnumMember(Value = "GreaterThanOrEqual")] GreaterThanOrEqual, - [System.Runtime.Serialization.EnumMember(Value = "LessThan")] + [EnumMember(Value = "LessThan")] LessThan, - [System.Runtime.Serialization.EnumMember(Value = "LessThanOrEqual")] + [EnumMember(Value = "LessThanOrEqual")] LessThanOrEqual } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs index a8fa1f179313..4f0a654d27e6 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/EmailNotification.cs @@ -1,13 +1,19 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -30,7 +36,7 @@ public EmailNotification() { } /// the custom e-mails list. This value can /// be null or empty, in which case this attribute will be /// ignored. - public EmailNotification(bool? sendToSubscriptionAdministrator = default(bool?), bool? sendToSubscriptionCoAdministrators = default(bool?), System.Collections.Generic.IList customEmails = default(System.Collections.Generic.IList)) + public EmailNotification(bool? sendToSubscriptionAdministrator = default(bool?), bool? sendToSubscriptionCoAdministrators = default(bool?), IList customEmails = default(IList)) { SendToSubscriptionAdministrator = sendToSubscriptionAdministrator; SendToSubscriptionCoAdministrators = sendToSubscriptionCoAdministrators; @@ -41,22 +47,23 @@ public EmailNotification() { } /// Gets or sets a value indicating whether to send email to /// subscription administrator. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sendToSubscriptionAdministrator")] + [JsonProperty(PropertyName = "sendToSubscriptionAdministrator")] public bool? SendToSubscriptionAdministrator { get; set; } /// /// Gets or sets a value indicating whether to send email to /// subscription co-administrators. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sendToSubscriptionCoAdministrators")] + [JsonProperty(PropertyName = "sendToSubscriptionCoAdministrators")] public bool? SendToSubscriptionCoAdministrators { get; set; } /// /// Gets or sets the custom e-mails list. This value can be null or /// empty, in which case this attribute will be ignored. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "customEmails")] - public System.Collections.Generic.IList CustomEmails { get; set; } + [JsonProperty(PropertyName = "customEmails")] + public IList CustomEmails { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs index eefbe85edb73..97526c845b46 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Incident.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -45,35 +49,36 @@ public Incident() { } /// /// Gets incident name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [JsonProperty(PropertyName = "name")] + public string Name { get; protected set; } /// /// Gets rule name that is associated with the incident. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "ruleName")] - public string RuleName { get; private set; } + [JsonProperty(PropertyName = "ruleName")] + public string RuleName { get; protected set; } /// /// Gets a boolean to indicate whether the incident is active or /// resolved. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "isActive")] - public bool? IsActive { get; private set; } + [JsonProperty(PropertyName = "isActive")] + public bool? IsActive { get; protected set; } /// /// Gets the time at which the incident was activated in ISO8601 /// format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "activatedTime")] - public System.DateTime? ActivatedTime { get; private set; } + [JsonProperty(PropertyName = "activatedTime")] + public System.DateTime? ActivatedTime { get; protected set; } /// /// Gets the time at which the incident was resolved in ISO8601 format. /// If null, it means the incident is still active. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resolvedTime")] - public System.DateTime? ResolvedTime { get; private set; } + [JsonProperty(PropertyName = "resolvedTime")] + public System.DateTime? ResolvedTime { get; protected set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs index 9d55a40f575c..5b38ca43a49a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs @@ -1,19 +1,23 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// /// A rule condition based on a certain number of locations failing. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition")] + [JsonObject("Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition")] public partial class LocationThresholdRuleCondition : RuleCondition { /// @@ -47,7 +51,7 @@ public LocationThresholdRuleCondition() { } /// For this type dataSource will always be of type /// RuleMetricDataSource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] + [JsonProperty(PropertyName = "dataSource")] public RuleDataSource DataSource { get; set; } /// @@ -55,20 +59,20 @@ public LocationThresholdRuleCondition() { } /// is used to monitor alert activity based on the threshold. If /// specified then it must be between 5 minutes and 1 day. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "windowSize")] + [JsonProperty(PropertyName = "windowSize")] public System.TimeSpan? WindowSize { get; set; } /// /// Gets or sets the number of locations that must fail to activate the /// alert. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "failedLocationCount")] + [JsonProperty(PropertyName = "failedLocationCount")] public int FailedLocationCount { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -76,3 +80,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs index 0ebeb90cb615..e79fdbb82203 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogProfileResource.cs @@ -1,19 +1,27 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// The log profile resource. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class LogProfileResource : Resource { /// @@ -44,7 +52,7 @@ public LogProfileResource() { } /// are: 'Write', 'Delete', and/or 'Action.' /// the retention policy for the events /// in the log. - public LogProfileResource(string location, System.Collections.Generic.IList locations, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList categories = default(System.Collections.Generic.IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + public LogProfileResource(string location, IList locations, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), IList categories = default(IList), RetentionPolicy retentionPolicy = default(RetentionPolicy)) : base(location, id, name, type, tags) { StorageAccountId = storageAccountId; @@ -58,7 +66,7 @@ public LogProfileResource() { } /// Gets or sets the resource id of the storage account to which you /// would like to send the Activity Log. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] + [JsonProperty(PropertyName = "properties.storageAccountId")] public string StorageAccountId { get; set; } /// @@ -67,7 +75,7 @@ public LogProfileResource() { } /// the Activity Log. The rule ID is of the format: '{service bus /// resource ID}/authorizationrules/{key name}'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] + [JsonProperty(PropertyName = "properties.serviceBusRuleId")] public string ServiceBusRuleId { get; set; } /// @@ -75,27 +83,27 @@ public LogProfileResource() { } /// be stored or streamed. It is a comma separated list of valid ARM /// locations including the 'global' location. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.locations")] - public System.Collections.Generic.IList Locations { get; set; } + [JsonProperty(PropertyName = "properties.locations")] + public IList Locations { get; set; } /// /// Gets or sets the categories of the logs. These categories are /// created as is convenient to the user. Some values are: 'Write', /// 'Delete', and/or 'Action.' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.categories")] - public System.Collections.Generic.IList Categories { get; set; } + [JsonProperty(PropertyName = "properties.categories")] + public IList Categories { get; set; } /// /// Gets or sets the retention policy for the events in the log. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.retentionPolicy")] + [JsonProperty(PropertyName = "properties.retentionPolicy")] public RetentionPolicy RetentionPolicy { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() @@ -103,12 +111,13 @@ public override void Validate() base.Validate(); if (Locations == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Locations"); + throw new ValidationException(ValidationRules.CannotBeNull, "Locations"); } - if (this.RetentionPolicy != null) + if (RetentionPolicy != null) { - this.RetentionPolicy.Validate(); + RetentionPolicy.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs index 38e10d17dc59..31241636572b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/LogSettings.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -45,33 +49,34 @@ public LogSettings() { } /// categories for a resource, first perform a GET diagnostic settings /// operation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + [JsonProperty(PropertyName = "category")] public string Category { get; set; } /// /// Gets or sets a value indicating whether this log is enabled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + [JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } /// /// Gets or sets the retention policy for this log. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] + [JsonProperty(PropertyName = "retentionPolicy")] public RetentionPolicy RetentionPolicy { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.RetentionPolicy != null) + if (RetentionPolicy != null) { - this.RetentionPolicy.Validate(); + RetentionPolicy.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs index 1708cdc91ac5..8a4d6c588e4f 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventAggregationCondition.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -45,13 +49,13 @@ public ManagementEventAggregationCondition() { } /// Gets or sets the condition operator. Possible values include: /// 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + [JsonProperty(PropertyName = "operator")] public ConditionOperator? OperatorProperty { get; set; } /// /// Gets or sets the threshold value that activates the alert. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + [JsonProperty(PropertyName = "threshold")] public double? Threshold { get; set; } /// @@ -59,8 +63,9 @@ public ManagementEventAggregationCondition() { } /// is used to monitor alert activity based on the threshold. If /// specified then it must be between 5 minutes and 1 day. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "windowSize")] + [JsonProperty(PropertyName = "windowSize")] public System.TimeSpan? WindowSize { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs index 1b21c7b6001f..eaf733f24ee2 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ManagementEventRuleCondition.cs @@ -1,19 +1,23 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// /// A management event rule condition. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition")] + [JsonObject("Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition")] public partial class ManagementEventRuleCondition : RuleCondition { /// @@ -44,7 +48,7 @@ public ManagementEventRuleCondition() { } /// For this type dataSource will always be of type /// RuleManagementEventDataSource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] + [JsonProperty(PropertyName = "dataSource")] public RuleDataSource DataSource { get; set; } /// @@ -53,8 +57,9 @@ public ManagementEventRuleCondition() { } /// event alerts aggregation is optional – if it is not provided then /// any event will cause the alert to activate. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "aggregation")] + [JsonProperty(PropertyName = "aggregation")] public ManagementEventAggregationCondition Aggregation { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs index b52b101be9ba..f982d32d96eb 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricSettings.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -40,33 +44,34 @@ public MetricSettings() { } /// /// Gets or sets the timegrain of the metric in ISO8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] + [JsonProperty(PropertyName = "timeGrain")] public System.TimeSpan TimeGrain { get; set; } /// /// Gets or sets a value indicating whether this timegrain is enabled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + [JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } /// /// Gets or sets the retention policy for this timegrain. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retentionPolicy")] + [JsonProperty(PropertyName = "retentionPolicy")] public RetentionPolicy RetentionPolicy { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.RetentionPolicy != null) + if (RetentionPolicy != null) { - this.RetentionPolicy.Validate(); + RetentionPolicy.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs index 5baf73f84408..e1760086d290 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricStatisticType.cs @@ -1,27 +1,35 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for MetricStatisticType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum MetricStatisticType { - [System.Runtime.Serialization.EnumMember(Value = "Average")] + [EnumMember(Value = "Average")] Average, - [System.Runtime.Serialization.EnumMember(Value = "Min")] + [EnumMember(Value = "Min")] Min, - [System.Runtime.Serialization.EnumMember(Value = "Max")] + [EnumMember(Value = "Max")] Max, - [System.Runtime.Serialization.EnumMember(Value = "Sum")] + [EnumMember(Value = "Sum")] Sum } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs index db22ded56f7a..076d55c77e2a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/MetricTrigger.cs @@ -1,13 +1,18 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -64,14 +69,14 @@ public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpa /// Gets or sets the name of the metric that defines what the rule /// monitors. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metricName")] + [JsonProperty(PropertyName = "metricName")] public string MetricName { get; set; } /// /// Gets or sets the resource identifier of the resource the rule /// monitors. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metricResourceUri")] + [JsonProperty(PropertyName = "metricResourceUri")] public string MetricResourceUri { get; set; } /// @@ -79,7 +84,7 @@ public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpa /// one of the predefined values returned from metric definitions for /// the metric. Must be between 12 hours and 1 minute. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] + [JsonProperty(PropertyName = "timeGrain")] public System.TimeSpan TimeGrain { get; set; } /// @@ -87,7 +92,7 @@ public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpa /// multiple instances are combined. Possible values include: /// 'Average', 'Min', 'Max', 'Sum' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "statistic")] + [JsonProperty(PropertyName = "statistic")] public MetricStatisticType Statistic { get; set; } /// @@ -96,7 +101,7 @@ public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpa /// which can vary from resource-to-resource. Must be between 12 hours /// and 5 minutes. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeWindow")] + [JsonProperty(PropertyName = "timeWindow")] public System.TimeSpan TimeWindow { get; set; } /// @@ -105,7 +110,7 @@ public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpa /// Possible values include: 'Average', 'Minimum', 'Maximum', 'Total', /// 'Count' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeAggregation")] + [JsonProperty(PropertyName = "timeAggregation")] public TimeAggregationType TimeAggregation { get; set; } /// @@ -113,32 +118,33 @@ public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpa /// and the threshold. Possible values include: 'Equals', 'NotEquals', /// 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + [JsonProperty(PropertyName = "operator")] public ComparisonOperationType OperatorProperty { get; set; } /// /// Gets or sets the threshold of the metric that triggers the scale /// action. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + [JsonProperty(PropertyName = "threshold")] public double Threshold { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (MetricName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricName"); + throw new ValidationException(ValidationRules.CannotBeNull, "MetricName"); } if (MetricResourceUri == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricResourceUri"); + throw new ValidationException(ValidationRules.CannotBeNull, "MetricResourceUri"); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs index d517340cdb2a..7359bf2bda8f 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page.cs @@ -1,46 +1,55 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("nextLink")] - public System.String NextPageLink { get; private set; } + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } + [JsonProperty("value")] + private IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs index 69676959c407..8acf4450aa49 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Page1.cs @@ -1,46 +1,55 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page1 : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page1 : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("")] - public System.String NextPageLink { get; private set; } + [JsonProperty("")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } + [JsonProperty("value")] + private IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs index 51c2b1dc84f8..aec3b3fa5a5c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Recurrence.cs @@ -1,13 +1,18 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -43,32 +48,33 @@ public Recurrence(RecurrenceFrequency frequency, RecurrentSchedule schedule) /// week will have the same set of profiles. Possible values include: /// 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "frequency")] + [JsonProperty(PropertyName = "frequency")] public RecurrenceFrequency Frequency { get; set; } /// /// Gets or sets the scheduling constraints for when the profile /// begins. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] + [JsonProperty(PropertyName = "schedule")] public RecurrentSchedule Schedule { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Schedule == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Schedule"); + throw new ValidationException(ValidationRules.CannotBeNull, "Schedule"); } - if (this.Schedule != null) + if (Schedule != null) { - this.Schedule.Validate(); + Schedule.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs index 81137fd8db6a..853f03cdba7a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrenceFrequency.cs @@ -1,35 +1,43 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for RecurrenceFrequency. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum RecurrenceFrequency { - [System.Runtime.Serialization.EnumMember(Value = "None")] + [EnumMember(Value = "None")] None, - [System.Runtime.Serialization.EnumMember(Value = "Second")] + [EnumMember(Value = "Second")] Second, - [System.Runtime.Serialization.EnumMember(Value = "Minute")] + [EnumMember(Value = "Minute")] Minute, - [System.Runtime.Serialization.EnumMember(Value = "Hour")] + [EnumMember(Value = "Hour")] Hour, - [System.Runtime.Serialization.EnumMember(Value = "Day")] + [EnumMember(Value = "Day")] Day, - [System.Runtime.Serialization.EnumMember(Value = "Week")] + [EnumMember(Value = "Week")] Week, - [System.Runtime.Serialization.EnumMember(Value = "Month")] + [EnumMember(Value = "Month")] Month, - [System.Runtime.Serialization.EnumMember(Value = "Year")] + [EnumMember(Value = "Year")] Year } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs index 4f90a5a2b31f..3da515765abf 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RecurrentSchedule.cs @@ -1,13 +1,20 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -73,7 +80,7 @@ public RecurrentSchedule() { } /// times are not supported). /// A collection of minutes at which the profile /// takes effect at. - public RecurrentSchedule(string timeZone, System.Collections.Generic.IList days, System.Collections.Generic.IList hours, System.Collections.Generic.IList minutes) + public RecurrentSchedule(string timeZone, IList days, IList hours, IList minutes) { TimeZone = timeZone; Days = days; @@ -125,55 +132,56 @@ public RecurrentSchedule(string timeZone, System.Collections.Generic.IList - [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] + [JsonProperty(PropertyName = "timeZone")] public string TimeZone { get; set; } /// /// Gets or sets the collection of days that the profile takes effect /// on. Possible values are Sunday through Saturday. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "days")] - public System.Collections.Generic.IList Days { get; set; } + [JsonProperty(PropertyName = "days")] + public IList Days { get; set; } /// /// Gets or sets a collection of hours that the profile takes effect /// on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times /// are not supported). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "hours")] - public System.Collections.Generic.IList Hours { get; set; } + [JsonProperty(PropertyName = "hours")] + public IList Hours { get; set; } /// /// Gets or sets a collection of minutes at which the profile takes /// effect at. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minutes")] - public System.Collections.Generic.IList Minutes { get; set; } + [JsonProperty(PropertyName = "minutes")] + public IList Minutes { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (TimeZone == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "TimeZone"); + throw new ValidationException(ValidationRules.CannotBeNull, "TimeZone"); } if (Days == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Days"); + throw new ValidationException(ValidationRules.CannotBeNull, "Days"); } if (Hours == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Hours"); + throw new ValidationException(ValidationRules.CannotBeNull, "Hours"); } if (Minutes == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Minutes"); + throw new ValidationException(ValidationRules.CannotBeNull, "Minutes"); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs index 1844e6ddbda3..bf37d7c3a44c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/Resource.cs @@ -1,19 +1,27 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// An azure resource object /// - public partial class Resource : Microsoft.Rest.Azure.IResource + public partial class Resource : IResource { /// /// Initializes a new instance of the Resource class. @@ -28,7 +36,7 @@ public Resource() { } /// Azure resource name /// Azure resource type /// Resource tags - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) { Id = id; Name = name; @@ -40,45 +48,46 @@ public Resource() { } /// /// Gets azure resource Id /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } /// /// Gets or sets azure resource name /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Gets azure resource type /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; protected set; } /// /// Gets or sets resource location /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// /// Gets or sets resource tags /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs index cc010ea24097..b5299f6e555a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RetentionPolicy.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -37,20 +41,20 @@ public RetentionPolicy(bool enabled, int days) /// Gets or sets a value indicating whether the retention policy is /// enabled. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + [JsonProperty(PropertyName = "enabled")] public bool Enabled { get; set; } /// /// Gets or sets the number of days for the retention in days. A value /// of 0 will retain the events indefinitely. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "days")] + [JsonProperty(PropertyName = "days")] public int Days { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -59,3 +63,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs index 34e5df7ea29d..bc86a7e139af 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleAction.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; using System.Linq; /// @@ -24,3 +27,4 @@ public RuleAction() { } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs index fd25240b7bab..9d07ded9842b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleCondition.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; using System.Linq; /// @@ -23,3 +26,4 @@ public RuleCondition() { } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs index 3ff121627a2a..910f19cafbbe 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleDataSource.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; using System.Linq; /// @@ -23,3 +26,4 @@ public RuleDataSource() { } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs index 618f41b22a95..0266167f566a 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleEmailAction.cs @@ -1,20 +1,26 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Specifies the action to send email when the rule condition is /// evaluated. The discriminator is always RuleEmailAction in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleEmailAction")] + [JsonObject("Microsoft.Azure.Management.Insights.Models.RuleEmailAction")] public partial class RuleEmailAction : RuleAction { /// @@ -30,7 +36,7 @@ public RuleEmailAction() { } /// when the alert is activated. /// the list of administrator's custom email /// addresses notifiy of the activation of the alert. - public RuleEmailAction(bool? sendToServiceOwners = default(bool?), System.Collections.Generic.IList customEmails = default(System.Collections.Generic.IList)) + public RuleEmailAction(bool? sendToServiceOwners = default(bool?), IList customEmails = default(IList)) { SendToServiceOwners = sendToServiceOwners; CustomEmails = customEmails; @@ -41,15 +47,16 @@ public RuleEmailAction() { } /// co-adiminstrators) of the service should be notified when the alert /// is activated. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sendToServiceOwners")] + [JsonProperty(PropertyName = "sendToServiceOwners")] public bool? SendToServiceOwners { get; set; } /// /// Gets or sets the list of administrator's custom email addresses /// notifiy of the activation of the alert. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "customEmails")] - public System.Collections.Generic.IList CustomEmails { get; set; } + [JsonProperty(PropertyName = "customEmails")] + public IList CustomEmails { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs index 7e2acff3deb6..80e1cdc90b1c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventClaimsDataSource.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -34,8 +38,9 @@ public RuleManagementEventClaimsDataSource() { } /// /// Gets or sets the email address. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "emailAddress")] + [JsonProperty(PropertyName = "emailAddress")] public string EmailAddress { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs index 2f4cab87a8be..5b5d17eb6ad4 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleManagementEventDataSource.cs @@ -1,20 +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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// /// A rule management event data source. The discriminator fields is always /// RuleManagementEventDataSource in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource")] + [JsonObject("Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource")] public partial class RuleManagementEventDataSource : RuleDataSource { /// @@ -59,64 +63,65 @@ public RuleManagementEventDataSource() { } /// /// Gets or sets the event name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] + [JsonProperty(PropertyName = "eventName")] public string EventName { get; set; } /// /// Gets or sets the event source. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eventSource")] + [JsonProperty(PropertyName = "eventSource")] public string EventSource { get; set; } /// /// Gets or sets the level. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "level")] + [JsonProperty(PropertyName = "level")] public string Level { get; set; } /// /// Gets or sets the name of the operation that should be checked for. /// If no name is provided, any operation will match. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operationName")] + [JsonProperty(PropertyName = "operationName")] public string OperationName { get; set; } /// /// Gets or sets the resource group name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroupName")] + [JsonProperty(PropertyName = "resourceGroupName")] public string ResourceGroupName { get; set; } /// /// Gets or sets the resource provider name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceProviderName")] + [JsonProperty(PropertyName = "resourceProviderName")] public string ResourceProviderName { get; set; } /// /// Gets or sets the resource uri. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceUri")] + [JsonProperty(PropertyName = "resourceUri")] public string ResourceUri { get; set; } /// /// Gets or sets the status of the operation that should be checked /// for. If no status is provided, any status will match. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + [JsonProperty(PropertyName = "status")] public string Status { get; set; } /// /// Gets or sets the substatus. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "subStatus")] + [JsonProperty(PropertyName = "subStatus")] public string SubStatus { get; set; } /// /// Gets or sets the claims. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "claims")] + [JsonProperty(PropertyName = "claims")] public RuleManagementEventClaimsDataSource Claims { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs index 76ced5891bf5..a39fe93f2eb2 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleMetricDataSource.cs @@ -1,20 +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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// /// A rule metric data source. The discriminator value is always /// RuleMetricDataSource in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")] + [JsonObject("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource")] public partial class RuleMetricDataSource : RuleDataSource { /// @@ -39,15 +43,16 @@ public RuleMetricDataSource() { } /// Gets or sets the resource identifier of the resource the rule /// monitors. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceUri")] + [JsonProperty(PropertyName = "resourceUri")] public string ResourceUri { get; set; } /// /// Gets or sets the name of the metric that defines what the rule /// monitors. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metricName")] + [JsonProperty(PropertyName = "metricName")] public string MetricName { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs index f781bdef0b04..25946077eaab 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/RuleWebhookAction.cs @@ -1,20 +1,26 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Specifies the action to post to service when the rule condition is /// evaluated. The discriminator is always RuleWebhookAction in this case. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.RuleWebhookAction")] + [JsonObject("Microsoft.Azure.Management.Insights.Models.RuleWebhookAction")] public partial class RuleWebhookAction : RuleAction { /// @@ -30,7 +36,7 @@ public RuleWebhookAction() { } /// the dictionary of custom properties to /// include with the post operation. These data are appended to the /// webhook payload. - public RuleWebhookAction(string serviceUri = default(string), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary)) + public RuleWebhookAction(string serviceUri = default(string), IDictionary properties = default(IDictionary)) { ServiceUri = serviceUri; Properties = properties; @@ -40,15 +46,16 @@ public RuleWebhookAction() { } /// Gets or sets the service uri to Post the notitication when the /// alert activates or resolves. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "serviceUri")] + [JsonProperty(PropertyName = "serviceUri")] public string ServiceUri { get; set; } /// /// Gets or sets the dictionary of custom properties to include with /// the post operation. These data are appended to the webhook payload. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public System.Collections.Generic.IDictionary Properties { get; set; } + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs index e7894a6c3d86..0264186e0dcc 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleAction.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -48,7 +52,7 @@ public ScaleAction() { } /// increases or decreases the number of instances. Possible values /// include: 'None', 'Increase', 'Decrease' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "direction")] + [JsonProperty(PropertyName = "direction")] public ScaleDirection Direction { get; set; } /// @@ -56,7 +60,7 @@ public ScaleAction() { } /// rule fires. Possible values include: 'ChangeCount', /// 'PercentChangeCount', 'ExactCount' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + [JsonProperty(PropertyName = "type")] public ScaleType Type { get; set; } /// @@ -64,7 +68,7 @@ public ScaleAction() { } /// scaling action. This value must be 1 or greater. The default value /// is 1. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// @@ -72,13 +76,13 @@ public ScaleAction() { } /// action before this action occurs. It must be between 1 week and 1 /// minute in ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "cooldown")] + [JsonProperty(PropertyName = "cooldown")] public System.TimeSpan Cooldown { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -86,3 +90,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs index 95b5dbce0dbe..9414ce4f8e13 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleCapacity.cs @@ -1,13 +1,18 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -42,7 +47,7 @@ public ScaleCapacity(string minimum, string maximum, string defaultProperty) /// /// Gets or sets the minimum number of instances for the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minimum")] + [JsonProperty(PropertyName = "minimum")] public string Minimum { get; set; } /// @@ -50,7 +55,7 @@ public ScaleCapacity(string minimum, string maximum, string defaultProperty) /// actual maximum number of instances is limited by the cores that are /// available in the subscription. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maximum")] + [JsonProperty(PropertyName = "maximum")] public string Maximum { get; set; } /// @@ -58,29 +63,30 @@ public ScaleCapacity(string minimum, string maximum, string defaultProperty) /// are not available for evaluation. The default is only used if the /// current instance count is lower than the default. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "default")] + [JsonProperty(PropertyName = "default")] public string DefaultProperty { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Minimum == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Minimum"); + throw new ValidationException(ValidationRules.CannotBeNull, "Minimum"); } if (Maximum == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Maximum"); + throw new ValidationException(ValidationRules.CannotBeNull, "Maximum"); } if (DefaultProperty == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DefaultProperty"); + throw new ValidationException(ValidationRules.CannotBeNull, "DefaultProperty"); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs index 9973ffedc81f..5649cdb8edba 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleDirection.cs @@ -1,25 +1,33 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ScaleDirection. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ScaleDirection { - [System.Runtime.Serialization.EnumMember(Value = "None")] + [EnumMember(Value = "None")] None, - [System.Runtime.Serialization.EnumMember(Value = "Increase")] + [EnumMember(Value = "Increase")] Increase, - [System.Runtime.Serialization.EnumMember(Value = "Decrease")] + [EnumMember(Value = "Decrease")] Decrease } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs index e495486a0a97..6df87d3458c3 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleRule.cs @@ -1,13 +1,18 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -36,39 +41,40 @@ public ScaleRule(MetricTrigger metricTrigger, ScaleAction scaleAction) /// /// Gets or sets the trigger that results in a scaling action. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metricTrigger")] + [JsonProperty(PropertyName = "metricTrigger")] public MetricTrigger MetricTrigger { get; set; } /// /// Gets or sets the parameters for the scaling action. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "scaleAction")] + [JsonProperty(PropertyName = "scaleAction")] public ScaleAction ScaleAction { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (MetricTrigger == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "MetricTrigger"); + throw new ValidationException(ValidationRules.CannotBeNull, "MetricTrigger"); } if (ScaleAction == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ScaleAction"); + throw new ValidationException(ValidationRules.CannotBeNull, "ScaleAction"); } - if (this.MetricTrigger != null) + if (MetricTrigger != null) { - this.MetricTrigger.Validate(); + MetricTrigger.Validate(); } - if (this.ScaleAction != null) + if (ScaleAction != null) { - this.ScaleAction.Validate(); + ScaleAction.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs index f890f163e600..ee09499eb6c9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ScaleType.cs @@ -1,25 +1,33 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ScaleType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum ScaleType { - [System.Runtime.Serialization.EnumMember(Value = "ChangeCount")] + [EnumMember(Value = "ChangeCount")] ChangeCount, - [System.Runtime.Serialization.EnumMember(Value = "PercentChangeCount")] + [EnumMember(Value = "PercentChangeCount")] PercentChangeCount, - [System.Runtime.Serialization.EnumMember(Value = "ExactCount")] + [EnumMember(Value = "ExactCount")] ExactCount } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs index f69b4b8391e4..4c89454bcb01 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResource.cs @@ -1,19 +1,27 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Description of a service diagnostic setting /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class ServiceDiagnosticSettingsResource : Resource { /// @@ -44,7 +52,7 @@ public ServiceDiagnosticSettingsResource() { } /// Analytics workspace) for a Log Analytics workspace to which you /// would like to send Diagnostic Logs. Example: /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 - public ServiceDiagnosticSettingsResource(string location, string id = default(string), string name = default(string), string type = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), System.Collections.Generic.IList metrics = default(System.Collections.Generic.IList), System.Collections.Generic.IList logs = default(System.Collections.Generic.IList), string workspaceId = default(string)) + public ServiceDiagnosticSettingsResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), IList metrics = default(IList), IList logs = default(IList), string workspaceId = default(string)) : base(location, id, name, type, tags) { StorageAccountId = storageAccountId; @@ -58,7 +66,7 @@ public ServiceDiagnosticSettingsResource() { } /// Gets or sets the resource ID of the storage account to which you /// would like to send Diagnostic Logs. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.storageAccountId")] + [JsonProperty(PropertyName = "properties.storageAccountId")] public string StorageAccountId { get; set; } /// @@ -67,20 +75,20 @@ public ServiceDiagnosticSettingsResource() { } /// Diagnostic Logs. The rule ID is of the format: '{service bus /// resource ID}/authorizationrules/{key name}'. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.serviceBusRuleId")] + [JsonProperty(PropertyName = "properties.serviceBusRuleId")] public string ServiceBusRuleId { get; set; } /// /// Gets or sets the list of metric settings. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.metrics")] - public System.Collections.Generic.IList Metrics { get; set; } + [JsonProperty(PropertyName = "properties.metrics")] + public IList Metrics { get; set; } /// /// Gets or sets the list of logs settings. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.logs")] - public System.Collections.Generic.IList Logs { get; set; } + [JsonProperty(PropertyName = "properties.logs")] + public IList Logs { get; set; } /// /// Gets or sets the workspace ID (resource ID of a Log Analytics @@ -88,21 +96,21 @@ public ServiceDiagnosticSettingsResource() { } /// send Diagnostic Logs. Example: /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.workspaceId")] + [JsonProperty(PropertyName = "properties.workspaceId")] public string WorkspaceId { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (this.Metrics != null) + if (Metrics != null) { - foreach (var element in this.Metrics) + foreach (var element in Metrics) { if (element != null) { @@ -110,9 +118,9 @@ public override void Validate() } } } - if (this.Logs != null) + if (Logs != null) { - foreach (var element1 in this.Logs) + foreach (var element1 in Logs) { if (element1 != null) { @@ -123,3 +131,4 @@ public override void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs index fcb1be4f4d06..830ab7d639f7 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/ThresholdRuleCondition.cs @@ -1,19 +1,23 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// /// A rule condition based on a metric crossing a threshold. /// - [Newtonsoft.Json.JsonObject("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")] + [JsonObject("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition")] public partial class ThresholdRuleCondition : RuleCondition { /// @@ -55,7 +59,7 @@ public ThresholdRuleCondition() { } /// For this type dataSource will always be of type /// RuleMetricDataSource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dataSource")] + [JsonProperty(PropertyName = "dataSource")] public RuleDataSource DataSource { get; set; } /// @@ -63,13 +67,13 @@ public ThresholdRuleCondition() { } /// threshold. Possible values include: 'GreaterThan', /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + [JsonProperty(PropertyName = "operator")] public ConditionOperator OperatorProperty { get; set; } /// /// Gets or sets the threshold value that activates the alert. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "threshold")] + [JsonProperty(PropertyName = "threshold")] public double Threshold { get; set; } /// @@ -77,7 +81,7 @@ public ThresholdRuleCondition() { } /// is used to monitor alert activity based on the threshold. If /// specified then it must be between 5 minutes and 1 day. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "windowSize")] + [JsonProperty(PropertyName = "windowSize")] public System.TimeSpan? WindowSize { get; set; } /// @@ -86,13 +90,13 @@ public ThresholdRuleCondition() { } /// PrimaryAggregationType of the Metric. Possible values include: /// 'Average', 'Minimum', 'Maximum', 'Total', 'Last' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeAggregation")] + [JsonProperty(PropertyName = "timeAggregation")] public TimeAggregationOperator? TimeAggregation { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -100,3 +104,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs index 4b09fee4ab69..73773a9f8430 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationOperator.cs @@ -1,29 +1,37 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for TimeAggregationOperator. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum TimeAggregationOperator { - [System.Runtime.Serialization.EnumMember(Value = "Average")] + [EnumMember(Value = "Average")] Average, - [System.Runtime.Serialization.EnumMember(Value = "Minimum")] + [EnumMember(Value = "Minimum")] Minimum, - [System.Runtime.Serialization.EnumMember(Value = "Maximum")] + [EnumMember(Value = "Maximum")] Maximum, - [System.Runtime.Serialization.EnumMember(Value = "Total")] + [EnumMember(Value = "Total")] Total, - [System.Runtime.Serialization.EnumMember(Value = "Last")] + [EnumMember(Value = "Last")] Last } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs index 25d280cab005..f2d7d76fcba9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeAggregationType.cs @@ -1,29 +1,37 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for TimeAggregationType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum TimeAggregationType { - [System.Runtime.Serialization.EnumMember(Value = "Average")] + [EnumMember(Value = "Average")] Average, - [System.Runtime.Serialization.EnumMember(Value = "Minimum")] + [EnumMember(Value = "Minimum")] Minimum, - [System.Runtime.Serialization.EnumMember(Value = "Maximum")] + [EnumMember(Value = "Maximum")] Maximum, - [System.Runtime.Serialization.EnumMember(Value = "Total")] + [EnumMember(Value = "Total")] Total, - [System.Runtime.Serialization.EnumMember(Value = "Count")] + [EnumMember(Value = "Count")] Count } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs index 900dd61616f2..d3c890881bb9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/TimeWindow.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -121,25 +125,25 @@ public TimeWindow() { } /// Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga /// Standard Time, Samoa Standard Time, Line Islands Standard Time /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] + [JsonProperty(PropertyName = "timeZone")] public string TimeZone { get; set; } /// /// Gets or sets the start time for the profile in ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "start")] + [JsonProperty(PropertyName = "start")] public System.DateTime Start { get; set; } /// /// Gets or sets the end time for the profile in ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "end")] + [JsonProperty(PropertyName = "end")] public System.DateTime End { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -148,3 +152,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs index f05ac63ec22b..4178d96f1b7b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/Models/WebhookNotification.cs @@ -1,13 +1,19 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights.Models { + using Azure; + using Management; + using Insights; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -27,7 +33,7 @@ public WebhookNotification() { } /// notification. /// a property bag of settings. This value can /// be empty. - public WebhookNotification(string serviceUri = default(string), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary)) + public WebhookNotification(string serviceUri = default(string), IDictionary properties = default(IDictionary)) { ServiceUri = serviceUri; Properties = properties; @@ -36,14 +42,15 @@ public WebhookNotification() { } /// /// Gets or sets the service address to receive the notification. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "serviceUri")] + [JsonProperty(PropertyName = "serviceUri")] public string ServiceUri { get; set; } /// /// Gets or sets a property bag of settings. This value can be empty. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public System.Collections.Generic.IDictionary Properties { get; set; } + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs index 5c081a38d66b..e503ced7e4ac 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs @@ -1,22 +1,30 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Serialization; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; /// /// Composite Swagger for Monitor Management Client /// - public partial class MonitorManagementClient : Microsoft.Rest.ServiceClient, IMonitorManagementClient, IAzureClient + public partial class MonitorManagementClient : ServiceClient, IMonitorManagementClient, IAzureClient { /// /// The base URI of the service. @@ -26,17 +34,17 @@ public partial class MonitorManagementClient : Microsoft.Rest.ServiceClient /// Gets or sets json serialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + public JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + public ServiceClientCredentials Credentials { get; private set; } /// /// The Azure subscription Id. @@ -93,7 +101,7 @@ public partial class MonitorManagementClient : Microsoft.Rest.ServiceClient protected MonitorManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -107,7 +115,7 @@ protected MonitorManagementClient(params System.Net.Http.DelegatingHandler[] han /// protected MonitorManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -128,7 +136,7 @@ protected MonitorManagementClient(System.Uri baseUri, params System.Net.Http.Del { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -152,7 +160,7 @@ protected MonitorManagementClient(System.Uri baseUri, System.Net.Http.HttpClient { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -167,16 +175,16 @@ protected MonitorManagementClient(System.Uri baseUri, System.Net.Http.HttpClient /// /// Thrown when a required parameter is null /// - public MonitorManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public MonitorManagementClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -195,16 +203,16 @@ public MonitorManagementClient(Microsoft.Rest.ServiceClientCredentials credentia /// /// Thrown when a required parameter is null /// - public MonitorManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public MonitorManagementClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -223,7 +231,7 @@ public MonitorManagementClient(Microsoft.Rest.ServiceClientCredentials credentia /// /// Thrown when a required parameter is null /// - public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public MonitorManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -233,11 +241,11 @@ public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -259,7 +267,7 @@ public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC /// /// Thrown when a required parameter is null /// - public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public MonitorManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -269,11 +277,11 @@ public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -286,50 +294,51 @@ public MonitorManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientC /// private void Initialize() { - this.AutoscaleSettings = new AutoscaleSettingsOperations(this); - this.ServiceDiagnosticSettings = new ServiceDiagnosticSettingsOperations(this); - this.AlertRules = new AlertRulesOperations(this); - this.AlertRuleIncidents = new AlertRuleIncidentsOperations(this); - this.LogProfiles = new LogProfilesOperations(this); - this.BaseUri = new System.Uri("https://management.azure.com"); - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + AutoscaleSettings = new AutoscaleSettingsOperations(this); + ServiceDiagnosticSettings = new ServiceDiagnosticSettingsOperations(this); + AlertRules = new AlertRulesOperations(this); + AlertRuleIncidents = new AlertRuleIncidentsOperations(this); + LogProfiles = new LogProfilesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings { - Formatting = Newtonsoft.Json.Formatting.Indented, - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + Formatting = Formatting.Indented, + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); - DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings { - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("odata.type")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("odata.type")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("odata.type")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("odata.type")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("odata.type")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("odata.type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("odata.type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("odata.type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("odata.type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("odata.type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("odata.type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("odata.type")); CustomInitialize(); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs index 9cd0387dc6d5..49a5129b808b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ServiceDiagnosticSettingsOperations operations. /// - internal partial class ServiceDiagnosticSettingsOperations : Microsoft.Rest.IServiceOperations, IServiceDiagnosticSettingsOperations + internal partial class ServiceDiagnosticSettingsOperations : IServiceOperations, IServiceDiagnosticSettingsOperations { /// /// Initializes a new instance of the ServiceDiagnosticSettingsOperations class. @@ -29,11 +38,11 @@ internal partial class ServiceDiagnosticSettingsOperations : Microsoft.Rest.ISer /// internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -53,42 +62,45 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceUri, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } string apiVersion = "2015-07-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceUri", resourceUri); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/service").ToString(); _url = _url.Replace("{resourceUri}", System.Uri.EscapeDataString(resourceUri)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -98,23 +110,25 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -130,51 +144,51 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -184,7 +198,7 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -197,21 +211,21 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -231,27 +245,30 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) /// /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } if (parameters != null) { @@ -259,23 +276,23 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) } string apiVersion = "2015-07-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceUri", resourceUri); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/diagnosticSettings/service").ToString(); _url = _url.Replace("{resourceUri}", System.Uri.EscapeDataString(resourceUri)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -285,23 +302,25 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -318,56 +337,56 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -377,7 +396,7 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -390,24 +409,25 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs index aa8b53d811cc..c55c07cb8151 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs @@ -1,16 +1,20 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Insights { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ServiceDiagnosticSettingsOperations. @@ -28,7 +32,7 @@ public static partial class ServiceDiagnosticSettingsOperationsExtensions /// public static ServiceDiagnosticSettingsResource Get(this IServiceDiagnosticSettingsOperations operations, string resourceUri) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IServiceDiagnosticSettingsOperations)s).GetAsync(resourceUri), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceUri).GetAwaiter().GetResult(); } /// @@ -43,7 +47,7 @@ public static ServiceDiagnosticSettingsResource Get(this IServiceDiagnosticSetti /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false)) { @@ -65,7 +69,7 @@ public static ServiceDiagnosticSettingsResource Get(this IServiceDiagnosticSetti /// public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IServiceDiagnosticSettingsOperations)s).CreateOrUpdateAsync(resourceUri, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceUri, parameters).GetAwaiter().GetResult(); } /// @@ -83,7 +87,7 @@ public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiag /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceUri, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -93,3 +97,4 @@ public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiag } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs index 6d189bb64ba0..e68df67e6ced 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ActivityLogsOperations operations. /// - internal partial class ActivityLogsOperations : Microsoft.Rest.IServiceOperations, IActivityLogsOperations + internal partial class ActivityLogsOperations : IServiceOperations, IActivityLogsOperations { /// /// Initializes a new instance of the ActivityLogsOperations class. @@ -29,11 +38,11 @@ internal partial class ActivityLogsOperations : Microsoft.Rest.IServiceOperation /// internal ActivityLogsOperations(MonitorClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -78,47 +87,50 @@ internal ActivityLogsOperations(MonitorClient client) /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), string select = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2015-04-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("select", select); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (odataQuery != null) { var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } @@ -136,23 +148,25 @@ internal ActivityLogsOperations(MonitorClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -168,51 +182,51 @@ internal ActivityLogsOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -222,7 +236,7 @@ internal ActivityLogsOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -235,21 +249,21 @@ internal ActivityLogsOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -283,61 +297,66 @@ internal ActivityLogsOperations(MonitorClient client) /// /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -353,51 +372,51 @@ internal ActivityLogsOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -407,7 +426,7 @@ internal ActivityLogsOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -420,24 +439,25 @@ internal ActivityLogsOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs index 0b29165df177..d12543cab1f9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ActivityLogsOperationsExtensions.cs @@ -1,16 +1,20 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ActivityLogsOperations. @@ -51,9 +55,9 @@ public static partial class ActivityLogsOperationsExtensions /// properties, resourceGroupName, resourceProviderName, resourceId, status, /// submissionTimestamp, subStatus, subscriptionId /// - public static Microsoft.Rest.Azure.IPage List(this IActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string)) + public static IPage List(this IActivityLogsOperations operations, ODataQuery odataQuery = default(ODataQuery), string select = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IActivityLogsOperations)s).ListAsync(odataQuery, select), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(odataQuery, select).GetAwaiter().GetResult(); } /// @@ -93,7 +97,7 @@ public static partial class ActivityLogsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this IActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IActivityLogsOperations operations, ODataQuery odataQuery = default(ODataQuery), string select = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, select, null, cancellationToken).ConfigureAwait(false)) { @@ -127,9 +131,9 @@ public static partial class ActivityLogsOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IActivityLogsOperations operations, string nextPageLink) + public static IPage ListNext(this IActivityLogsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IActivityLogsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -161,7 +165,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IActivityLogsO /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IActivityLogsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IActivityLogsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -171,3 +175,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IActivityLogsO } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs index a819aca0050c..f4012557c2a4 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperations.cs @@ -1,22 +1,30 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// EventCategoriesOperations operations. /// - internal partial class EventCategoriesOperations : Microsoft.Rest.IServiceOperations, IEventCategoriesOperations + internal partial class EventCategoriesOperations : IServiceOperations, IEventCategoriesOperations { /// /// Initializes a new instance of the EventCategoriesOperations class. @@ -29,11 +37,11 @@ internal partial class EventCategoriesOperations : Microsoft.Rest.IServiceOperat /// internal EventCategoriesOperations(MonitorClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -52,33 +60,33 @@ internal EventCategoriesOperations(MonitorClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { string apiVersion = "2015-04-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventcategories").ToString(); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -88,23 +96,25 @@ internal EventCategoriesOperations(MonitorClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -120,51 +130,51 @@ internal EventCategoriesOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -174,7 +184,7 @@ internal EventCategoriesOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -187,24 +197,25 @@ internal EventCategoriesOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs index 35167a713c31..30d5d36f0abe 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/EventCategoriesOperationsExtensions.cs @@ -1,16 +1,21 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { + using Azure; + using Rest; + using Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for EventCategoriesOperations. @@ -25,9 +30,9 @@ public static partial class EventCategoriesOperationsExtensions /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IEventCategoriesOperations operations) + public static IEnumerable List(this IEventCategoriesOperations operations) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IEventCategoriesOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync().GetAwaiter().GetResult(); } /// @@ -41,7 +46,7 @@ public static System.Collections.Generic.IEnumerable List(thi /// /// The cancellation token. /// - public static async Task> ListAsync(this IEventCategoriesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IEventCategoriesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -51,3 +56,4 @@ public static System.Collections.Generic.IEnumerable List(thi } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs index 9c525b6d9337..d8013661def9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IActivityLogsOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ActivityLogsOperations operations. @@ -65,7 +72,7 @@ public partial interface IActivityLogsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), string select = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Provides the list of events. The **$filter** is very restricted and /// allows only the following patterns. - List events for a resource @@ -106,6 +113,7 @@ public partial interface IActivityLogsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs index 0d1e7f6c1a55..d07b991b596e 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IEventCategoriesOperations.cs @@ -1,15 +1,21 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// EventCategoriesOperations operations. @@ -37,6 +43,7 @@ public partial interface IEventCategoriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs index 257c9edc38b3..67983640741b 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricDefinitionsOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// MetricDefinitionsOperations operations. @@ -46,6 +53,7 @@ public partial interface IMetricDefinitionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs index 35b0816b904e..b397a606aa18 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMetricsOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// MetricsOperations operations. @@ -61,6 +68,7 @@ public partial interface IMetricsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs index addfaddcdb12..fb915f24e9b3 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IMonitorClient.cs @@ -1,16 +1,18 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; /// /// Composite Swagger for Monitor Client @@ -25,17 +27,17 @@ public partial interface IMonitorClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - Microsoft.Rest.ServiceClientCredentials Credentials { get; } + ServiceClientCredentials Credentials { get; } /// /// The Azure subscription Id. @@ -92,3 +94,4 @@ public partial interface IMonitorClient : System.IDisposable } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs index 1dfb34d328b2..675588cd0e49 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/ITenantActivityLogsOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// TenantActivityLogsOperations operations. @@ -71,7 +78,7 @@ public partial interface ITenantActivityLogsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), string select = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// get the Activity Logs for the Tenant. Everything that is applicable /// to the API to get the Activity Log for the subscription is @@ -118,6 +125,7 @@ public partial interface ITenantActivityLogsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs index 7de1d078bbde..150aa42ff8ff 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/IUsageMetricsOperations.cs @@ -1,15 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// UsageMetricsOperations operations. @@ -23,7 +30,8 @@ public partial interface IUsageMetricsOperations /// The identifier of the resource. /// /// - /// The client Api Version. + /// Client Api Version. NOTE: This is not a client property, it must be + /// explicit in the call and there is no default value. /// /// /// OData parameters to apply to the operation. @@ -43,6 +51,7 @@ public partial interface IUsageMetricsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceUri, string apiVersion, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs index 52feec5721cf..f7456ee18504 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// MetricDefinitionsOperations operations. /// - internal partial class MetricDefinitionsOperations : Microsoft.Rest.IServiceOperations, IMetricDefinitionsOperations + internal partial class MetricDefinitionsOperations : IServiceOperations, IMetricDefinitionsOperations { /// /// Initializes a new instance of the MetricDefinitionsOperations class. @@ -29,11 +38,11 @@ internal partial class MetricDefinitionsOperations : Microsoft.Rest.IServiceOper /// internal MetricDefinitionsOperations(MonitorClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -61,47 +70,50 @@ internal MetricDefinitionsOperations(MonitorClient client) /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } string apiVersion = "2016-03-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceUri", resourceUri); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metricDefinitions").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (odataQuery != null) { var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } @@ -115,23 +127,25 @@ internal MetricDefinitionsOperations(MonitorClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -147,51 +161,51 @@ internal MetricDefinitionsOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -201,7 +215,7 @@ internal MetricDefinitionsOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -214,24 +228,25 @@ internal MetricDefinitionsOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs index a15ff262a5c8..55ebf40d9553 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricDefinitionsOperationsExtensions.cs @@ -1,16 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for MetricDefinitionsOperations. @@ -34,9 +40,9 @@ public static partial class MetricDefinitionsOperationsExtensions /// /// OData parameters to apply to the operation. /// - public static System.Collections.Generic.IEnumerable List(this IMetricDefinitionsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static IEnumerable List(this IMetricDefinitionsOperations operations, string resourceUri, ODataQuery odataQuery = default(ODataQuery)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IMetricDefinitionsOperations)s).ListAsync(resourceUri, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceUri, odataQuery).GetAwaiter().GetResult(); } /// @@ -59,7 +65,7 @@ public static partial class MetricDefinitionsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this IMetricDefinitionsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IMetricDefinitionsOperations operations, string resourceUri, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, odataQuery, null, cancellationToken).ConfigureAwait(false)) { @@ -69,3 +75,4 @@ public static partial class MetricDefinitionsOperationsExtensions } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs index 699548d6231b..fb3e07d6bbd6 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// MetricsOperations operations. /// - internal partial class MetricsOperations : Microsoft.Rest.IServiceOperations, IMetricsOperations + internal partial class MetricsOperations : IServiceOperations, IMetricsOperations { /// /// Initializes a new instance of the MetricsOperations class. @@ -29,11 +38,11 @@ internal partial class MetricsOperations : Microsoft.Rest.IServiceOperations internal MetricsOperations(MonitorClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -74,47 +83,50 @@ internal MetricsOperations(MonitorClient client) /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceUri, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } string apiVersion = "2016-09-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceUri", resourceUri); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metrics").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (odataQuery != null) { var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } @@ -128,23 +140,25 @@ internal MetricsOperations(MonitorClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -160,51 +174,51 @@ internal MetricsOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -214,7 +228,7 @@ internal MetricsOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -227,24 +241,25 @@ internal MetricsOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs index eb23313bd0ca..498882faa959 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MetricsOperationsExtensions.cs @@ -1,16 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for MetricsOperations. @@ -47,9 +53,9 @@ public static partial class MetricsOperationsExtensions /// /// OData parameters to apply to the operation. /// - public static System.Collections.Generic.IEnumerable List(this IMetricsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static IEnumerable List(this IMetricsOperations operations, string resourceUri, ODataQuery odataQuery = default(ODataQuery)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IMetricsOperations)s).ListAsync(resourceUri, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceUri, odataQuery).GetAwaiter().GetResult(); } /// @@ -85,7 +91,7 @@ public static partial class MetricsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this IMetricsOperations operations, string resourceUri, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IMetricsOperations operations, string resourceUri, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, odataQuery, null, cancellationToken).ConfigureAwait(false)) { @@ -95,3 +101,4 @@ public static partial class MetricsOperationsExtensions } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs index af98affd34d9..f003139c2b6c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/AggregationType.cs @@ -1,31 +1,38 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for AggregationType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum AggregationType { - [System.Runtime.Serialization.EnumMember(Value = "None")] + [EnumMember(Value = "None")] None, - [System.Runtime.Serialization.EnumMember(Value = "Average")] + [EnumMember(Value = "Average")] Average, - [System.Runtime.Serialization.EnumMember(Value = "Count")] + [EnumMember(Value = "Count")] Count, - [System.Runtime.Serialization.EnumMember(Value = "Minimum")] + [EnumMember(Value = "Minimum")] Minimum, - [System.Runtime.Serialization.EnumMember(Value = "Maximum")] + [EnumMember(Value = "Maximum")] Maximum, - [System.Runtime.Serialization.EnumMember(Value = "Total")] + [EnumMember(Value = "Total")] Total } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs index 850d6c323b45..fb2f2fca8e93 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventData.cs @@ -1,13 +1,18 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -87,7 +92,7 @@ public EventData() { } /// the Azure subscription Id usually a /// GUID. /// the Azure tenant Id - public EventData(EventLevel level, System.DateTime eventTimestamp, System.DateTime submissionTimestamp, SenderAuthorization authorization = default(SenderAuthorization), System.Collections.Generic.IDictionary claims = default(System.Collections.Generic.IDictionary), string caller = default(string), string description = default(string), string id = default(string), string eventDataId = default(string), string correlationId = default(string), LocalizableString eventName = default(LocalizableString), LocalizableString category = default(LocalizableString), HttpRequestInfo httpRequest = default(HttpRequestInfo), string resourceGroupName = default(string), LocalizableString resourceProviderName = default(LocalizableString), string resourceId = default(string), LocalizableString resourceType = default(LocalizableString), string operationId = default(string), LocalizableString operationName = default(LocalizableString), System.Collections.Generic.IDictionary properties = default(System.Collections.Generic.IDictionary), LocalizableString status = default(LocalizableString), LocalizableString subStatus = default(LocalizableString), string subscriptionId = default(string), string tenantId = default(string)) + public EventData(EventLevel level, System.DateTime eventTimestamp, System.DateTime submissionTimestamp, SenderAuthorization authorization = default(SenderAuthorization), IDictionary claims = default(IDictionary), string caller = default(string), string description = default(string), string id = default(string), string eventDataId = default(string), string correlationId = default(string), LocalizableString eventName = default(LocalizableString), LocalizableString category = default(LocalizableString), HttpRequestInfo httpRequest = default(HttpRequestInfo), string resourceGroupName = default(string), LocalizableString resourceProviderName = default(LocalizableString), string resourceId = default(string), LocalizableString resourceType = default(LocalizableString), string operationId = default(string), LocalizableString operationName = default(LocalizableString), IDictionary properties = default(IDictionary), LocalizableString status = default(LocalizableString), LocalizableString subStatus = default(LocalizableString), string subscriptionId = default(string), string tenantId = default(string)) { Authorization = authorization; Claims = claims; @@ -121,40 +126,40 @@ public EventData() { } /// properties of the event. These usually include the 'action', 'role' /// and the 'scope' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "authorization")] + [JsonProperty(PropertyName = "authorization")] public SenderAuthorization Authorization { get; set; } /// /// Gets or sets key value pairs to identify ARM permissions. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "claims")] - public System.Collections.Generic.IDictionary Claims { get; set; } + [JsonProperty(PropertyName = "claims")] + public IDictionary Claims { get; set; } /// /// Gets or sets the email address of the user who has performed the /// operation, the UPN claim or SPN claim based on availability. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "caller")] + [JsonProperty(PropertyName = "caller")] public string Caller { get; set; } /// /// Gets or sets the description of the event. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// /// Gets or sets the Id of this event as required by ARM for RBAC. It /// contains the EventDataID and a timestamp information. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the event data Id. This is a unique identifier for an /// event. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eventDataId")] + [JsonProperty(PropertyName = "eventDataId")] public string EventDataId { get; set; } /// @@ -162,7 +167,7 @@ public EventData() { } /// format. The correlation Id is shared among the events that belong /// to the same uber operation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "correlationId")] + [JsonProperty(PropertyName = "correlationId")] public string CorrelationId { get; set; } /// @@ -170,13 +175,13 @@ public EventData() { } /// OperationName. For practical purposes, OperationName might be more /// appealing to end users. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eventName")] + [JsonProperty(PropertyName = "eventName")] public LocalizableString EventName { get; set; } /// /// Gets or sets the event category. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "category")] + [JsonProperty(PropertyName = "category")] public LocalizableString Category { get; set; } /// @@ -184,39 +189,39 @@ public EventData() { } /// 'clientRequestId', 'clientIpAddress' (IP address of the user who /// initiated the event) and 'method' (HTTP method e.g. PUT). /// - [Newtonsoft.Json.JsonProperty(PropertyName = "httpRequest")] + [JsonProperty(PropertyName = "httpRequest")] public HttpRequestInfo HttpRequest { get; set; } /// /// Gets or sets the event level. Possible values include: 'Critical', /// 'Error', 'Warning', 'Informational', 'Verbose' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "level")] + [JsonProperty(PropertyName = "level")] public EventLevel Level { get; set; } /// /// Gets or sets the resource group name of the impacted resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroupName")] + [JsonProperty(PropertyName = "resourceGroupName")] public string ResourceGroupName { get; set; } /// /// Gets or sets the resource provider name of the impacted resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceProviderName")] + [JsonProperty(PropertyName = "resourceProviderName")] public LocalizableString ResourceProviderName { get; set; } /// /// Gets or sets the resource uri that uniquely identifies the resource /// that caused this event. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + [JsonProperty(PropertyName = "resourceId")] public string ResourceId { get; set; } /// /// Gets or sets the resource type /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceType")] + [JsonProperty(PropertyName = "resourceType")] public LocalizableString ResourceType { get; set; } /// @@ -224,13 +229,13 @@ public EventData() { } /// corresponding to single operation. This value should not be /// confused with EventName. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operationId")] + [JsonProperty(PropertyName = "operationId")] public string OperationId { get; set; } /// /// Gets or sets the operation name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operationName")] + [JsonProperty(PropertyName = "operationName")] public LocalizableString OperationName { get; set; } /// @@ -238,15 +243,15 @@ public EventData() { } /// Dictionary&lt;String, String&gt;) that includes details /// about the event. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public System.Collections.Generic.IDictionary Properties { get; set; } + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } /// /// Gets or sets a string describing the status of the operation. Some /// typical values are: Started, In progress, Succeeded, Failed, /// Resolved. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + [JsonProperty(PropertyName = "status")] public LocalizableString Status { get; set; } /// @@ -259,7 +264,7 @@ public EventData() { } /// (HTTP Status Code: 500), Service Unavailable (HTTP Status /// Code:503), Gateway Timeout (HTTP Status Code: 504) /// - [Newtonsoft.Json.JsonProperty(PropertyName = "subStatus")] + [JsonProperty(PropertyName = "subStatus")] public LocalizableString SubStatus { get; set; } /// @@ -267,7 +272,7 @@ public EventData() { } /// Azure service processing the request corresponding the event. It in /// ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eventTimestamp")] + [JsonProperty(PropertyName = "eventTimestamp")] public System.DateTime EventTimestamp { get; set; } /// @@ -277,57 +282,58 @@ public EventData() { } /// the occurence time of the event, and the time that the event is /// submitted to the Azure logging infrastructure. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "submissionTimestamp")] + [JsonProperty(PropertyName = "submissionTimestamp")] public System.DateTime SubmissionTimestamp { get; set; } /// /// Gets or sets the Azure subscription Id usually a GUID. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "subscriptionId")] + [JsonProperty(PropertyName = "subscriptionId")] public string SubscriptionId { get; set; } /// /// Gets or sets the Azure tenant Id /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tenantId")] + [JsonProperty(PropertyName = "tenantId")] public string TenantId { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.EventName != null) + if (EventName != null) { - this.EventName.Validate(); + EventName.Validate(); } - if (this.Category != null) + if (Category != null) { - this.Category.Validate(); + Category.Validate(); } - if (this.ResourceProviderName != null) + if (ResourceProviderName != null) { - this.ResourceProviderName.Validate(); + ResourceProviderName.Validate(); } - if (this.ResourceType != null) + if (ResourceType != null) { - this.ResourceType.Validate(); + ResourceType.Validate(); } - if (this.OperationName != null) + if (OperationName != null) { - this.OperationName.Validate(); + OperationName.Validate(); } - if (this.Status != null) + if (Status != null) { - this.Status.Validate(); + Status.Validate(); } - if (this.SubStatus != null) + if (SubStatus != null) { - this.SubStatus.Validate(); + SubStatus.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs index de80b1b60efc..4cad39cf2aca 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/EventLevel.cs @@ -1,29 +1,36 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for EventLevel. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum EventLevel { - [System.Runtime.Serialization.EnumMember(Value = "Critical")] + [EnumMember(Value = "Critical")] Critical, - [System.Runtime.Serialization.EnumMember(Value = "Error")] + [EnumMember(Value = "Error")] Error, - [System.Runtime.Serialization.EnumMember(Value = "Warning")] + [EnumMember(Value = "Warning")] Warning, - [System.Runtime.Serialization.EnumMember(Value = "Informational")] + [EnumMember(Value = "Informational")] Informational, - [System.Runtime.Serialization.EnumMember(Value = "Verbose")] + [EnumMember(Value = "Verbose")] Verbose } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs index 52405fc6a672..53c5d156af64 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/HttpRequestInfo.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -38,26 +41,27 @@ public HttpRequestInfo() { } /// /// Gets or sets the client request id. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "clientRequestId")] + [JsonProperty(PropertyName = "clientRequestId")] public string ClientRequestId { get; set; } /// /// Gets or sets the client Ip Address /// - [Newtonsoft.Json.JsonProperty(PropertyName = "clientIpAddress")] + [JsonProperty(PropertyName = "clientIpAddress")] public string ClientIpAddress { get; set; } /// /// Gets or sets the Http request method. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "method")] + [JsonProperty(PropertyName = "method")] public string Method { get; set; } /// /// Gets or sets the Uri. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "uri")] + [JsonProperty(PropertyName = "uri")] public string Uri { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs index 0473a143203e..97f62d2a98f9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/LocalizableString.cs @@ -1,13 +1,17 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -34,27 +38,28 @@ public LocalizableString() { } /// /// Gets or sets the invariant value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + [JsonProperty(PropertyName = "value")] public string Value { get; set; } /// /// Gets or sets the locale specific value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "localizedValue")] + [JsonProperty(PropertyName = "localizedValue")] public string LocalizedValue { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Value == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs index 6130c17abe11..13760544a07d 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Metric.cs @@ -1,13 +1,19 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -33,7 +39,7 @@ public Metric() { } /// the id, resourceId, of the metric. /// the resource type of the metric /// resource. - public Metric(LocalizableString name, Unit unit, System.Collections.Generic.IList data, string id = default(string), string type = default(string)) + public Metric(LocalizableString name, Unit unit, IList data, string id = default(string), string type = default(string)) { Id = id; Type = type; @@ -45,20 +51,20 @@ public Metric() { } /// /// Gets or sets the id, resourceId, of the metric. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the resource type of the metric resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// /// Gets or sets the name and the display name of the metric, i.e. it /// is localizable string. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public LocalizableString Name { get; set; } /// @@ -66,38 +72,38 @@ public Metric() { } /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', /// 'Percent', 'MilliSeconds' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + [JsonProperty(PropertyName = "unit")] public Unit Unit { get; set; } /// /// Gets or sets array of data points representing the metric values. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "data")] - public System.Collections.Generic.IList Data { get; set; } + [JsonProperty(PropertyName = "data")] + public IList Data { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } if (Data == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Data"); + throw new ValidationException(ValidationRules.CannotBeNull, "Data"); } - if (this.Name != null) + if (Name != null) { - this.Name.Validate(); + Name.Validate(); } - if (this.Data != null) + if (Data != null) { - foreach (var element in this.Data) + foreach (var element in Data) { if (element != null) { @@ -108,3 +114,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs index a358beacfec8..f3bce298079f 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricAvailability.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -40,15 +43,16 @@ public MetricAvailability() { } /// Gets or sets the time grain specifies the aggregation interval for /// the metric. Expressed as a duration 'PT1M', 'P1D', etc. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeGrain")] + [JsonProperty(PropertyName = "timeGrain")] public System.TimeSpan? TimeGrain { get; set; } /// /// Gets or sets the retention period for the metric at the specified /// timegrain. Expressed as a duration 'PT1M', 'P1D', etc. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "retention")] + [JsonProperty(PropertyName = "retention")] public System.TimeSpan? Retention { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs index 72c618568142..83aa7d8e6d88 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricDefinition.cs @@ -1,13 +1,18 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -38,7 +43,7 @@ public MetricDefinition() { } /// aggregation intervals are available to be queried. /// the resource identifier of the metric /// definition. - public MetricDefinition(string resourceId = default(string), LocalizableString name = default(LocalizableString), Unit? unit = default(Unit?), AggregationType? primaryAggregationType = default(AggregationType?), System.Collections.Generic.IList metricAvailabilities = default(System.Collections.Generic.IList), string id = default(string)) + public MetricDefinition(string resourceId = default(string), LocalizableString name = default(LocalizableString), Unit? unit = default(Unit?), AggregationType? primaryAggregationType = default(AggregationType?), IList metricAvailabilities = default(IList), string id = default(string)) { ResourceId = resourceId; Name = name; @@ -52,14 +57,14 @@ public MetricDefinition() { } /// Gets or sets the resource identifier of the resource that emitted /// the metric. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + [JsonProperty(PropertyName = "resourceId")] public string ResourceId { get; set; } /// /// Gets or sets the name and the display name of the metric, i.e. it /// is a localizable string. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public LocalizableString Name { get; set; } /// @@ -67,7 +72,7 @@ public MetricDefinition() { } /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', /// 'Percent', 'MilliSeconds' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + [JsonProperty(PropertyName = "unit")] public Unit? Unit { get; set; } /// @@ -75,34 +80,35 @@ public MetricDefinition() { } /// the values for display. Possible values include: 'None', 'Average', /// 'Count', 'Minimum', 'Maximum', 'Total' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "primaryAggregationType")] + [JsonProperty(PropertyName = "primaryAggregationType")] public AggregationType? PrimaryAggregationType { get; set; } /// /// Gets or sets the collection of what aggregation intervals are /// available to be queried. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "metricAvailabilities")] - public System.Collections.Generic.IList MetricAvailabilities { get; set; } + [JsonProperty(PropertyName = "metricAvailabilities")] + public IList MetricAvailabilities { get; set; } /// /// Gets or sets the resource identifier of the metric definition. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name != null) + if (Name != null) { - this.Name.Validate(); + Name.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs index ed93e020c462..7a06d8c16731 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/MetricValue.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -46,31 +49,31 @@ public MetricValue() { } /// /// Gets or sets the timestamp for the metric value in ISO 8601 format. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "timeStamp")] + [JsonProperty(PropertyName = "timeStamp")] public System.DateTime TimeStamp { get; set; } /// /// Gets or sets the average value in the time range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "average")] + [JsonProperty(PropertyName = "average")] public double? Average { get; set; } /// /// Gets or sets the least value in the time range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minimum")] + [JsonProperty(PropertyName = "minimum")] public double? Minimum { get; set; } /// /// Gets or sets the greatest value in the time range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "maximum")] + [JsonProperty(PropertyName = "maximum")] public double? Maximum { get; set; } /// /// Gets or sets the sum of all of the values in the time range. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "total")] + [JsonProperty(PropertyName = "total")] public double? Total { get; set; } /// @@ -78,13 +81,13 @@ public MetricValue() { } /// to determine the number of values that contributed to the average /// value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + [JsonProperty(PropertyName = "count")] public long? Count { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -93,3 +96,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs index 92e2a6b0a157..18d07a340bf3 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page.cs @@ -1,46 +1,54 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("")] - public System.String NextPageLink { get; private set; } + [JsonProperty("")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } + [JsonProperty("value")] + private IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs index 48ed67f34acd..70707a9a7e03 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Page1.cs @@ -1,46 +1,54 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page1 : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page1 : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("nextLink")] - public System.String NextPageLink { get; private set; } + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } + [JsonProperty("value")] + private IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs index 252f03e03705..7bc6b3cb5f24 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/SenderAuthorization.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -39,20 +42,21 @@ public SenderAuthorization() { } /// Gets or sets the permissible actions. For instance: /// microsoft.support/supporttickets/write /// - [Newtonsoft.Json.JsonProperty(PropertyName = "action")] + [JsonProperty(PropertyName = "action")] public string Action { get; set; } /// /// Gets or sets the role of the user. For instance: Subscription Admin /// - [Newtonsoft.Json.JsonProperty(PropertyName = "role")] + [JsonProperty(PropertyName = "role")] public string Role { get; set; } /// /// Gets or sets the scope. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + [JsonProperty(PropertyName = "scope")] public string Scope { get; set; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs index ddc1f81c334a..cb54242d6f0c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/Unit.cs @@ -1,33 +1,40 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for Unit. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(StringEnumConverter))] public enum Unit { - [System.Runtime.Serialization.EnumMember(Value = "Count")] + [EnumMember(Value = "Count")] Count, - [System.Runtime.Serialization.EnumMember(Value = "Bytes")] + [EnumMember(Value = "Bytes")] Bytes, - [System.Runtime.Serialization.EnumMember(Value = "Seconds")] + [EnumMember(Value = "Seconds")] Seconds, - [System.Runtime.Serialization.EnumMember(Value = "CountPerSecond")] + [EnumMember(Value = "CountPerSecond")] CountPerSecond, - [System.Runtime.Serialization.EnumMember(Value = "BytesPerSecond")] + [EnumMember(Value = "BytesPerSecond")] BytesPerSecond, - [System.Runtime.Serialization.EnumMember(Value = "Percent")] + [EnumMember(Value = "Percent")] Percent, - [System.Runtime.Serialization.EnumMember(Value = "MilliSeconds")] + [EnumMember(Value = "MilliSeconds")] MilliSeconds } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs index 8192c4e83b27..b5029121edc9 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/Models/UsageMetric.cs @@ -1,13 +1,16 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights.Models { + using Azure; + using Insights; + using Newtonsoft.Json; using System.Linq; /// @@ -47,57 +50,58 @@ public UsageMetric() { } /// /// Gets or sets the usage metric name and display name. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public LocalizableString Name { get; set; } /// /// Gets or sets the current value for the usage metric. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "currentValue")] + [JsonProperty(PropertyName = "currentValue")] public double? CurrentValue { get; set; } /// /// Gets or sets the id for the usage metric. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the quota limit the usage metric. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "limit")] + [JsonProperty(PropertyName = "limit")] public double? Limit { get; set; } /// /// Gets or sets the unit for the usage metric. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "unit")] + [JsonProperty(PropertyName = "unit")] public string Unit { get; set; } /// /// Gets or sets the next reset time for the current value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "nextResetTime")] + [JsonProperty(PropertyName = "nextResetTime")] public System.DateTime? NextResetTime { get; set; } /// /// Gets or sets the amount of time it takes to reset the value. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "quotaPeriod")] + [JsonProperty(PropertyName = "quotaPeriod")] public System.TimeSpan? QuotaPeriod { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.Name != null) + if (Name != null) { - this.Name.Validate(); + Name.Validate(); } } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs index e5b00c6b38af..2f2687621ce3 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/MonitorClient.cs @@ -1,22 +1,29 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Serialization; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; /// /// Composite Swagger for Monitor Client /// - public partial class MonitorClient : Microsoft.Rest.ServiceClient, IMonitorClient, IAzureClient + public partial class MonitorClient : ServiceClient, IMonitorClient, IAzureClient { /// /// The base URI of the service. @@ -26,17 +33,17 @@ public partial class MonitorClient : Microsoft.Rest.ServiceClient /// /// Gets or sets json serialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + public JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + public ServiceClientCredentials Credentials { get; private set; } /// /// The Azure subscription Id. @@ -98,7 +105,7 @@ public partial class MonitorClient : Microsoft.Rest.ServiceClient /// protected MonitorClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -112,7 +119,7 @@ protected MonitorClient(params System.Net.Http.DelegatingHandler[] handlers) : b /// protected MonitorClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -133,7 +140,7 @@ protected MonitorClient(System.Uri baseUri, params System.Net.Http.DelegatingHan { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -157,7 +164,7 @@ protected MonitorClient(System.Uri baseUri, System.Net.Http.HttpClientHandler ro { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -172,16 +179,16 @@ protected MonitorClient(System.Uri baseUri, System.Net.Http.HttpClientHandler ro /// /// Thrown when a required parameter is null /// - public MonitorClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public MonitorClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -200,16 +207,16 @@ public MonitorClient(Microsoft.Rest.ServiceClientCredentials credentials, params /// /// Thrown when a required parameter is null /// - public MonitorClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public MonitorClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -228,7 +235,7 @@ public MonitorClient(Microsoft.Rest.ServiceClientCredentials credentials, System /// /// Thrown when a required parameter is null /// - public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public MonitorClient(System.Uri baseUri, ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -238,11 +245,11 @@ public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -264,7 +271,7 @@ public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials /// /// Thrown when a required parameter is null /// - public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public MonitorClient(System.Uri baseUri, ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -274,11 +281,11 @@ public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -291,43 +298,44 @@ public MonitorClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials /// private void Initialize() { - this.UsageMetrics = new UsageMetricsOperations(this); - this.EventCategories = new EventCategoriesOperations(this); - this.ActivityLogs = new ActivityLogsOperations(this); - this.TenantActivityLogs = new TenantActivityLogsOperations(this); - this.MetricDefinitions = new MetricDefinitionsOperations(this); - this.Metrics = new MetricsOperations(this); - this.BaseUri = new System.Uri("https://management.azure.com"); - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + UsageMetrics = new UsageMetricsOperations(this); + EventCategories = new EventCategoriesOperations(this); + ActivityLogs = new ActivityLogsOperations(this); + TenantActivityLogs = new TenantActivityLogsOperations(this); + MetricDefinitions = new MetricDefinitionsOperations(this); + Metrics = new MetricsOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings { - Formatting = Newtonsoft.Json.Formatting.Indented, - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + Formatting = Formatting.Indented, + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + DeserializationSettings = new JsonSerializerSettings { - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + DateFormatHandling = DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = DateTimeZoneHandling.Utc, + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs index 7254a792c2d8..ea05ce9ff627 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// TenantActivityLogsOperations operations. /// - internal partial class TenantActivityLogsOperations : Microsoft.Rest.IServiceOperations, ITenantActivityLogsOperations + internal partial class TenantActivityLogsOperations : IServiceOperations, ITenantActivityLogsOperations { /// /// Initializes a new instance of the TenantActivityLogsOperations class. @@ -29,11 +38,11 @@ internal partial class TenantActivityLogsOperations : Microsoft.Rest.IServiceOpe /// internal TenantActivityLogsOperations(MonitorClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -82,39 +91,39 @@ internal TenantActivityLogsOperations(MonitorClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(ODataQuery odataQuery = default(ODataQuery), string select = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { string apiVersion = "2015-04-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("select", select); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/microsoft.insights/eventtypes/management/values").ToString(); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (odataQuery != null) { var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } @@ -132,23 +141,25 @@ internal TenantActivityLogsOperations(MonitorClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -164,51 +175,51 @@ internal TenantActivityLogsOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -218,7 +229,7 @@ internal TenantActivityLogsOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -231,21 +242,21 @@ internal TenantActivityLogsOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -283,61 +294,66 @@ internal TenantActivityLogsOperations(MonitorClient client) /// /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -353,51 +369,51 @@ internal TenantActivityLogsOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -407,7 +423,7 @@ internal TenantActivityLogsOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -420,24 +436,25 @@ internal TenantActivityLogsOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs index dd4231172d7b..d9db26314568 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/TenantActivityLogsOperationsExtensions.cs @@ -1,16 +1,20 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for TenantActivityLogsOperations. @@ -55,9 +59,9 @@ public static partial class TenantActivityLogsOperationsExtensions /// properties, resourceGroupName, resourceProviderName, resourceId, status, /// submissionTimestamp, subStatus, subscriptionId /// - public static Microsoft.Rest.Azure.IPage List(this ITenantActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string)) + public static IPage List(this ITenantActivityLogsOperations operations, ODataQuery odataQuery = default(ODataQuery), string select = default(string)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ITenantActivityLogsOperations)s).ListAsync(odataQuery, select), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(odataQuery, select).GetAwaiter().GetResult(); } /// @@ -101,7 +105,7 @@ public static partial class TenantActivityLogsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this ITenantActivityLogsOperations operations, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string select = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this ITenantActivityLogsOperations operations, ODataQuery odataQuery = default(ODataQuery), string select = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, select, null, cancellationToken).ConfigureAwait(false)) { @@ -139,9 +143,9 @@ public static partial class TenantActivityLogsOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this ITenantActivityLogsOperations operations, string nextPageLink) + public static IPage ListNext(this ITenantActivityLogsOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ITenantActivityLogsOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -177,7 +181,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ITenantActivit /// /// The cancellation token. /// - public static async Task> ListNextAsync(this ITenantActivityLogsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this ITenantActivityLogsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -187,3 +191,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this ITenantActivit } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs index 84427c5b86e6..4dbe2fe5979e 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperations.cs @@ -1,22 +1,31 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// UsageMetricsOperations operations. /// - internal partial class UsageMetricsOperations : Microsoft.Rest.IServiceOperations, IUsageMetricsOperations + internal partial class UsageMetricsOperations : IServiceOperations, IUsageMetricsOperations { /// /// Initializes a new instance of the UsageMetricsOperations class. @@ -29,11 +38,11 @@ internal partial class UsageMetricsOperations : Microsoft.Rest.IServiceOperation /// internal UsageMetricsOperations(MonitorClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -48,7 +57,8 @@ internal UsageMetricsOperations(MonitorClient client) /// The identifier of the resource. /// /// - /// The client Api Version. + /// Client Api Version. NOTE: This is not a client property, it must be + /// explicit in the call and there is no default value. /// /// /// OData parameters to apply to the operation. @@ -59,55 +69,53 @@ internal UsageMetricsOperations(MonitorClient client) /// /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceUri, string apiVersion, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceUri == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceUri"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); } if (apiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "apiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "apiVersion"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceUri", resourceUri); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/usages").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (odataQuery != null) { var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) + if (!string.IsNullOrEmpty(_odataFilter)) { _queryParameters.Add(_odataFilter); } @@ -121,23 +129,25 @@ internal UsageMetricsOperations(MonitorClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -153,51 +163,51 @@ internal UsageMetricsOperations(MonitorClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -207,7 +217,7 @@ internal UsageMetricsOperations(MonitorClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -220,24 +230,25 @@ internal UsageMetricsOperations(MonitorClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs index e7b1921b2a4c..1f19b0d6863c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Generated/Monitor/UsageMetricsOperationsExtensions.cs @@ -1,16 +1,22 @@ // 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 1.0.0.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Insights { + using Azure; + using Rest; + using Rest.Azure; + using Rest.Azure.OData; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for UsageMetricsOperations. @@ -27,14 +33,15 @@ public static partial class UsageMetricsOperationsExtensions /// The identifier of the resource. /// /// - /// The client Api Version. + /// Client Api Version. NOTE: This is not a client property, it must be + /// explicit in the call and there is no default value. /// /// /// OData parameters to apply to the operation. /// - public static System.Collections.Generic.IEnumerable List(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static IEnumerable List(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, ODataQuery odataQuery = default(ODataQuery)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IUsageMetricsOperations)s).ListAsync(resourceUri, apiVersion, odataQuery), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceUri, apiVersion, odataQuery).GetAwaiter().GetResult(); } /// @@ -47,7 +54,8 @@ public static partial class UsageMetricsOperationsExtensions /// The identifier of the resource. /// /// - /// The client Api Version. + /// Client Api Version. NOTE: This is not a client property, it must be + /// explicit in the call and there is no default value. /// /// /// OData parameters to apply to the operation. @@ -55,7 +63,7 @@ public static partial class UsageMetricsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IUsageMetricsOperations operations, string resourceUri, string apiVersion, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, apiVersion, odataQuery, null, cancellationToken).ConfigureAwait(false)) { @@ -65,3 +73,4 @@ public static partial class UsageMetricsOperationsExtensions } } + diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj index 50fd34a8c69b..dab4de82875c 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/Microsoft.Azure.Monitor.xproj @@ -6,7 +6,7 @@ - 8989ed12-b754-4ebd-bc97-efa7b11ffd49 + 3c8e045d-8696-45d7-9001-c485386ac469 Monitor .\obj .\bin\ diff --git a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd index 72957ab82406..8ee7df55f4c1 100644 --- a/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd +++ b/src/ResourceManagement/Monitor/Microsoft.Azure.Monitor/generate.cmd @@ -5,7 +5,7 @@ @echo off -set autoRestVersion=1.0.0-Nightly20161116 +set autoRestVersion=1.0.0-Nightly20170212 if "%1" == "" ( set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/efed63280648eebdec8be513470cd6c23783efb6/monitor/compositeMonitorClient.json" ) else ( diff --git a/src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj b/src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj index fc46a7fcfc08..0969895ed160 100644 --- a/src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj +++ b/src/ResourceManagement/Monitor/Monitor.Tests/Monitor.Tests.xproj @@ -6,7 +6,7 @@ - 2684f7eb-16b8-487e-a0ab-f4b3091c9197 + 5d973e4b-8222-41de-ac09-157e664b564d Monitor.Tests .\obj .\bin\ @@ -15,7 +15,7 @@ 2.0 - + \ No newline at end of file diff --git a/src/ResourceManagement/Monitor/Monitor.sln b/src/ResourceManagement/Monitor/Monitor.sln index 2a8d74819b05..0668b6a050ea 100644 --- a/src/ResourceManagement/Monitor/Monitor.sln +++ b/src/ResourceManagement/Monitor/Monitor.sln @@ -3,13 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Monitor.Tests", "Monitor.Tests\Monitor.Tests.xproj", "{2684F7EB-16B8-487E-A0AB-F4B3091C9197}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Monitor.Tests", "Monitor.Tests\Monitor.Tests.xproj", "{5D973E4B-8222-41DE-AC09-157E664B564D}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HttpRecorder", "..\..\TestFramework\Microsoft.Azure.Test.HttpRecorder\HttpRecorder.xproj", "{5D12D45A-E55F-410E-B8AF-9DC90E81B237}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestFramework", "..\..\TestFramework\Microsoft.Rest.ClientRuntime.Azure.TestFramework\TestFramework.xproj", "{C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Monitor", "Microsoft.Azure.Monitor\Microsoft.Azure.Monitor.xproj", "{8989ED12-B754-4EBD-BC97-EFA7B11FFD49}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Monitor", "Microsoft.Azure.Monitor\Microsoft.Azure.Monitor.xproj", "{3C8E045D-8696-45D7-9001-C485386AC469}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime\Microsoft.Rest.ClientRuntime.xproj", "{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}" EndProject @@ -27,18 +27,18 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Release|Any CPU.ActiveCfg = Debug|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Net45-Release|Any CPU.Build.0 = Debug|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Debug|Any CPU.ActiveCfg = Release|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Debug|Any CPU.Build.0 = Release|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Portable-Release|Any CPU.Build.0 = Release|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2684F7EB-16B8-487E-A0AB-F4B3091C9197}.Release|Any CPU.Build.0 = Release|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Net45-Release|Any CPU.ActiveCfg = Debug|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Net45-Release|Any CPU.Build.0 = Debug|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Portable-Debug|Any CPU.ActiveCfg = Release|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Portable-Debug|Any CPU.Build.0 = Release|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D973E4B-8222-41DE-AC09-157E664B564D}.Release|Any CPU.Build.0 = Release|Any CPU {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Debug|Any CPU.Build.0 = Debug|Any CPU {5D12D45A-E55F-410E-B8AF-9DC90E81B237}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -63,18 +63,18 @@ Global {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Portable-Release|Any CPU.Build.0 = Release|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.Build.0 = Release|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Net45-Release|Any CPU.Build.0 = Release|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Portable-Release|Any CPU.Build.0 = Release|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8989ED12-B754-4EBD-BC97-EFA7B11FFD49}.Release|Any CPU.Build.0 = Release|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Net45-Debug|Any CPU.Build.0 = Debug|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Net45-Release|Any CPU.ActiveCfg = Release|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Net45-Release|Any CPU.Build.0 = Release|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Portable-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Portable-Debug|Any CPU.Build.0 = Debug|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Portable-Release|Any CPU.ActiveCfg = Release|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Portable-Release|Any CPU.Build.0 = Release|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C8E045D-8696-45D7-9001-C485386AC469}.Release|Any CPU.Build.0 = Release|Any CPU {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Net45-Debug|Any CPU.ActiveCfg = Debug|Any CPU