From d7382338c08c62c05739e54d089b1365f2c24b0a Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 1 Nov 2019 06:16:31 +0000 Subject: [PATCH] Generated from 27d5fcbffb59163e5aeda0e779ecd92fff5ae415 add clear-output-folder in resource-manager readme.typescript.md to fix js sdk build failure --- .../AuthorizationPoliciesOperations.cs | 49 +- ...thorizationPoliciesOperationsExtensions.cs | 11 +- .../Generated/ConnectorMappingsOperations.cs | 61 +- .../ConnectorMappingsOperationsExtensions.cs | 13 +- .../src/Generated/ConnectorsOperations.cs | 57 +- .../ConnectorsOperationsExtensions.cs | 15 +- .../CustomerInsightsManagementClient.cs | 112 +- .../src/Generated/HubsOperations.cs | 83 +- .../src/Generated/HubsOperationsExtensions.cs | 15 +- .../IAuthorizationPoliciesOperations.cs | 11 +- .../Generated/IConnectorMappingsOperations.cs | 11 +- .../src/Generated/IConnectorsOperations.cs | 11 +- .../ICustomerInsightsManagementClient.cs | 32 +- .../src/Generated/IHubsOperations.cs | 11 +- .../src/Generated/IImagesOperations.cs | 11 +- .../src/Generated/IInteractionsOperations.cs | 11 +- .../src/Generated/IKpiOperations.cs | 11 +- .../src/Generated/ILinksOperations.cs | 11 +- .../src/Generated/IOperations.cs | 68 + .../src/Generated/IPredictionsOperations.cs | 299 +++ .../src/Generated/IProfilesOperations.cs | 11 +- .../Generated/IRelationshipLinksOperations.cs | 11 +- .../src/Generated/IRelationshipsOperations.cs | 11 +- .../Generated/IRoleAssignmentsOperations.cs | 11 +- .../src/Generated/IRolesOperations.cs | 11 +- .../src/Generated/IViewsOperations.cs | 19 +- .../src/Generated/IWidgetTypesOperations.cs | 11 +- .../src/Generated/ImagesOperations.cs | 27 +- .../Generated/ImagesOperationsExtensions.cs | 11 +- .../src/Generated/InteractionsOperations.cs | 43 +- .../InteractionsOperationsExtensions.cs | 11 +- .../src/Generated/KpiOperations.cs | 77 +- .../src/Generated/KpiOperationsExtensions.cs | 17 +- .../src/Generated/LinksOperations.cs | 57 +- .../Generated/LinksOperationsExtensions.cs | 13 +- .../Generated/Models/AssignmentPrincipal.cs | 21 +- .../Generated/Models/AuthorizationPolicy.cs | 33 +- .../AuthorizationPolicyResourceFormat.cs | 37 +- .../Models/AzureBlobConnectorProperties.cs | 21 +- .../Models/CalculationWindowTypes.cs | 51 +- .../Models/CanonicalProfileDefinition.cs | 62 + ...anonicalProfileDefinitionPropertiesItem.cs | 89 + .../Models/CanonicalPropertyValueType.cs | 24 + .../src/Generated/Models/CardinalityTypes.cs | 43 +- .../Models/CompletionOperationTypes.cs | 43 +- .../Models/ConnectorMappingAvailability.cs | 19 +- .../ConnectorMappingCompleteOperation.cs | 19 +- .../Models/ConnectorMappingErrorManagement.cs | 21 +- .../Models/ConnectorMappingFormat.cs | 19 +- .../Models/ConnectorMappingProperties.cs | 18 +- .../Models/ConnectorMappingResourceFormat.cs | 46 +- .../Models/ConnectorMappingStates.cs | 59 +- .../Models/ConnectorMappingStructure.cs | 21 +- .../Models/ConnectorResourceFormat.cs | 39 +- .../src/Generated/Models/ConnectorStates.cs | 55 +- .../src/Generated/Models/ConnectorTypes.cs | 8 +- .../Generated/Models/CrmConnectorEntities.cs | 21 +- .../Models/CrmConnectorProperties.cs | 21 +- .../src/Generated/Models/DataSource.cs | 76 - .../Generated/Models/DataSourcePrecedence.cs | 100 + .../src/Generated/Models/DataSourceType.cs | 10 +- .../src/Generated/Models/EnrichingKpi.cs | 19 +- .../src/Generated/Models/EntityType.cs | 72 + .../Generated/Models/EntityTypeDefinition.cs | 31 +- .../src/Generated/Models/EntityTypes.cs | 47 +- .../Generated/Models/ErrorManagementTypes.cs | 43 +- .../src/Generated/Models/FrequencyTypes.cs | 51 +- .../Models/GetImageUploadUrlInput.cs | 19 +- .../src/Generated/Models/Hub.cs | 40 +- .../Generated/Models/HubBillingInfoFormat.cs | 21 +- .../src/Generated/Models/ImageDefinition.cs | 19 +- .../Generated/Models/InstanceOperationType.cs | 39 +- .../Models/InteractionResourceFormat.cs | 104 +- .../src/Generated/Models/KpiAlias.cs | 21 +- .../src/Generated/Models/KpiDefinition.cs | 31 +- .../src/Generated/Models/KpiExtract.cs | 21 +- .../src/Generated/Models/KpiFunctions.cs | 63 +- .../Generated/Models/KpiGroupByMetadata.cs | 19 +- .../Models/KpiParticipantProfilesMetadata.cs | 21 +- .../src/Generated/Models/KpiResourceFormat.cs | 35 +- .../src/Generated/Models/KpiThresholds.cs | 19 +- .../Generated/Models/LinkResourceFormat.cs | 87 +- .../src/Generated/Models/LinkTypes.cs | 39 +- .../Models/MetadataDefinitionBase.cs | 19 +- .../src/Generated/Models/Operation.cs | 61 + .../src/Generated/Models/OperationDisplay.cs | 70 + .../src/Generated/Models/Page.cs | 12 +- .../src/Generated/Models/Participant.cs | 21 +- .../ParticipantProfilePropertyReference.cs | 83 + .../Models/ParticipantPropertyReference.cs | 57 +- .../src/Generated/Models/PermissionTypes.cs | 43 +- .../PredictionDistributionDefinition.cs | 74 + ...DistributionDefinitionDistributionsItem.cs | 87 + .../Generated/Models/PredictionGradesItem.cs | 67 + .../Generated/Models/PredictionMappings.cs | 89 + .../Models/PredictionModelLifeCycle.cs | 38 + .../Generated/Models/PredictionModelStatus.cs | 161 ++ .../Models/PredictionResourceFormat.cs | 235 +++ .../PredictionSystemGeneratedEntities.cs | 72 + .../Models/PredictionTrainingResults.cs | 87 + .../Models/ProfileEnumValidValuesFormat.cs | 19 +- .../Generated/Models/ProfileResourceFormat.cs | 37 +- .../Generated/Models/PropertyDefinition.cs | 40 +- .../Generated/Models/ProvisioningStates.cs | 8 +- .../src/Generated/Models/ProxyResource.cs | 29 +- .../Models/RelationshipLinkFieldMapping.cs | 21 +- .../Models/RelationshipLinkResourceFormat.cs | 39 +- .../Models/RelationshipResourceFormat.cs | 33 +- .../Models/RelationshipTypeFieldMapping.cs | 21 +- .../Models/RelationshipTypeMapping.cs | 21 +- .../Generated/Models/RelationshipsLookup.cs | 31 +- .../src/Generated/Models/Resource.cs | 46 +- .../Models/ResourceSetDescription.cs | 19 +- .../Models/RoleAssignmentResourceFormat.cs | 31 +- .../Generated/Models/RoleResourceFormat.cs | 25 +- .../src/Generated/Models/RoleTypes.cs | 55 +- .../Models/SalesforceConnectorProperties.cs | 21 +- .../Models/SalesforceDiscoverSetting.cs | 21 +- .../src/Generated/Models/SalesforceTable.cs | 21 +- .../src/Generated/Models/Status.cs | 23 + .../src/Generated/Models/StrongId.cs | 21 +- .../SuggestRelationshipLinksResponse.cs | 23 +- .../Generated/Models/TypePropertiesMapping.cs | 59 +- .../Generated/Models/ViewResourceFormat.cs | 33 +- .../Models/WidgetTypeResourceFormat.cs | 33 +- .../src/Generated/Operations.cs | 400 ++++ .../src/Generated/OperationsExtensions.cs | 87 + .../src/Generated/PredictionsOperations.cs | 1711 +++++++++++++++++ .../PredictionsOperationsExtensions.cs | 476 +++++ .../src/Generated/ProfilesOperations.cs | 63 +- .../Generated/ProfilesOperationsExtensions.cs | 15 +- .../Generated/RelationshipLinksOperations.cs | 59 +- .../RelationshipLinksOperationsExtensions.cs | 15 +- .../src/Generated/RelationshipsOperations.cs | 59 +- .../RelationshipsOperationsExtensions.cs | 15 +- .../Generated/RoleAssignmentsOperations.cs | 57 +- .../RoleAssignmentsOperationsExtensions.cs | 13 +- .../src/Generated/RolesOperations.cs | 23 +- .../Generated/RolesOperationsExtensions.cs | 11 +- ...dkInfo_CustomerInsightsManagementClient.cs | 43 + .../src/Generated/ViewsOperations.cs | 65 +- .../Generated/ViewsOperationsExtensions.cs | 29 +- .../src/Generated/WidgetTypesOperations.cs | 29 +- .../WidgetTypesOperationsExtensions.cs | 11 +- 144 files changed, 6891 insertions(+), 1377 deletions(-) create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IOperations.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IPredictionsOperations.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinition.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinitionPropertiesItem.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalPropertyValueType.cs delete mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSource.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourcePrecedence.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityType.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Operation.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/OperationDisplay.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantProfilePropertyReference.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinition.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinitionDistributionsItem.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionGradesItem.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionMappings.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelLifeCycle.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelStatus.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionResourceFormat.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionSystemGeneratedEntities.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionTrainingResults.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Status.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Operations.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/OperationsExtensions.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperations.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperationsExtensions.cs create mode 100644 sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/SdkInfo_CustomerInsightsManagementClient.cs diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/AuthorizationPoliciesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/AuthorizationPoliciesOperations.cs index 5b51d333fd5ae..c0b5e09f8e3f0 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/AuthorizationPoliciesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/AuthorizationPoliciesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -163,9 +163,9 @@ public async Task> Cre _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -199,7 +199,7 @@ public async Task> Cre if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -392,9 +392,9 @@ public async Task> Get _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -588,9 +588,9 @@ public async Task> RegeneratePrimary _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -998,9 +998,9 @@ public async Task> RegenerateSeconda _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1171,9 +1171,9 @@ public async Task // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -289,4 +289,3 @@ public static async Task> ListByHubNext } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperations.cs index 173ac017adc9a..f0f300899132b 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -139,10 +139,6 @@ public async Task> Create { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (parameters == null) - { - parameters = new ConnectorMappingResourceFormat(); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -176,9 +172,9 @@ public async Task> Create _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -212,7 +208,7 @@ public async Task> Create if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -414,9 +410,9 @@ public async Task> GetWit _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -625,9 +621,9 @@ public async Task DeleteWithHttpMessagesAsync(string res _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -681,11 +677,19 @@ public async Task DeleteWithHttpMessagesAsync(string res if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -804,9 +808,9 @@ public async Task>> _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -977,9 +981,9 @@ public async Task>> _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1099,4 +1103,3 @@ public async Task>> } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperationsExtensions.cs index e4fc475eb9a6b..271c06bf5ddf7 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorMappingsOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -179,7 +179,7 @@ public static void Delete(this IConnectorMappingsOperations operations, string r /// public static async Task DeleteAsync(this IConnectorMappingsOperations operations, string resourceGroupName, string hubName, string connectorName, string mappingName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, connectorName, mappingName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, connectorName, mappingName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -264,4 +264,3 @@ public static async Task> ListByConnectorN } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperations.cs index 704c6cc11fe39..ba688ad4ace7f 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -163,9 +163,9 @@ public async Task> GetWithHttpMe _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -384,9 +384,9 @@ public async Task>> ListBy _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -616,9 +616,9 @@ public async Task> BeginCreateOr _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -652,7 +652,7 @@ public async Task> BeginCreateOr if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -824,9 +824,9 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -880,11 +880,19 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -971,9 +979,9 @@ public async Task>> ListBy _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1093,4 +1101,3 @@ public async Task>> ListBy } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperationsExtensions.cs index c04879c66aa1f..3b1f604e77cc9 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ConnectorsOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -159,7 +159,7 @@ public static void Delete(this IConnectorsOperations operations, string resource /// public static async Task DeleteAsync(this IConnectorsOperations operations, string resourceGroupName, string hubName, string connectorName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, connectorName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, connectorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -294,7 +294,7 @@ public static void BeginDelete(this IConnectorsOperations operations, string res /// public static async Task BeginDeleteAsync(this IConnectorsOperations operations, string resourceGroupName, string hubName, string connectorName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, connectorName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, connectorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -333,4 +333,3 @@ public static async Task> ListByHubNextAsync(this } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/CustomerInsightsManagementClient.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/CustomerInsightsManagementClient.cs index b685339196b32..928afb5037a77 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/CustomerInsightsManagementClient.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/CustomerInsightsManagementClient.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; using Models; using Newtonsoft.Json; using System.Collections; @@ -63,22 +63,28 @@ public partial class CustomerInsightsManagementClient : ServiceClient - /// Gets or sets the preferred language for the response. + /// 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. + /// 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. + /// Whether a unique x-ms-client-request-id should be generated. 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 IOperations. + /// + public virtual IOperations Operations { get; private set; } + /// /// Gets the IHubsOperations. /// @@ -154,13 +160,31 @@ public partial class CustomerInsightsManagementClient : ServiceClient public virtual IImagesOperations Images { get; private set; } + /// + /// Gets the IPredictionsOperations. + /// + public virtual IPredictionsOperations Predictions { get; private set; } + + /// + /// Initializes a new instance of the CustomerInsightsManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling CustomerInsightsManagementClient.Dispose(). False: will not dispose provided httpClient + protected CustomerInsightsManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + /// /// Initializes a new instance of the CustomerInsightsManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected CustomerInsightsManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + protected CustomerInsightsManagementClient(params DelegatingHandler[] handlers) : base(handlers) { Initialize(); } @@ -174,7 +198,7 @@ protected CustomerInsightsManagementClient(params System.Net.Http.DelegatingHand /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected CustomerInsightsManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected CustomerInsightsManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { Initialize(); } @@ -191,7 +215,7 @@ protected CustomerInsightsManagementClient(System.Net.Http.HttpClientHandler roo /// /// Thrown when a required parameter is null /// - protected CustomerInsightsManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + protected CustomerInsightsManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -215,7 +239,7 @@ protected CustomerInsightsManagementClient(System.Uri baseUri, params System.Net /// /// Thrown when a required parameter is null /// - protected CustomerInsightsManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected CustomerInsightsManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -236,7 +260,34 @@ protected CustomerInsightsManagementClient(System.Uri baseUri, System.Net.Http.H /// /// Thrown when a required parameter is null /// - public CustomerInsightsManagementClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public CustomerInsightsManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the CustomerInsightsManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling CustomerInsightsManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public CustomerInsightsManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { @@ -264,7 +315,7 @@ public CustomerInsightsManagementClient(ServiceClientCredentials credentials, pa /// /// Thrown when a required parameter is null /// - public CustomerInsightsManagementClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public CustomerInsightsManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { @@ -292,7 +343,7 @@ public CustomerInsightsManagementClient(ServiceClientCredentials credentials, Sy /// /// Thrown when a required parameter is null /// - public CustomerInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public CustomerInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -328,7 +379,7 @@ public CustomerInsightsManagementClient(System.Uri baseUri, ServiceClientCredent /// /// Thrown when a required parameter is null /// - public CustomerInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public CustomerInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -355,6 +406,7 @@ public CustomerInsightsManagementClient(System.Uri baseUri, ServiceClientCredent /// private void Initialize() { + Operations = new Operations(this); Hubs = new HubsOperations(this); Profiles = new ProfilesOperations(this); Interactions = new InteractionsOperations(this); @@ -370,18 +422,19 @@ private void Initialize() Roles = new RolesOperations(this); RoleAssignments = new RoleAssignmentsOperations(this); Images = new ImagesOperations(this); + Predictions = new PredictionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2017-01-01"; + ApiVersion = "2017-04-26"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { - Formatting = Formatting.Indented, - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + 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 ReadOnlyJsonContractResolver(), Converters = new List { @@ -391,10 +444,10 @@ private void Initialize() SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { - DateFormatHandling = DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore, - ReferenceLoopHandling = ReferenceLoopHandling.Serialize, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List { @@ -407,4 +460,3 @@ private void Initialize() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperations.cs index 93efdf9113017..ed978c266e3b6 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -153,9 +153,9 @@ public async Task> CreateOrUpdateWithHttpMessagesAsy _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -189,7 +189,7 @@ public async Task> CreateOrUpdateWithHttpMessagesAsy if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -212,7 +212,7 @@ public async Task> CreateOrUpdateWithHttpMessagesAsy HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 201 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -255,7 +255,7 @@ public async Task> CreateOrUpdateWithHttpMessagesAsy _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -273,7 +273,7 @@ public async Task> CreateOrUpdateWithHttpMessagesAsy } } // Deserialize Response - if ((int)_statusCode == 200) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -381,9 +381,9 @@ public async Task> UpdateWithHttpMessagesAsync(strin _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -417,7 +417,7 @@ public async Task> UpdateWithHttpMessagesAsync(strin if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -605,9 +605,9 @@ public async Task> GetWithHttpMessagesAsync(string r _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -792,9 +792,9 @@ public async Task>> ListByResourceGroupWithHtt _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -970,9 +970,9 @@ public async Task>> ListWithHttpMessagesAsync( _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1163,9 +1163,9 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1219,11 +1219,19 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1310,9 +1318,9 @@ public async Task>> ListByResourceGroupNextWit _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1483,9 +1491,9 @@ public async Task>> ListNextWithHttpMessagesAs _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1605,4 +1613,3 @@ public async Task>> ListNextWithHttpMessagesAs } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperationsExtensions.cs index 6ef2c57c2edb6..db782d74f4c29 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/HubsOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -147,7 +147,7 @@ public static void Delete(this IHubsOperations operations, string resourceGroupN /// public static async Task DeleteAsync(this IHubsOperations operations, string resourceGroupName, string hubName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -286,7 +286,7 @@ public static void BeginDelete(this IHubsOperations operations, string resourceG /// public static async Task BeginDeleteAsync(this IHubsOperations operations, string resourceGroupName, string hubName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -359,4 +359,3 @@ public static async Task> ListNextAsync(this IHubsOperations operatio } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IAuthorizationPoliciesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IAuthorizationPoliciesOperations.cs index 9284576bd745d..05cd27e9b6cf4 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IAuthorizationPoliciesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IAuthorizationPoliciesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -191,4 +191,3 @@ public partial interface IAuthorizationPoliciesOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorMappingsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorMappingsOperations.cs index dd9fdc6bb0c19..6866d75ae6f89 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorMappingsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorMappingsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -170,4 +170,3 @@ public partial interface IConnectorMappingsOperations Task>> ListByConnectorNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorsOperations.cs index e7549ac774dc5..bfd29e1040af0 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IConnectorsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -212,4 +212,3 @@ public partial interface IConnectorsOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ICustomerInsightsManagementClient.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ICustomerInsightsManagementClient.cs index 79537b28e2daa..ac6c91c64c15d 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ICustomerInsightsManagementClient.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ICustomerInsightsManagementClient.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; @@ -57,23 +57,29 @@ public partial interface ICustomerInsightsManagementClient : System.IDisposable string ApiVersion { get; } /// - /// Gets or sets the preferred language for the response. + /// 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. + /// 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. + /// Whether a unique x-ms-client-request-id should be generated. 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 IOperations. + /// + IOperations Operations { get; } + /// /// Gets the IHubsOperations. /// @@ -149,6 +155,10 @@ public partial interface ICustomerInsightsManagementClient : System.IDisposable /// IImagesOperations Images { get; } + /// + /// Gets the IPredictionsOperations. + /// + IPredictionsOperations Predictions { get; } + } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IHubsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IHubsOperations.cs index aaaa716d02901..846e86036b66d 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IHubsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IHubsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -235,4 +235,3 @@ public partial interface IHubsOperations Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IImagesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IImagesOperations.cs index dac4016a7d84d..9590d75ea2dc7 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IImagesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IImagesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -81,4 +81,3 @@ public partial interface IImagesOperations Task> GetUploadUrlForDataWithHttpMessagesAsync(string resourceGroupName, string hubName, GetImageUploadUrlInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IInteractionsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IInteractionsOperations.cs index d2d43c78069fc..3a59c4814fa46 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IInteractionsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IInteractionsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -198,4 +198,3 @@ public partial interface IInteractionsOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IKpiOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IKpiOperations.cs index ab5028e89127b..fa4c620ca3040 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IKpiOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IKpiOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -237,4 +237,3 @@ public partial interface IKpiOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ILinksOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ILinksOperations.cs index 44aaff6746bde..beeee448bd1a4 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ILinksOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ILinksOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -187,4 +187,3 @@ public partial interface ILinksOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IOperations.cs new file mode 100644 index 0000000000000..24dce0b5144d4 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IOperations.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// 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 + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// 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 + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IPredictionsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IPredictionsOperations.cs new file mode 100644 index 0000000000000..164dc5e5de322 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IPredictionsOperations.cs @@ -0,0 +1,299 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PredictionsOperations operations. + /// + public partial interface IPredictionsOperations + { + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction 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 + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// 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 + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// 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 + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets training results. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// 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 + /// + Task> GetTrainingResultsWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets model status of the prediction. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// 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 + /// + Task> GetModelStatusWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the model status of prediction. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update prediction model status + /// operation. + /// + /// + /// 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 + /// + Task ModelStatusWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, PredictionModelStatus parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// 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 + /// + Task>> ListByHubWithHttpMessagesAsync(string resourceGroupName, string hubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction 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 + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// 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 + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// 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 + /// + Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IProfilesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IProfilesOperations.cs index b6e6507d9b234..e43a2e903410e 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IProfilesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IProfilesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -255,4 +255,3 @@ public partial interface IProfilesOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipLinksOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipLinksOperations.cs index 8fe469f382005..ff04b9337bc91 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipLinksOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipLinksOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -216,4 +216,3 @@ public partial interface IRelationshipLinksOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipsOperations.cs index 203097ff22702..b71767cc6c370 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRelationshipsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -214,4 +214,3 @@ public partial interface IRelationshipsOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRoleAssignmentsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRoleAssignmentsOperations.cs index 29e47e9132be4..76192e1dccebf 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRoleAssignmentsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRoleAssignmentsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -187,4 +187,3 @@ public partial interface IRoleAssignmentsOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRolesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRolesOperations.cs index 236dd30f1ca10..e54f7f2f365e6 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRolesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IRolesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -72,4 +72,3 @@ public partial interface IRolesOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IViewsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IViewsOperations.cs index 813e6d7e8f617..4dcaf082a6dd5 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IViewsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IViewsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -33,7 +33,7 @@ public partial interface IViewsOperations /// The name of the hub. /// /// - /// The user ID. Use * to retreive hub level views. + /// The user ID. Use * to retrieve hub level views. /// /// /// The headers that will be added to request. @@ -52,7 +52,7 @@ public partial interface IViewsOperations /// Task>> ListByHubWithHttpMessagesAsync(string resourceGroupName, string hubName, string userId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a view or updates an exisiting view in the hub. + /// Creates a view or updates an existing view in the hub. /// /// /// The name of the resource group. @@ -95,7 +95,7 @@ public partial interface IViewsOperations /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// /// /// The headers that will be added to request. @@ -126,7 +126,7 @@ public partial interface IViewsOperations /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// /// /// The headers that will be added to request. @@ -165,4 +165,3 @@ public partial interface IViewsOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IWidgetTypesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IWidgetTypesOperations.cs index 998b63907687f..1f5b9f5a48060 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IWidgetTypesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/IWidgetTypesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -100,4 +100,3 @@ public partial interface IWidgetTypesOperations Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperations.cs index 720e451132757..d65b421a6a742 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -134,9 +134,9 @@ public async Task> GetUploadUrlForEntity _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -170,7 +170,7 @@ public async Task> GetUploadUrlForEntity if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -344,9 +344,9 @@ public async Task> GetUploadUrlForDataWi _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -380,7 +380,7 @@ public async Task> GetUploadUrlForDataWi if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -472,4 +472,3 @@ public async Task> GetUploadUrlForDataWi } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperationsExtensions.cs index 0e8ed7dc0f791..701a99e932047 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ImagesOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -115,4 +115,3 @@ public static async Task GetUploadUrlForDataAsync(this IImagesO } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperations.cs index f6df21aa0f825..5df968b478180 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -171,9 +171,9 @@ public async Task> GetWithHttp _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -375,9 +375,9 @@ public async Task>> List _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -580,9 +580,9 @@ public async Task> Sugg _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -808,9 +808,9 @@ public async Task> BeginCreate _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -844,7 +844,7 @@ public async Task> BeginCreate if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -987,9 +987,9 @@ public async Task>> List _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1109,4 +1109,3 @@ public async Task>> List } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperationsExtensions.cs index 7530b06a19fc9..d3310f0c97fa0 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/InteractionsOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -305,4 +305,3 @@ public static async Task> ListByHubNextAsync(th } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperations.cs index ec35b3fbff24a..313970308add2 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -163,9 +163,9 @@ public async Task> GetWithHttpMessages _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -390,9 +390,9 @@ public async Task ReprocessWithHttpMessagesAsync(string _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -446,11 +446,19 @@ public async Task ReprocessWithHttpMessagesAsync(string if ((int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -560,9 +568,9 @@ public async Task>> ListByHubWit _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -792,9 +800,9 @@ public async Task> BeginCreateOrUpdate _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -828,7 +836,7 @@ public async Task> BeginCreateOrUpdate if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -1000,9 +1008,9 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1056,11 +1064,19 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1147,9 +1163,9 @@ public async Task>> ListByHubNex _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1269,4 +1285,3 @@ public async Task>> ListByHubNex } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperationsExtensions.cs index 9dab072030897..6563ee89924cb 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/KpiOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -159,7 +159,7 @@ public static void Delete(this IKpiOperations operations, string resourceGroupNa /// public static async Task DeleteAsync(this IKpiOperations operations, string resourceGroupName, string hubName, string kpiName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, kpiName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, kpiName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -202,7 +202,7 @@ public static void Reprocess(this IKpiOperations operations, string resourceGrou /// public static async Task ReprocessAsync(this IKpiOperations operations, string resourceGroupName, string hubName, string kpiName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.ReprocessWithHttpMessagesAsync(resourceGroupName, hubName, kpiName, null, cancellationToken).ConfigureAwait(false); + (await operations.ReprocessWithHttpMessagesAsync(resourceGroupName, hubName, kpiName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -337,7 +337,7 @@ public static void BeginDelete(this IKpiOperations operations, string resourceGr /// public static async Task BeginDeleteAsync(this IKpiOperations operations, string resourceGroupName, string hubName, string kpiName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, kpiName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, kpiName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -376,4 +376,3 @@ public static async Task> ListByHubNextAsync(this IKpiO } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperations.cs index 171c73a51fbe6..11df5c7f240e8 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -163,9 +163,9 @@ public async Task> GetWithHttpMessage _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -365,9 +365,9 @@ public async Task DeleteWithHttpMessagesAsync(string res _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -421,11 +421,19 @@ public async Task DeleteWithHttpMessagesAsync(string res if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -535,9 +543,9 @@ public async Task>> ListByHubWi _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -767,9 +775,9 @@ public async Task> BeginCreateOrUpdat _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -803,7 +811,7 @@ public async Task> BeginCreateOrUpdat if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -946,9 +954,9 @@ public async Task>> ListByHubNe _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1068,4 +1076,3 @@ public async Task>> ListByHubNe } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperationsExtensions.cs index b7293232ce6b4..4f8f315fdf9a7 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/LinksOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -159,7 +159,7 @@ public static void Delete(this ILinksOperations operations, string resourceGroup /// public static async Task DeleteAsync(this ILinksOperations operations, string resourceGroupName, string hubName, string linkName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, linkName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, linkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -290,4 +290,3 @@ public static async Task> ListByHubNextAsync(this ILin } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AssignmentPrincipal.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AssignmentPrincipal.cs index c68afc83245a6..e13f758c16ff8 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AssignmentPrincipal.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AssignmentPrincipal.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class AssignmentPrincipal /// /// Initializes a new instance of the AssignmentPrincipal class. /// - public AssignmentPrincipal() { } + public AssignmentPrincipal() + { + CustomInit(); + } /// /// Initializes a new instance of the AssignmentPrincipal class. @@ -40,8 +42,14 @@ public AssignmentPrincipal(string principalId, string principalType, IDictionary PrincipalId = principalId; PrincipalType = principalType; PrincipalMetadata = principalMetadata; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the principal id being assigned to. /// @@ -79,4 +87,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicy.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicy.cs index a0651cbbe31ce..ac1a6e6a5c9ed 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicy.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicy.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class AuthorizationPolicy /// /// Initializes a new instance of the AuthorizationPolicy class. /// - public AuthorizationPolicy() { } + public AuthorizationPolicy() + { + CustomInit(); + } /// /// Initializes a new instance of the AuthorizationPolicy class. @@ -33,9 +35,9 @@ public partial class AuthorizationPolicy /// The permissions associated with the /// policy. /// Name of the policy. - /// Primary key assiciated with the + /// Primary key associated with the /// policy. - /// Secondary key assiciated with the + /// Secondary key associated with the /// policy. public AuthorizationPolicy(IList permissions, string policyName = default(string), string primaryKey = default(string), string secondaryKey = default(string)) { @@ -43,13 +45,19 @@ public AuthorizationPolicy(IList permissions, string policyNam Permissions = permissions; PrimaryKey = primaryKey; SecondaryKey = secondaryKey; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets name of the policy. /// [JsonProperty(PropertyName = "policyName")] - public string PolicyName { get; protected set; } + public string PolicyName { get; private set; } /// /// Gets or sets the permissions associated with the policy. @@ -58,13 +66,13 @@ public AuthorizationPolicy(IList permissions, string policyNam public IList Permissions { get; set; } /// - /// Gets or sets primary key assiciated with the policy. + /// Gets or sets primary key associated with the policy. /// [JsonProperty(PropertyName = "primaryKey")] public string PrimaryKey { get; set; } /// - /// Gets or sets secondary key assiciated with the policy. + /// Gets or sets secondary key associated with the policy. /// [JsonProperty(PropertyName = "secondaryKey")] public string SecondaryKey { get; set; } @@ -83,7 +91,7 @@ public virtual void Validate() } if (Permissions != null) { - if (Permissions.Count != Permissions.Distinct().Count()) + if (Permissions.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(Permissions))) { throw new ValidationException(ValidationRules.UniqueItems, "Permissions"); } @@ -91,4 +99,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicyResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicyResourceFormat.cs index 5b731906694b9..c8a01b479befd 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicyResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AuthorizationPolicyResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,14 +20,17 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The authorization policy resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class AuthorizationPolicyResourceFormat : ProxyResource { /// /// Initializes a new instance of the AuthorizationPolicyResourceFormat /// class. /// - public AuthorizationPolicyResourceFormat() { } + public AuthorizationPolicyResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the AuthorizationPolicyResourceFormat @@ -40,9 +42,9 @@ public partial class AuthorizationPolicyResourceFormat : ProxyResource /// Resource name. /// Resource type. /// Name of the policy. - /// Primary key assiciated with the + /// Primary key associated with the /// policy. - /// Secondary key assiciated with the + /// Secondary key associated with the /// policy. public AuthorizationPolicyResourceFormat(IList permissions, string id = default(string), string name = default(string), string type = default(string), string policyName = default(string), string primaryKey = default(string), string secondaryKey = default(string)) : base(id, name, type) @@ -51,13 +53,19 @@ public AuthorizationPolicyResourceFormat(IList permissions, st Permissions = permissions; PrimaryKey = primaryKey; SecondaryKey = secondaryKey; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets name of the policy. /// [JsonProperty(PropertyName = "properties.policyName")] - public string PolicyName { get; protected set; } + public string PolicyName { get; private set; } /// /// Gets or sets the permissions associated with the policy. @@ -66,13 +74,13 @@ public AuthorizationPolicyResourceFormat(IList permissions, st public IList Permissions { get; set; } /// - /// Gets or sets primary key assiciated with the policy. + /// Gets or sets primary key associated with the policy. /// [JsonProperty(PropertyName = "properties.primaryKey")] public string PrimaryKey { get; set; } /// - /// Gets or sets secondary key assiciated with the policy. + /// Gets or sets secondary key associated with the policy. /// [JsonProperty(PropertyName = "properties.secondaryKey")] public string SecondaryKey { get; set; } @@ -91,7 +99,7 @@ public virtual void Validate() } if (Permissions != null) { - if (Permissions.Count != Permissions.Distinct().Count()) + if (Permissions.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(Permissions))) { throw new ValidationException(ValidationRules.UniqueItems, "Permissions"); } @@ -99,4 +107,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AzureBlobConnectorProperties.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AzureBlobConnectorProperties.cs index 45604c7ccac35..7af0f7d5084aa 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AzureBlobConnectorProperties.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/AzureBlobConnectorProperties.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -24,7 +23,10 @@ public partial class AzureBlobConnectorProperties /// Initializes a new instance of the AzureBlobConnectorProperties /// class. /// - public AzureBlobConnectorProperties() { } + public AzureBlobConnectorProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the AzureBlobConnectorProperties @@ -35,8 +37,14 @@ public partial class AzureBlobConnectorProperties public AzureBlobConnectorProperties(string connectionKeyVaultUrl) { ConnectionKeyVaultUrl = connectionKeyVaultUrl; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the connection KeyVault URL. /// @@ -58,4 +66,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CalculationWindowTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CalculationWindowTypes.cs index 322a70b4ce444..da7340b7a5e92 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CalculationWindowTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CalculationWindowTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -33,5 +32,47 @@ public enum CalculationWindowTypes [EnumMember(Value = "Month")] Month } -} + internal static class CalculationWindowTypesEnumExtension + { + internal static string ToSerializedValue(this CalculationWindowTypes? value) + { + return value == null ? null : ((CalculationWindowTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CalculationWindowTypes value) + { + switch( value ) + { + case CalculationWindowTypes.Lifetime: + return "Lifetime"; + case CalculationWindowTypes.Hour: + return "Hour"; + case CalculationWindowTypes.Day: + return "Day"; + case CalculationWindowTypes.Week: + return "Week"; + case CalculationWindowTypes.Month: + return "Month"; + } + return null; + } + internal static CalculationWindowTypes? ParseCalculationWindowTypes(this string value) + { + switch( value ) + { + case "Lifetime": + return CalculationWindowTypes.Lifetime; + case "Hour": + return CalculationWindowTypes.Hour; + case "Day": + return CalculationWindowTypes.Day; + case "Week": + return CalculationWindowTypes.Week; + case "Month": + return CalculationWindowTypes.Month; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinition.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinition.cs new file mode 100644 index 0000000000000..f8e879cfbb335 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinition.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Definition of canonical profile. + /// + public partial class CanonicalProfileDefinition + { + /// + /// Initializes a new instance of the CanonicalProfileDefinition class. + /// + public CanonicalProfileDefinition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CanonicalProfileDefinition class. + /// + /// Canonical profile ID. + /// Properties of the canonical + /// profile. + public CanonicalProfileDefinition(int? canonicalProfileId = default(int?), IList properties = default(IList)) + { + CanonicalProfileId = canonicalProfileId; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets canonical profile ID. + /// + [JsonProperty(PropertyName = "canonicalProfileId")] + public int? CanonicalProfileId { get; set; } + + /// + /// Gets or sets properties of the canonical profile. + /// + [JsonProperty(PropertyName = "properties")] + public IList Properties { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinitionPropertiesItem.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinitionPropertiesItem.cs new file mode 100644 index 0000000000000..1674ab9c12aa5 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalProfileDefinitionPropertiesItem.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The definition of a canonical profile property. + /// + public partial class CanonicalProfileDefinitionPropertiesItem + { + /// + /// Initializes a new instance of the + /// CanonicalProfileDefinitionPropertiesItem class. + /// + public CanonicalProfileDefinitionPropertiesItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CanonicalProfileDefinitionPropertiesItem class. + /// + /// Profile name. + /// Property name of profile. + /// The rank. + /// Type of canonical property value. Possible + /// values include: 'Numeric', 'Categorical', 'DerivedCategorical', + /// 'DerivedNumeric' + /// Value of the canonical property. + public CanonicalProfileDefinitionPropertiesItem(string profileName = default(string), string profilePropertyName = default(string), int? rank = default(int?), string type = default(string), string value = default(string)) + { + ProfileName = profileName; + ProfilePropertyName = profilePropertyName; + Rank = rank; + Type = type; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets profile name. + /// + [JsonProperty(PropertyName = "profileName")] + public string ProfileName { get; set; } + + /// + /// Gets or sets property name of profile. + /// + [JsonProperty(PropertyName = "profilePropertyName")] + public string ProfilePropertyName { get; set; } + + /// + /// Gets or sets the rank. + /// + [JsonProperty(PropertyName = "rank")] + public int? Rank { get; set; } + + /// + /// Gets or sets type of canonical property value. Possible values + /// include: 'Numeric', 'Categorical', 'DerivedCategorical', + /// 'DerivedNumeric' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets value of the canonical property. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalPropertyValueType.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalPropertyValueType.cs new file mode 100644 index 0000000000000..8c05f4c199f93 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CanonicalPropertyValueType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + + /// + /// Defines values for CanonicalPropertyValueType. + /// + public static class CanonicalPropertyValueType + { + public const string Numeric = "Numeric"; + public const string Categorical = "Categorical"; + public const string DerivedCategorical = "DerivedCategorical"; + public const string DerivedNumeric = "DerivedNumeric"; + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CardinalityTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CardinalityTypes.cs index 35adc12bb7914..4abbf89b9358c 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CardinalityTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CardinalityTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -29,5 +28,39 @@ public enum CardinalityTypes [EnumMember(Value = "ManyToMany")] ManyToMany } -} + internal static class CardinalityTypesEnumExtension + { + internal static string ToSerializedValue(this CardinalityTypes? value) + { + return value == null ? null : ((CardinalityTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CardinalityTypes value) + { + switch( value ) + { + case CardinalityTypes.OneToOne: + return "OneToOne"; + case CardinalityTypes.OneToMany: + return "OneToMany"; + case CardinalityTypes.ManyToMany: + return "ManyToMany"; + } + return null; + } + internal static CardinalityTypes? ParseCardinalityTypes(this string value) + { + switch( value ) + { + case "OneToOne": + return CardinalityTypes.OneToOne; + case "OneToMany": + return CardinalityTypes.OneToMany; + case "ManyToMany": + return CardinalityTypes.ManyToMany; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CompletionOperationTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CompletionOperationTypes.cs index 2f692a311bb25..2eedbbf3fcb46 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CompletionOperationTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CompletionOperationTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -29,5 +28,39 @@ public enum CompletionOperationTypes [EnumMember(Value = "MoveFile")] MoveFile } -} + internal static class CompletionOperationTypesEnumExtension + { + internal static string ToSerializedValue(this CompletionOperationTypes? value) + { + return value == null ? null : ((CompletionOperationTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this CompletionOperationTypes value) + { + switch( value ) + { + case CompletionOperationTypes.DoNothing: + return "DoNothing"; + case CompletionOperationTypes.DeleteFile: + return "DeleteFile"; + case CompletionOperationTypes.MoveFile: + return "MoveFile"; + } + return null; + } + internal static CompletionOperationTypes? ParseCompletionOperationTypes(this string value) + { + switch( value ) + { + case "DoNothing": + return CompletionOperationTypes.DoNothing; + case "DeleteFile": + return CompletionOperationTypes.DeleteFile; + case "MoveFile": + return CompletionOperationTypes.MoveFile; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingAvailability.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingAvailability.cs index d071f2b6b727f..a09d5aa03c4c0 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingAvailability.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingAvailability.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class ConnectorMappingAvailability /// Initializes a new instance of the ConnectorMappingAvailability /// class. /// - public ConnectorMappingAvailability() { } + public ConnectorMappingAvailability() + { + CustomInit(); + } /// /// Initializes a new instance of the ConnectorMappingAvailability @@ -37,8 +39,14 @@ public ConnectorMappingAvailability(int interval, FrequencyTypes? frequency = de { Frequency = frequency; Interval = interval; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the frequency to update. Possible values include: /// 'Minute', 'Hour', 'Day', 'Week', 'Month' @@ -63,4 +71,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingCompleteOperation.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingCompleteOperation.cs index 987f16e10a1bb..fa482d29dba06 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingCompleteOperation.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingCompleteOperation.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class ConnectorMappingCompleteOperation /// Initializes a new instance of the ConnectorMappingCompleteOperation /// class. /// - public ConnectorMappingCompleteOperation() { } + public ConnectorMappingCompleteOperation() + { + CustomInit(); + } /// /// Initializes a new instance of the ConnectorMappingCompleteOperation @@ -38,8 +40,14 @@ public ConnectorMappingCompleteOperation(CompletionOperationTypes? completionOpe { CompletionOperationType = completionOperationType; DestinationFolder = destinationFolder; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the type of completion operation. Possible values /// include: 'DoNothing', 'DeleteFile', 'MoveFile' @@ -56,4 +64,3 @@ public ConnectorMappingCompleteOperation(CompletionOperationTypes? completionOpe } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingErrorManagement.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingErrorManagement.cs index 43834cdb69efb..627a70a5fe394 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingErrorManagement.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingErrorManagement.cs @@ -1,21 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Linq; /// - /// The error mangement. + /// The error management. /// public partial class ConnectorMappingErrorManagement { @@ -23,7 +22,10 @@ public partial class ConnectorMappingErrorManagement /// Initializes a new instance of the ConnectorMappingErrorManagement /// class. /// - public ConnectorMappingErrorManagement() { } + public ConnectorMappingErrorManagement() + { + CustomInit(); + } /// /// Initializes a new instance of the ConnectorMappingErrorManagement @@ -38,8 +40,14 @@ public ConnectorMappingErrorManagement(ErrorManagementTypes errorManagementType, { ErrorManagementType = errorManagementType; ErrorLimit = errorLimit; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the type of error management to use for the mapping. /// Possible values include: 'RejectAndContinue', 'StopImport', @@ -65,4 +73,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingFormat.cs index 022d00197c7fe..d4763e4b2195c 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingFormat.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Linq; @@ -22,7 +21,10 @@ public partial class ConnectorMappingFormat /// /// Initializes a new instance of the ConnectorMappingFormat class. /// - public ConnectorMappingFormat() { } + public ConnectorMappingFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the ConnectorMappingFormat class. @@ -43,6 +45,7 @@ public ConnectorMappingFormat(string columnDelimiter = default(string), string a QuoteCharacter = quoteCharacter; QuoteEscapeCharacter = quoteEscapeCharacter; ArraySeparator = arraySeparator; + CustomInit(); } /// /// Static constructor for ConnectorMappingFormat class. @@ -52,6 +55,11 @@ static ConnectorMappingFormat() FormatType = "TextFormat"; } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the character that signifies a break between columns. /// @@ -91,4 +99,3 @@ static ConnectorMappingFormat() } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingProperties.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingProperties.cs index d694e1d440f23..a3ecc3332c120 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingProperties.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingProperties.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -28,6 +27,7 @@ public partial class ConnectorMappingProperties public ConnectorMappingProperties() { Format = new ConnectorMappingFormat(); + CustomInit(); } /// @@ -48,7 +48,6 @@ public ConnectorMappingProperties() /// not. public ConnectorMappingProperties(ConnectorMappingErrorManagement errorManagement, ConnectorMappingFormat format, ConnectorMappingAvailability availability, IList structure, ConnectorMappingCompleteOperation completeOperation, string folderPath = default(string), string fileFilter = default(string), bool? hasHeader = default(bool?)) { - Format = new ConnectorMappingFormat(); FolderPath = folderPath; FileFilter = fileFilter; HasHeader = hasHeader; @@ -57,8 +56,14 @@ public ConnectorMappingProperties(ConnectorMappingErrorManagement errorManagemen Availability = availability; Structure = structure; CompleteOperation = completeOperation; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the folder path for the mapping. /// @@ -156,4 +161,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingResourceFormat.cs index a1241b81af770..9c0a2e5a40edd 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingResourceFormat.cs @@ -1,25 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; /// - /// The c onnector mapping resource format. + /// The connector mapping resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class ConnectorMappingResourceFormat : ProxyResource { /// @@ -29,6 +28,7 @@ public partial class ConnectorMappingResourceFormat : ProxyResource public ConnectorMappingResourceFormat() { MappingProperties = new ConnectorMappingProperties(); + CustomInit(); } /// @@ -49,7 +49,7 @@ public ConnectorMappingResourceFormat() /// include: 'None', 'CRM', 'AzureBlob', 'Salesforce', /// 'ExchangeOnline', 'Outbound' /// The created time. - /// The last monified time. + /// The last modified time. /// The connector mapping /// name /// Display name for the connector @@ -67,7 +67,6 @@ public ConnectorMappingResourceFormat() public ConnectorMappingResourceFormat(EntityTypes entityType, string entityTypeName, ConnectorMappingProperties mappingProperties, string id = default(string), string name = default(string), string type = default(string), string connectorName = default(string), string connectorType = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? lastModified = default(System.DateTime?), string connectorMappingName = default(string), string displayName = default(string), string description = default(string), string dataFormatId = default(string), System.DateTime? nextRunTime = default(System.DateTime?), string runId = default(string), ConnectorMappingStates? state = default(ConnectorMappingStates?), string tenantId = default(string)) : base(id, name, type) { - MappingProperties = new ConnectorMappingProperties(); ConnectorName = connectorName; ConnectorType = connectorType; Created = created; @@ -83,13 +82,19 @@ public ConnectorMappingResourceFormat(EntityTypes entityType, string entityTypeN RunId = runId; State = state; TenantId = tenantId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the connector name. /// [JsonProperty(PropertyName = "properties.connectorName")] - public string ConnectorName { get; protected set; } + public string ConnectorName { get; private set; } /// /// Gets or sets type of connector. Possible values include: 'None', @@ -102,13 +107,13 @@ public ConnectorMappingResourceFormat(EntityTypes entityType, string entityTypeN /// Gets the created time. /// [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; protected set; } + public System.DateTime? Created { get; private set; } /// - /// Gets the last monified time. + /// Gets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModified")] - public System.DateTime? LastModified { get; protected set; } + public System.DateTime? LastModified { get; private set; } /// /// Gets or sets defines which entity type the file should map to. @@ -128,7 +133,7 @@ public ConnectorMappingResourceFormat(EntityTypes entityType, string entityTypeN /// Gets the connector mapping name /// [JsonProperty(PropertyName = "properties.connectorMappingName")] - public string ConnectorMappingName { get; protected set; } + public string ConnectorMappingName { get; private set; } /// /// Gets or sets display name for the connector mapping. @@ -146,7 +151,7 @@ public ConnectorMappingResourceFormat(EntityTypes entityType, string entityTypeN /// Gets the DataFormat ID. /// [JsonProperty(PropertyName = "properties.dataFormatId")] - public string DataFormatId { get; protected set; } + public string DataFormatId { get; private set; } /// /// Gets or sets the properties of the mapping. @@ -158,13 +163,13 @@ public ConnectorMappingResourceFormat(EntityTypes entityType, string entityTypeN /// Gets the next run time based on customer's settings. /// [JsonProperty(PropertyName = "properties.nextRunTime")] - public System.DateTime? NextRunTime { get; protected set; } + public System.DateTime? NextRunTime { get; private set; } /// /// Gets the RunId. /// [JsonProperty(PropertyName = "properties.runId")] - public string RunId { get; protected set; } + public string RunId { get; private set; } /// /// Gets state of connector mapping. Possible values include: @@ -172,13 +177,13 @@ public ConnectorMappingResourceFormat(EntityTypes entityType, string entityTypeN /// 'Expiring' /// [JsonProperty(PropertyName = "properties.state")] - public ConnectorMappingStates? State { get; protected set; } + public ConnectorMappingStates? State { get; private set; } /// /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Validate the object. @@ -203,4 +208,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStates.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStates.cs index c67d5bff1644b..716371f1d9ff5 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStates.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStates.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -37,5 +36,55 @@ public enum ConnectorMappingStates [EnumMember(Value = "Expiring")] Expiring } -} + internal static class ConnectorMappingStatesEnumExtension + { + internal static string ToSerializedValue(this ConnectorMappingStates? value) + { + return value == null ? null : ((ConnectorMappingStates)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ConnectorMappingStates value) + { + switch( value ) + { + case ConnectorMappingStates.Creating: + return "Creating"; + case ConnectorMappingStates.Created: + return "Created"; + case ConnectorMappingStates.Failed: + return "Failed"; + case ConnectorMappingStates.Ready: + return "Ready"; + case ConnectorMappingStates.Running: + return "Running"; + case ConnectorMappingStates.Stopped: + return "Stopped"; + case ConnectorMappingStates.Expiring: + return "Expiring"; + } + return null; + } + internal static ConnectorMappingStates? ParseConnectorMappingStates(this string value) + { + switch( value ) + { + case "Creating": + return ConnectorMappingStates.Creating; + case "Created": + return ConnectorMappingStates.Created; + case "Failed": + return ConnectorMappingStates.Failed; + case "Ready": + return ConnectorMappingStates.Ready; + case "Running": + return ConnectorMappingStates.Running; + case "Stopped": + return ConnectorMappingStates.Stopped; + case "Expiring": + return ConnectorMappingStates.Expiring; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStructure.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStructure.cs index e27e4c5ab36b7..1641f93241088 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStructure.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorMappingStructure.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class ConnectorMappingStructure /// /// Initializes a new instance of the ConnectorMappingStructure class. /// - public ConnectorMappingStructure() { } + public ConnectorMappingStructure() + { + CustomInit(); + } /// /// Initializes a new instance of the ConnectorMappingStructure class. @@ -42,8 +44,14 @@ public ConnectorMappingStructure(string propertyName, string columnName, string ColumnName = columnName; CustomFormatSpecifier = customFormatSpecifier; IsEncrypted = isEncrypted; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the property name of the mapping entity. /// @@ -87,4 +95,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorResourceFormat.cs index 29119081b19b4..95d6f53746c42 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,13 +20,16 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The connector resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class ConnectorResourceFormat : ProxyResource { /// /// Initializes a new instance of the ConnectorResourceFormat class. /// - public ConnectorResourceFormat() { } + public ConnectorResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the ConnectorResourceFormat class. @@ -44,7 +46,7 @@ public partial class ConnectorResourceFormat : ProxyResource /// Display name of the connector. /// Description of the connector. /// The created time. - /// The last monified time. + /// The last modified time. /// State of connector. Possible values include: /// 'Creating', 'Created', 'Ready', 'Expiring', 'Deleting', /// 'Failed' @@ -64,13 +66,19 @@ public ConnectorResourceFormat(string connectorType, IDictionary State = state; TenantId = tenantId; IsInternal = isInternal; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets ID of the connector. /// [JsonProperty(PropertyName = "properties.connectorId")] - public int? ConnectorId { get; protected set; } + public int? ConnectorId { get; private set; } /// /// Gets or sets name of the connector. @@ -107,26 +115,26 @@ public ConnectorResourceFormat(string connectorType, IDictionary /// Gets the created time. /// [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; protected set; } + public System.DateTime? Created { get; private set; } /// - /// Gets the last monified time. + /// Gets the last modified time. /// [JsonProperty(PropertyName = "properties.lastModified")] - public System.DateTime? LastModified { get; protected set; } + public System.DateTime? LastModified { get; private set; } /// /// Gets state of connector. Possible values include: 'Creating', /// 'Created', 'Ready', 'Expiring', 'Deleting', 'Failed' /// [JsonProperty(PropertyName = "properties.state")] - public ConnectorStates? State { get; protected set; } + public ConnectorStates? State { get; private set; } /// /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets or sets if this is an internal connector. @@ -153,4 +161,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorStates.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorStates.cs index 85a86b98b6267..a87b1a5d2ac4a 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorStates.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorStates.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -35,5 +34,51 @@ public enum ConnectorStates [EnumMember(Value = "Failed")] Failed } -} + internal static class ConnectorStatesEnumExtension + { + internal static string ToSerializedValue(this ConnectorStates? value) + { + return value == null ? null : ((ConnectorStates)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ConnectorStates value) + { + switch( value ) + { + case ConnectorStates.Creating: + return "Creating"; + case ConnectorStates.Created: + return "Created"; + case ConnectorStates.Ready: + return "Ready"; + case ConnectorStates.Expiring: + return "Expiring"; + case ConnectorStates.Deleting: + return "Deleting"; + case ConnectorStates.Failed: + return "Failed"; + } + return null; + } + internal static ConnectorStates? ParseConnectorStates(this string value) + { + switch( value ) + { + case "Creating": + return ConnectorStates.Creating; + case "Created": + return ConnectorStates.Created; + case "Ready": + return ConnectorStates.Ready; + case "Expiring": + return ConnectorStates.Expiring; + case "Deleting": + return ConnectorStates.Deleting; + case "Failed": + return ConnectorStates.Failed; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorTypes.cs index 4b2d186d291cf..4ab860331fe41 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ConnectorTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; /// /// Defines values for ConnectorTypes. @@ -25,4 +24,3 @@ public static class ConnectorTypes public const string Outbound = "Outbound"; } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorEntities.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorEntities.cs index f67caf309d7a6..87726564ac67b 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorEntities.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorEntities.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class CrmConnectorEntities /// /// Initializes a new instance of the CrmConnectorEntities class. /// - public CrmConnectorEntities() { } + public CrmConnectorEntities() + { + CustomInit(); + } /// /// Initializes a new instance of the CrmConnectorEntities class. @@ -36,8 +38,14 @@ public CrmConnectorEntities(string logicalName, string displayName = default(str LogicalName = logicalName; DisplayName = displayName; IsProfile = isProfile; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the logical name. /// @@ -71,4 +79,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorProperties.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorProperties.cs index 6735dcbc65f93..eae16cfa1ee11 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorProperties.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/CrmConnectorProperties.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class CrmConnectorProperties /// /// Initializes a new instance of the CrmConnectorProperties class. /// - public CrmConnectorProperties() { } + public CrmConnectorProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the CrmConnectorProperties class. @@ -43,8 +45,14 @@ public CrmConnectorProperties(string organizationId, string organizationUrl, ILi OrganizationUrl = organizationUrl; Entities = entities; AccessToken = accessToken; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the connection string. /// @@ -108,4 +116,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSource.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSource.cs deleted file mode 100644 index 532fff93ebad5..0000000000000 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSource.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 1.0.0.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. - -namespace Microsoft.Azure.Management.CustomerInsights.Models -{ - using Azure; - using Management; - using CustomerInsights; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Data Source is a way for us to know the source of instances. A single - /// type can have data coming in from multiple places. In activities we use - /// this to determine precedence rules. - /// - public partial class DataSource - { - /// - /// Initializes a new instance of the DataSource class. - /// - public DataSource() { } - - /// - /// Initializes a new instance of the DataSource class. - /// - /// The data source type. Possible values - /// include: 'ConnectorMapping', 'LinkInteraction', - /// 'SystemDefault' - /// The data source ID. - /// The Link ID if the data source type is - /// LinkInteraction. - /// The Connector Mapping ID if the - /// data source type is ConnectorMapping. - public DataSource(string dataSourceType = default(string), string id = default(string), string linkId = default(string), string connectorMappingId = default(string)) - { - DataSourceType = dataSourceType; - Id = id; - LinkId = linkId; - ConnectorMappingId = connectorMappingId; - } - - /// - /// Gets the data source type. Possible values include: - /// 'ConnectorMapping', 'LinkInteraction', 'SystemDefault' - /// - [JsonProperty(PropertyName = "dataSourceType")] - public string DataSourceType { get; protected set; } - - /// - /// Gets the data source ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } - - /// - /// Gets the Link ID if the data source type is LinkInteraction. - /// - [JsonProperty(PropertyName = "linkId")] - public string LinkId { get; protected set; } - - /// - /// Gets the Connector Mapping ID if the data source type is - /// ConnectorMapping. - /// - [JsonProperty(PropertyName = "connectorMappingId")] - public string ConnectorMappingId { get; protected set; } - - } -} - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourcePrecedence.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourcePrecedence.cs new file mode 100644 index 0000000000000..9ee42156a9734 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourcePrecedence.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The data source precedence is a way to know the precedence of each data + /// source. + /// + [Rest.Serialization.JsonTransformation] + public partial class DataSourcePrecedence + { + /// + /// Initializes a new instance of the DataSourcePrecedence class. + /// + public DataSourcePrecedence() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataSourcePrecedence class. + /// + /// The data source name + /// The data source type. Possible values + /// include: 'Connector', 'LinkInteraction', 'SystemDefault' + /// The data source status. Possible values + /// include: 'None', 'Active', 'Deleted' + /// The data source ID. + /// The data source reference + /// id. + /// the precedence value. + public DataSourcePrecedence(string name = default(string), string dataSourceType = default(string), string status = default(string), int? id = default(int?), string dataSourceReferenceId = default(string), int? precedence = default(int?)) + { + Name = name; + DataSourceType = dataSourceType; + Status = status; + Id = id; + DataSourceReferenceId = dataSourceReferenceId; + Precedence = precedence; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the data source name + /// + [JsonProperty(PropertyName = "dataSource.name")] + public string Name { get; private set; } + + /// + /// Gets the data source type. Possible values include: 'Connector', + /// 'LinkInteraction', 'SystemDefault' + /// + [JsonProperty(PropertyName = "dataSource.dataSourceType")] + public string DataSourceType { get; private set; } + + /// + /// Gets the data source status. Possible values include: 'None', + /// 'Active', 'Deleted' + /// + [JsonProperty(PropertyName = "dataSource.status")] + public string Status { get; private set; } + + /// + /// Gets the data source ID. + /// + [JsonProperty(PropertyName = "dataSource.id")] + public int? Id { get; private set; } + + /// + /// Gets the data source reference id. + /// + [JsonProperty(PropertyName = "dataSource.dataSourceReferenceId")] + public string DataSourceReferenceId { get; private set; } + + /// + /// Gets or sets the precedence value. + /// + [JsonProperty(PropertyName = "precedence")] + public int? Precedence { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourceType.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourceType.cs index 638a928098c43..23acad794c812 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourceType.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/DataSourceType.cs @@ -1,25 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; /// /// Defines values for DataSourceType. /// public static class DataSourceType { - public const string ConnectorMapping = "ConnectorMapping"; + public const string Connector = "Connector"; public const string LinkInteraction = "LinkInteraction"; public const string SystemDefault = "SystemDefault"; } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EnrichingKpi.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EnrichingKpi.cs index 811d655ba8695..6a864ac5df1b3 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EnrichingKpi.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EnrichingKpi.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -23,7 +22,10 @@ public partial class EnrichingKpi : KpiDefinition /// /// Initializes a new instance of the EnrichingKpi class. /// - public EnrichingKpi() { } + public EnrichingKpi() + { + CustomInit(); + } /// /// Initializes a new instance of the EnrichingKpi class. @@ -61,8 +63,14 @@ public partial class EnrichingKpi : KpiDefinition public EnrichingKpi(EntityTypes entityType, string entityTypeName, CalculationWindowTypes calculationWindow, KpiFunctions function, string expression, string tenantId = default(string), string kpiName = default(string), IDictionary displayName = default(IDictionary), IDictionary description = default(IDictionary), string calculationWindowFieldName = default(string), string unit = default(string), string filter = default(string), IList groupBy = default(IList), IList groupByMetadata = default(IList), IList participantProfilesMetadata = default(IList), string provisioningState = default(string), KpiThresholds thresHolds = default(KpiThresholds), IList aliases = default(IList), IList extracts = default(IList)) : base(entityType, entityTypeName, calculationWindow, function, expression, tenantId, kpiName, displayName, description, calculationWindowFieldName, unit, filter, groupBy, groupByMetadata, participantProfilesMetadata, provisioningState, thresHolds, aliases, extracts) { + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Validate the object. /// @@ -75,4 +83,3 @@ public override void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityType.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityType.cs new file mode 100644 index 0000000000000..c1a20eadcafac --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityType.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for EntityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum EntityType + { + [EnumMember(Value = "None")] + None, + [EnumMember(Value = "Profile")] + Profile, + [EnumMember(Value = "Interaction")] + Interaction, + [EnumMember(Value = "Relationship")] + Relationship + } + internal static class EntityTypeEnumExtension + { + internal static string ToSerializedValue(this EntityType? value) + { + return value == null ? null : ((EntityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this EntityType value) + { + switch( value ) + { + case EntityType.None: + return "None"; + case EntityType.Profile: + return "Profile"; + case EntityType.Interaction: + return "Interaction"; + case EntityType.Relationship: + return "Relationship"; + } + return null; + } + + internal static EntityType? ParseEntityType(this string value) + { + switch( value ) + { + case "None": + return EntityType.None; + case "Profile": + return EntityType.Profile; + case "Interaction": + return EntityType.Interaction; + case "Relationship": + return EntityType.Relationship; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypeDefinition.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypeDefinition.cs index ca38785d2473b..2251f73041c03 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypeDefinition.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypeDefinition.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +23,10 @@ public partial class EntityTypeDefinition : MetadataDefinitionBase /// /// Initializes a new instance of the EntityTypeDefinition class. /// - public EntityTypeDefinition() { } + public EntityTypeDefinition() + { + CustomInit(); + } /// /// Initializes a new instance of the EntityTypeDefinition class. @@ -43,8 +45,8 @@ public partial class EntityTypeDefinition : MetadataDefinitionBase /// Large Image associated with the Property /// or EntityType. /// The api entity set name. This - /// becomes the odata entity set name for the entity Type being refered - /// in this object. + /// becomes the odata entity set name for the entity Type being + /// referred in this object. /// Type of entity. Possible values include: /// 'None', 'Profile', 'Interaction', 'Relationship' /// The properties of the Profile. @@ -74,11 +76,17 @@ public EntityTypeDefinition(IDictionary> attributes = defa TenantId = tenantId; TimestampFieldName = timestampFieldName; TypeName = typeName; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the api entity set name. This becomes the odata entity - /// set name for the entity Type being refered in this object. + /// set name for the entity Type being referred in this object. /// [JsonProperty(PropertyName = "apiEntitySetName")] public string ApiEntitySetName { get; set; } @@ -106,14 +114,14 @@ public EntityTypeDefinition(IDictionary> attributes = defa /// Gets the last changed time for the type definition. /// [JsonProperty(PropertyName = "lastChangedUtc")] - public System.DateTime? LastChangedUtc { get; protected set; } + public System.DateTime? LastChangedUtc { get; private set; } /// /// Gets provisioning state. Possible values include: 'Provisioning', /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the schema org link. This helps ACI identify and @@ -126,7 +134,7 @@ public EntityTypeDefinition(IDictionary> attributes = defa /// Gets the hub name. /// [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets or sets the timestamp property name. Represents the time when @@ -143,4 +151,3 @@ public EntityTypeDefinition(IDictionary> attributes = defa } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypes.cs index fb4758fc31278..b364a9466a380 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/EntityTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -31,5 +30,43 @@ public enum EntityTypes [EnumMember(Value = "Relationship")] Relationship } -} + internal static class EntityTypesEnumExtension + { + internal static string ToSerializedValue(this EntityTypes? value) + { + return value == null ? null : ((EntityTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this EntityTypes value) + { + switch( value ) + { + case EntityTypes.None: + return "None"; + case EntityTypes.Profile: + return "Profile"; + case EntityTypes.Interaction: + return "Interaction"; + case EntityTypes.Relationship: + return "Relationship"; + } + return null; + } + internal static EntityTypes? ParseEntityTypes(this string value) + { + switch( value ) + { + case "None": + return EntityTypes.None; + case "Profile": + return EntityTypes.Profile; + case "Interaction": + return EntityTypes.Interaction; + case "Relationship": + return EntityTypes.Relationship; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ErrorManagementTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ErrorManagementTypes.cs index 00591cf006eb8..977496d564bcf 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ErrorManagementTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ErrorManagementTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -29,5 +28,39 @@ public enum ErrorManagementTypes [EnumMember(Value = "RejectUntilLimit")] RejectUntilLimit } -} + internal static class ErrorManagementTypesEnumExtension + { + internal static string ToSerializedValue(this ErrorManagementTypes? value) + { + return value == null ? null : ((ErrorManagementTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ErrorManagementTypes value) + { + switch( value ) + { + case ErrorManagementTypes.RejectAndContinue: + return "RejectAndContinue"; + case ErrorManagementTypes.StopImport: + return "StopImport"; + case ErrorManagementTypes.RejectUntilLimit: + return "RejectUntilLimit"; + } + return null; + } + internal static ErrorManagementTypes? ParseErrorManagementTypes(this string value) + { + switch( value ) + { + case "RejectAndContinue": + return ErrorManagementTypes.RejectAndContinue; + case "StopImport": + return ErrorManagementTypes.StopImport; + case "RejectUntilLimit": + return ErrorManagementTypes.RejectUntilLimit; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/FrequencyTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/FrequencyTypes.cs index 7a109cfa5de0b..4363857bb3eac 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/FrequencyTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/FrequencyTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -33,5 +32,47 @@ public enum FrequencyTypes [EnumMember(Value = "Month")] Month } -} + internal static class FrequencyTypesEnumExtension + { + internal static string ToSerializedValue(this FrequencyTypes? value) + { + return value == null ? null : ((FrequencyTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this FrequencyTypes value) + { + switch( value ) + { + case FrequencyTypes.Minute: + return "Minute"; + case FrequencyTypes.Hour: + return "Hour"; + case FrequencyTypes.Day: + return "Day"; + case FrequencyTypes.Week: + return "Week"; + case FrequencyTypes.Month: + return "Month"; + } + return null; + } + internal static FrequencyTypes? ParseFrequencyTypes(this string value) + { + switch( value ) + { + case "Minute": + return FrequencyTypes.Minute; + case "Hour": + return FrequencyTypes.Hour; + case "Day": + return FrequencyTypes.Day; + case "Week": + return FrequencyTypes.Week; + case "Month": + return FrequencyTypes.Month; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/GetImageUploadUrlInput.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/GetImageUploadUrlInput.cs index c395e93849259..912e8b6cad347 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/GetImageUploadUrlInput.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/GetImageUploadUrlInput.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Linq; @@ -22,7 +21,10 @@ public partial class GetImageUploadUrlInput /// /// Initializes a new instance of the GetImageUploadUrlInput class. /// - public GetImageUploadUrlInput() { } + public GetImageUploadUrlInput() + { + CustomInit(); + } /// /// Initializes a new instance of the GetImageUploadUrlInput class. @@ -36,8 +38,14 @@ public GetImageUploadUrlInput(string entityType = default(string), string entity EntityType = entityType; EntityTypeName = entityTypeName; RelativePath = relativePath; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets type of entity. Can be Profile or Interaction. /// @@ -58,4 +66,3 @@ public GetImageUploadUrlInput(string entityType = default(string), string entity } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Hub.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Hub.cs index 668bb92af5d40..a27b3f534bde9 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Hub.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Hub.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,21 +20,24 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// Hub resource. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class Hub : Resource { /// /// Initializes a new instance of the Hub class. /// - public Hub() { } + public Hub() + { + CustomInit(); + } /// /// Initializes a new instance of the Hub class. /// - /// Resource location. /// Resource ID. /// Resource name. /// Resource type. + /// Resource location. /// Resource tags. /// API endpoint URL of the hub. /// Web endpoint URL of the hub. @@ -46,33 +48,39 @@ public partial class Hub : Resource /// if set to 0. Bit 1 is set to 1 indicates the hub is disabled, or /// enabled if set to 0. /// Billing settings of the hub. - public Hub(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string apiEndpoint = default(string), string webEndpoint = default(string), string provisioningState = default(string), int? tenantFeatures = default(int?), HubBillingInfoFormat hubBillingInfo = default(HubBillingInfoFormat)) - : base(location, id, name, type, tags) + public Hub(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string apiEndpoint = default(string), string webEndpoint = default(string), string provisioningState = default(string), int? tenantFeatures = default(int?), HubBillingInfoFormat hubBillingInfo = default(HubBillingInfoFormat)) + : base(id, name, type, location, tags) { ApiEndpoint = apiEndpoint; WebEndpoint = webEndpoint; ProvisioningState = provisioningState; TenantFeatures = tenantFeatures; HubBillingInfo = hubBillingInfo; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets API endpoint URL of the hub. /// [JsonProperty(PropertyName = "properties.apiEndpoint")] - public string ApiEndpoint { get; protected set; } + public string ApiEndpoint { get; private set; } /// /// Gets web endpoint URL of the hub. /// [JsonProperty(PropertyName = "properties.webEndpoint")] - public string WebEndpoint { get; protected set; } + public string WebEndpoint { get; private set; } /// /// Gets provisioning state of the hub. /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the bit flags for enabled hub features. Bit 0 is set @@ -94,9 +102,8 @@ public Hub(string location, string id = default(string), string name = default(s /// /// Thrown if validation fails /// - public override void Validate() + public virtual void Validate() { - base.Validate(); if (HubBillingInfo != null) { HubBillingInfo.Validate(); @@ -104,4 +111,3 @@ public override void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/HubBillingInfoFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/HubBillingInfoFormat.cs index 5f3414464c749..37a6cb54bdd3e 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/HubBillingInfoFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/HubBillingInfoFormat.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class HubBillingInfoFormat /// /// Initializes a new instance of the HubBillingInfoFormat class. /// - public HubBillingInfoFormat() { } + public HubBillingInfoFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the HubBillingInfoFormat class. @@ -38,8 +40,14 @@ public HubBillingInfoFormat(string skuName = default(string), int? minUnits = de SkuName = skuName; MinUnits = minUnits; MaxUnits = maxUnits; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the sku name. /// @@ -87,4 +95,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ImageDefinition.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ImageDefinition.cs index 6776c4ecb1bb4..d3c2f4828328c 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ImageDefinition.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ImageDefinition.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Linq; @@ -22,7 +21,10 @@ public partial class ImageDefinition /// /// Initializes a new instance of the ImageDefinition class. /// - public ImageDefinition() { } + public ImageDefinition() + { + CustomInit(); + } /// /// Initializes a new instance of the ImageDefinition class. @@ -35,8 +37,14 @@ public ImageDefinition(bool? imageExists = default(bool?), string contentUrl = d ImageExists = imageExists; ContentUrl = contentUrl; RelativePath = relativePath; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets whether image exists already. /// @@ -57,4 +65,3 @@ public ImageDefinition(bool? imageExists = default(bool?), string contentUrl = d } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InstanceOperationType.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InstanceOperationType.cs index 85ff4ad5a5e57..0197029546356 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InstanceOperationType.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InstanceOperationType.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -27,5 +26,35 @@ public enum InstanceOperationType [EnumMember(Value = "Delete")] Delete } -} + internal static class InstanceOperationTypeEnumExtension + { + internal static string ToSerializedValue(this InstanceOperationType? value) + { + return value == null ? null : ((InstanceOperationType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this InstanceOperationType value) + { + switch( value ) + { + case InstanceOperationType.Upsert: + return "Upsert"; + case InstanceOperationType.Delete: + return "Delete"; + } + return null; + } + internal static InstanceOperationType? ParseInstanceOperationType(this string value) + { + switch( value ) + { + case "Upsert": + return InstanceOperationType.Upsert; + case "Delete": + return InstanceOperationType.Delete; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InteractionResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InteractionResourceFormat.cs index 611eb6e5d0980..b59de99d89b5c 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InteractionResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/InteractionResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,13 +20,16 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The interaction resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class InteractionResourceFormat : ProxyResource { /// /// Initializes a new instance of the InteractionResourceFormat class. /// - public InteractionResourceFormat() { } + public InteractionResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the InteractionResourceFormat class. @@ -49,8 +51,8 @@ public partial class InteractionResourceFormat : ProxyResource /// Large Image associated with the Property /// or EntityType. /// The api entity set name. This - /// becomes the odata entity set name for the entity Type being refered - /// in this object. + /// becomes the odata entity set name for the entity Type being + /// referred in this object. /// Type of entity. Possible values include: /// 'None', 'Profile', 'Interaction', 'Relationship' /// The properties of the Profile. @@ -75,18 +77,26 @@ public partial class InteractionResourceFormat : ProxyResource /// participant property name for an interaction ,This is used to /// logically represent the agent of the interaction, Specify the /// participant name here from ParticipantName. - /// This is specific to interactions modeled - /// as activities. Data sources are used to determine where data is - /// stored and also in precedence rules. - /// Default data source is - /// specifically used in cases where data source is not specified in an - /// instance. + /// This is specific to + /// interactions modeled as activities. Data sources are used to + /// determine where data is stored and also in precedence + /// rules. + /// The data source + /// name + /// The data source type. Possible values + /// include: 'Connector', 'LinkInteraction', 'SystemDefault' + /// The data source status. Possible values + /// include: 'None', 'Active', 'Deleted' + /// The data source + /// ID. + /// The data source reference + /// id. /// An interaction can be tagged as an /// activity only during create. This enables the interaction to be /// editable and can enable merging of properties from multiple data /// sources based on precedence, which is defined at a link /// level. - public InteractionResourceFormat(string id = default(string), string name = default(string), string type = default(string), IDictionary> attributes = default(IDictionary>), IDictionary description = default(IDictionary), IDictionary displayName = default(IDictionary), IDictionary> localizedAttributes = default(IDictionary>), string smallImage = default(string), string mediumImage = default(string), string largeImage = default(string), string apiEntitySetName = default(string), EntityTypes? entityType = default(EntityTypes?), IList fields = default(IList), int? instancesCount = default(int?), System.DateTime? lastChangedUtc = default(System.DateTime?), string provisioningState = default(string), string schemaItemTypeLink = default(string), string tenantId = default(string), string timestampFieldName = default(string), string typeName = default(string), IList idPropertyNames = default(IList), IList participantProfiles = default(IList), string primaryParticipantProfilePropertyName = default(string), IList dataSources = default(IList), string defaultDataSourceId = default(string), bool? isActivity = default(bool?)) + public InteractionResourceFormat(string id = default(string), string name = default(string), string type = default(string), IDictionary> attributes = default(IDictionary>), IDictionary description = default(IDictionary), IDictionary displayName = default(IDictionary), IDictionary> localizedAttributes = default(IDictionary>), string smallImage = default(string), string mediumImage = default(string), string largeImage = default(string), string apiEntitySetName = default(string), EntityTypes? entityType = default(EntityTypes?), IList fields = default(IList), int? instancesCount = default(int?), System.DateTime? lastChangedUtc = default(System.DateTime?), string provisioningState = default(string), string schemaItemTypeLink = default(string), string tenantId = default(string), string timestampFieldName = default(string), string typeName = default(string), IList idPropertyNames = default(IList), IList participantProfiles = default(IList), string primaryParticipantProfilePropertyName = default(string), IList dataSourcePrecedenceRules = default(IList), string interactionResourceFormatName = default(string), string dataSourceType = default(string), string status = default(string), int? interactionResourceFormatId = default(int?), string dataSourceReferenceId = default(string), bool? isActivity = default(bool?)) : base(id, name, type) { Attributes = attributes; @@ -109,11 +119,21 @@ public InteractionResourceFormat(string id = default(string), string name = defa IdPropertyNames = idPropertyNames; ParticipantProfiles = participantProfiles; PrimaryParticipantProfilePropertyName = primaryParticipantProfilePropertyName; - DataSources = dataSources; - DefaultDataSourceId = defaultDataSourceId; + DataSourcePrecedenceRules = dataSourcePrecedenceRules; + InteractionResourceFormatName = interactionResourceFormatName; + DataSourceType = dataSourceType; + Status = status; + InteractionResourceFormatId = interactionResourceFormatId; + DataSourceReferenceId = dataSourceReferenceId; IsActivity = isActivity; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the attributes for the Type. /// @@ -161,7 +181,7 @@ public InteractionResourceFormat(string id = default(string), string name = defa /// /// Gets or sets the api entity set name. This becomes the odata entity - /// set name for the entity Type being refered in this object. + /// set name for the entity Type being referred in this object. /// [JsonProperty(PropertyName = "properties.apiEntitySetName")] public string ApiEntitySetName { get; set; } @@ -189,14 +209,14 @@ public InteractionResourceFormat(string id = default(string), string name = defa /// Gets the last changed time for the type definition. /// [JsonProperty(PropertyName = "properties.lastChangedUtc")] - public System.DateTime? LastChangedUtc { get; protected set; } + public System.DateTime? LastChangedUtc { get; private set; } /// /// Gets provisioning state. Possible values include: 'Provisioning', /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the schema org link. This helps ACI identify and @@ -209,7 +229,7 @@ public InteractionResourceFormat(string id = default(string), string name = defa /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets or sets the timestamp property name. Represents the time when @@ -251,15 +271,40 @@ public InteractionResourceFormat(string id = default(string), string name = defa /// sources are used to determine where data is stored and also in /// precedence rules. /// - [JsonProperty(PropertyName = "properties.dataSources")] - public IList DataSources { get; protected set; } + [JsonProperty(PropertyName = "properties.dataSourcePrecedenceRules")] + public IList DataSourcePrecedenceRules { get; private set; } + + /// + /// Gets the data source name + /// + [JsonProperty(PropertyName = "properties.defaultDataSource.name")] + public string InteractionResourceFormatName { get; private set; } + + /// + /// Gets the data source type. Possible values include: 'Connector', + /// 'LinkInteraction', 'SystemDefault' + /// + [JsonProperty(PropertyName = "properties.defaultDataSource.dataSourceType")] + public string DataSourceType { get; private set; } + + /// + /// Gets the data source status. Possible values include: 'None', + /// 'Active', 'Deleted' + /// + [JsonProperty(PropertyName = "properties.defaultDataSource.status")] + public string Status { get; private set; } /// - /// Gets default data source is specifically used in cases where data - /// source is not specified in an instance. + /// Gets the data source ID. /// - [JsonProperty(PropertyName = "properties.defaultDataSourceId")] - public string DefaultDataSourceId { get; protected set; } + [JsonProperty(PropertyName = "properties.defaultDataSource.id")] + public int? InteractionResourceFormatId { get; private set; } + + /// + /// Gets the data source reference id. + /// + [JsonProperty(PropertyName = "properties.defaultDataSource.dataSourceReferenceId")] + public string DataSourceReferenceId { get; private set; } /// /// Gets or sets an interaction can be tagged as an activity only @@ -272,4 +317,3 @@ public InteractionResourceFormat(string id = default(string), string name = defa } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiAlias.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiAlias.cs index c436778b1d8d4..0ab0e6b04a1df 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiAlias.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiAlias.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class KpiAlias /// /// Initializes a new instance of the KpiAlias class. /// - public KpiAlias() { } + public KpiAlias() + { + CustomInit(); + } /// /// Initializes a new instance of the KpiAlias class. @@ -34,8 +36,14 @@ public KpiAlias(string aliasName, string expression) { AliasName = aliasName; Expression = expression; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets KPI alias name. /// @@ -67,4 +75,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiDefinition.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiDefinition.cs index 1ca3d1c84a06a..76757aea56478 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiDefinition.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiDefinition.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class KpiDefinition /// /// Initializes a new instance of the KpiDefinition class. /// - public KpiDefinition() { } + public KpiDefinition() + { + CustomInit(); + } /// /// Initializes a new instance of the KpiDefinition class. @@ -81,8 +83,14 @@ public KpiDefinition(EntityTypes entityType, string entityTypeName, CalculationW ThresHolds = thresHolds; Aliases = aliases; Extracts = extracts; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the mapping entity type. Possible values include: /// 'None', 'Profile', 'Interaction', 'Relationship' @@ -100,13 +108,13 @@ public KpiDefinition(EntityTypes entityType, string entityTypeName, CalculationW /// Gets the hub name. /// [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets the KPI name. /// [JsonProperty(PropertyName = "kpiName")] - public string KpiName { get; protected set; } + public string KpiName { get; private set; } /// /// Gets or sets localized display name for the KPI. @@ -169,20 +177,20 @@ public KpiDefinition(EntityTypes entityType, string entityTypeName, CalculationW /// Gets the KPI GroupByMetadata. /// [JsonProperty(PropertyName = "groupByMetadata")] - public IList GroupByMetadata { get; protected set; } + public IList GroupByMetadata { get; private set; } /// /// Gets the participant profiles. /// [JsonProperty(PropertyName = "participantProfilesMetadata")] - public IList ParticipantProfilesMetadata { get; protected set; } + public IList ParticipantProfilesMetadata { get; private set; } /// /// Gets provisioning state. Possible values include: 'Provisioning', /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the KPI thresholds. @@ -255,4 +263,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiExtract.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiExtract.cs index a2a811342ed20..b326c8b96769a 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiExtract.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiExtract.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class KpiExtract /// /// Initializes a new instance of the KpiExtract class. /// - public KpiExtract() { } + public KpiExtract() + { + CustomInit(); + } /// /// Initializes a new instance of the KpiExtract class. @@ -34,8 +36,14 @@ public KpiExtract(string extractName, string expression) { ExtractName = extractName; Expression = expression; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets KPI extract name. /// @@ -67,4 +75,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiFunctions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiFunctions.cs index 50636dbbf4124..14020adeec757 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiFunctions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiFunctions.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -39,5 +38,59 @@ public enum KpiFunctions [EnumMember(Value = "CountDistinct")] CountDistinct } -} + internal static class KpiFunctionsEnumExtension + { + internal static string ToSerializedValue(this KpiFunctions? value) + { + return value == null ? null : ((KpiFunctions)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this KpiFunctions value) + { + switch( value ) + { + case KpiFunctions.Sum: + return "Sum"; + case KpiFunctions.Avg: + return "Avg"; + case KpiFunctions.Min: + return "Min"; + case KpiFunctions.Max: + return "Max"; + case KpiFunctions.Last: + return "Last"; + case KpiFunctions.Count: + return "Count"; + case KpiFunctions.None: + return "None"; + case KpiFunctions.CountDistinct: + return "CountDistinct"; + } + return null; + } + internal static KpiFunctions? ParseKpiFunctions(this string value) + { + switch( value ) + { + case "Sum": + return KpiFunctions.Sum; + case "Avg": + return KpiFunctions.Avg; + case "Min": + return KpiFunctions.Min; + case "Max": + return KpiFunctions.Max; + case "Last": + return KpiFunctions.Last; + case "Count": + return KpiFunctions.Count; + case "None": + return KpiFunctions.None; + case "CountDistinct": + return KpiFunctions.CountDistinct; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiGroupByMetadata.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiGroupByMetadata.cs index 664941376a427..5a4eaecf9ff00 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiGroupByMetadata.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiGroupByMetadata.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +23,10 @@ public partial class KpiGroupByMetadata /// /// Initializes a new instance of the KpiGroupByMetadata class. /// - public KpiGroupByMetadata() { } + public KpiGroupByMetadata() + { + CustomInit(); + } /// /// Initializes a new instance of the KpiGroupByMetadata class. @@ -37,8 +39,14 @@ public KpiGroupByMetadata(IDictionary displayName = default(IDic DisplayName = displayName; FieldName = fieldName; FieldType = fieldType; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the display name. /// @@ -59,4 +67,3 @@ public KpiGroupByMetadata(IDictionary displayName = default(IDic } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiParticipantProfilesMetadata.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiParticipantProfilesMetadata.cs index b212f84adf801..83f482de0a7d9 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiParticipantProfilesMetadata.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiParticipantProfilesMetadata.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -24,7 +23,10 @@ public partial class KpiParticipantProfilesMetadata /// Initializes a new instance of the KpiParticipantProfilesMetadata /// class. /// - public KpiParticipantProfilesMetadata() { } + public KpiParticipantProfilesMetadata() + { + CustomInit(); + } /// /// Initializes a new instance of the KpiParticipantProfilesMetadata @@ -34,8 +36,14 @@ public partial class KpiParticipantProfilesMetadata public KpiParticipantProfilesMetadata(string typeName) { TypeName = typeName; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets name of the type. /// @@ -57,4 +65,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiResourceFormat.cs index ab9aa22ac9f38..3eb9a1631add8 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,13 +20,16 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The KPI resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class KpiResourceFormat : ProxyResource { /// /// Initializes a new instance of the KpiResourceFormat class. /// - public KpiResourceFormat() { } + public KpiResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the KpiResourceFormat class. @@ -87,8 +89,14 @@ public KpiResourceFormat(EntityTypes entityType, string entityTypeName, Calculat ThresHolds = thresHolds; Aliases = aliases; Extracts = extracts; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the mapping entity type. Possible values include: /// 'None', 'Profile', 'Interaction', 'Relationship' @@ -106,13 +114,13 @@ public KpiResourceFormat(EntityTypes entityType, string entityTypeName, Calculat /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets the KPI name. /// [JsonProperty(PropertyName = "properties.kpiName")] - public string KpiName { get; protected set; } + public string KpiName { get; private set; } /// /// Gets or sets localized display name for the KPI. @@ -175,20 +183,20 @@ public KpiResourceFormat(EntityTypes entityType, string entityTypeName, Calculat /// Gets the KPI GroupByMetadata. /// [JsonProperty(PropertyName = "properties.groupByMetadata")] - public IList GroupByMetadata { get; protected set; } + public IList GroupByMetadata { get; private set; } /// /// Gets the participant profiles. /// [JsonProperty(PropertyName = "properties.participantProfilesMetadata")] - public IList ParticipantProfilesMetadata { get; protected set; } + public IList ParticipantProfilesMetadata { get; private set; } /// /// Gets provisioning state. Possible values include: 'Provisioning', /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the KPI thresholds. @@ -261,4 +269,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiThresholds.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiThresholds.cs index ae91f22d55eee..87ff9f7bf8957 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiThresholds.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/KpiThresholds.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Linq; @@ -22,7 +21,10 @@ public partial class KpiThresholds /// /// Initializes a new instance of the KpiThresholds class. /// - public KpiThresholds() { } + public KpiThresholds() + { + CustomInit(); + } /// /// Initializes a new instance of the KpiThresholds class. @@ -36,8 +38,14 @@ public KpiThresholds(decimal lowerLimit, decimal upperLimit, bool increasingKpi) LowerLimit = lowerLimit; UpperLimit = upperLimit; IncreasingKpi = increasingKpi; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the lower threshold limit. /// @@ -68,4 +76,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkResourceFormat.cs index a74dcc1e47ed9..a390ef7fa16f2 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,20 +20,29 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The link resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class LinkResourceFormat : ProxyResource { /// /// Initializes a new instance of the LinkResourceFormat class. /// - public LinkResourceFormat() { } + public LinkResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the LinkResourceFormat class. /// - /// Name of the source Interaction + /// Type of source entity. Possible + /// values include: 'None', 'Profile', 'Interaction', + /// 'Relationship' + /// Type of target entity. Possible + /// values include: 'None', 'Profile', 'Interaction', + /// 'Relationship' + /// Name of the source Entity /// Type. - /// Name of the target Profile + /// Name of the target Entity /// Type. /// The properties that /// represent the participating profile. @@ -53,19 +61,21 @@ public partial class LinkResourceFormat : ProxyResource /// include: 'Provisioning', 'Succeeded', 'Expiring', 'Deleting', /// 'HumanIntervention', 'Failed' /// Indicating whether the link is - /// reference only link. This flag is ingored if the Mappings are + /// reference only link. This flag is ignored if the Mappings are /// defined. If the mappings are not defined and it is set to true, /// links processing will not create or update profiles. /// Determines whether this link is /// supposed to create or delete instances if Link is NOT Reference /// Only. Possible values include: 'Upsert', 'Delete' - public LinkResourceFormat(string sourceInteractionType, string targetProfileType, IList participantPropertyReferences, string id = default(string), string name = default(string), string type = default(string), string tenantId = default(string), string linkName = default(string), IDictionary displayName = default(IDictionary), IDictionary description = default(IDictionary), IList mappings = default(IList), string provisioningState = default(string), bool? referenceOnly = default(bool?), InstanceOperationType? operationType = default(InstanceOperationType?)) + public LinkResourceFormat(EntityType sourceEntityType, EntityType targetEntityType, string sourceEntityTypeName, string targetEntityTypeName, IList participantPropertyReferences, string id = default(string), string name = default(string), string type = default(string), string tenantId = default(string), string linkName = default(string), IDictionary displayName = default(IDictionary), IDictionary description = default(IDictionary), IList mappings = default(IList), string provisioningState = default(string), bool? referenceOnly = default(bool?), InstanceOperationType? operationType = default(InstanceOperationType?)) : base(id, name, type) { TenantId = tenantId; LinkName = linkName; - SourceInteractionType = sourceInteractionType; - TargetProfileType = targetProfileType; + SourceEntityType = sourceEntityType; + TargetEntityType = targetEntityType; + SourceEntityTypeName = sourceEntityTypeName; + TargetEntityTypeName = targetEntityTypeName; DisplayName = displayName; Description = description; Mappings = mappings; @@ -73,31 +83,51 @@ public LinkResourceFormat(string sourceInteractionType, string targetProfileType ProvisioningState = provisioningState; ReferenceOnly = referenceOnly; OperationType = operationType; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets the link name. /// [JsonProperty(PropertyName = "properties.linkName")] - public string LinkName { get; protected set; } + public string LinkName { get; private set; } + + /// + /// Gets or sets type of source entity. Possible values include: + /// 'None', 'Profile', 'Interaction', 'Relationship' + /// + [JsonProperty(PropertyName = "properties.sourceEntityType")] + public EntityType SourceEntityType { get; set; } + + /// + /// Gets or sets type of target entity. Possible values include: + /// 'None', 'Profile', 'Interaction', 'Relationship' + /// + [JsonProperty(PropertyName = "properties.targetEntityType")] + public EntityType TargetEntityType { get; set; } /// - /// Gets or sets name of the source Interaction Type. + /// Gets or sets name of the source Entity Type. /// - [JsonProperty(PropertyName = "properties.sourceInteractionType")] - public string SourceInteractionType { get; set; } + [JsonProperty(PropertyName = "properties.sourceEntityTypeName")] + public string SourceEntityTypeName { get; set; } /// - /// Gets or sets name of the target Profile Type. + /// Gets or sets name of the target Entity Type. /// - [JsonProperty(PropertyName = "properties.targetProfileType")] - public string TargetProfileType { get; set; } + [JsonProperty(PropertyName = "properties.targetEntityTypeName")] + public string TargetEntityTypeName { get; set; } /// /// Gets or sets localized display name for the Link. @@ -130,11 +160,11 @@ public LinkResourceFormat(string sourceInteractionType, string targetProfileType /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets indicating whether the link is reference only link. - /// This flag is ingored if the Mappings are defined. If the mappings + /// This flag is ignored if the Mappings are defined. If the mappings /// are not defined and it is set to true, links processing will not /// create or update profiles. /// @@ -157,13 +187,13 @@ public LinkResourceFormat(string sourceInteractionType, string targetProfileType /// public virtual void Validate() { - if (SourceInteractionType == null) + if (SourceEntityTypeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceInteractionType"); + throw new ValidationException(ValidationRules.CannotBeNull, "SourceEntityTypeName"); } - if (TargetProfileType == null) + if (TargetEntityTypeName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "TargetProfileType"); + throw new ValidationException(ValidationRules.CannotBeNull, "TargetEntityTypeName"); } if (ParticipantPropertyReferences == null) { @@ -192,4 +222,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkTypes.cs index 00a9d19d7894d..184a8aa0127af 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/LinkTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -27,5 +26,35 @@ public enum LinkTypes [EnumMember(Value = "CopyIfNull")] CopyIfNull } -} + internal static class LinkTypesEnumExtension + { + internal static string ToSerializedValue(this LinkTypes? value) + { + return value == null ? null : ((LinkTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this LinkTypes value) + { + switch( value ) + { + case LinkTypes.UpdateAlways: + return "UpdateAlways"; + case LinkTypes.CopyIfNull: + return "CopyIfNull"; + } + return null; + } + internal static LinkTypes? ParseLinkTypes(this string value) + { + switch( value ) + { + case "UpdateAlways": + return LinkTypes.UpdateAlways; + case "CopyIfNull": + return LinkTypes.CopyIfNull; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/MetadataDefinitionBase.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/MetadataDefinitionBase.cs index 852b57d5b59f1..05bc4cef8c4b1 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/MetadataDefinitionBase.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/MetadataDefinitionBase.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +23,10 @@ public partial class MetadataDefinitionBase /// /// Initializes a new instance of the MetadataDefinitionBase class. /// - public MetadataDefinitionBase() { } + public MetadataDefinitionBase() + { + CustomInit(); + } /// /// Initializes a new instance of the MetadataDefinitionBase class. @@ -51,8 +53,14 @@ public MetadataDefinitionBase(IDictionary> attributes = de SmallImage = smallImage; MediumImage = mediumImage; LargeImage = largeImage; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the attributes for the Type. /// @@ -100,4 +108,3 @@ public MetadataDefinitionBase(IDictionary> attributes = de } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Operation.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Operation.cs new file mode 100644 index 0000000000000..58a43f1b97270 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Operation.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A Customer Insights REST API operation + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Operation name: + /// {provider}/{resource}/{operation} + /// The object that represents the + /// operation. + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) + { + Name = name; + Display = display; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets operation name: {provider}/{resource}/{operation} + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets or sets the object that represents the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/OperationDisplay.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..7ac75457c80e1 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The object that represents the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Service provider: + /// Microsoft.CustomerInsights + /// Resource on which the operation is + /// performed: Invoice, etc. + /// Operation type: Read, write, delete, + /// etc. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets service provider: Microsoft.CustomerInsights + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets resource on which the operation is performed: Invoice, etc. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + /// + /// Gets operation type: Read, write, delete, etc. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Page.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Page.cs index 90c1832310dca..9043d5fe9592a 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Page.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Page.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -52,4 +51,3 @@ IEnumerator IEnumerable.GetEnumerator() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Participant.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Participant.cs index b6eb007df52a0..69501c217ab84 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Participant.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Participant.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class Participant /// /// Initializes a new instance of the Participant class. /// - public Participant() { } + public Participant() + { + CustomInit(); + } /// /// Initializes a new instance of the Participant class. @@ -46,8 +48,14 @@ public Participant(string profileTypeName, IList p DisplayName = displayName; Description = description; Role = role; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets profile type name. /// @@ -118,4 +126,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantProfilePropertyReference.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantProfilePropertyReference.cs new file mode 100644 index 0000000000000..60875eca92a5b --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantProfilePropertyReference.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The participant profile property reference. + /// + public partial class ParticipantProfilePropertyReference + { + /// + /// Initializes a new instance of the + /// ParticipantProfilePropertyReference class. + /// + public ParticipantProfilePropertyReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ParticipantProfilePropertyReference class. + /// + /// The source interaction + /// property that maps to the target profile property. + /// The target profile property that + /// maps to the source interaction property. + public ParticipantProfilePropertyReference(string interactionPropertyName, string profilePropertyName) + { + InteractionPropertyName = interactionPropertyName; + ProfilePropertyName = profilePropertyName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the source interaction property that maps to the + /// target profile property. + /// + [JsonProperty(PropertyName = "interactionPropertyName")] + public string InteractionPropertyName { get; set; } + + /// + /// Gets or sets the target profile property that maps to the source + /// interaction property. + /// + [JsonProperty(PropertyName = "profilePropertyName")] + public string ProfilePropertyName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (InteractionPropertyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "InteractionPropertyName"); + } + if (ProfilePropertyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ProfilePropertyName"); + } + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantPropertyReference.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantPropertyReference.cs index afab66a88b8bb..e91b107852bf4 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantPropertyReference.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ParticipantPropertyReference.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -24,35 +23,42 @@ public partial class ParticipantPropertyReference /// Initializes a new instance of the ParticipantPropertyReference /// class. /// - public ParticipantPropertyReference() { } + public ParticipantPropertyReference() + { + CustomInit(); + } /// /// Initializes a new instance of the ParticipantPropertyReference /// class. /// - /// The interaction property that - /// maps to the profile property. - /// The profile property that maps to - /// the interaction property. - public ParticipantPropertyReference(string interactionPropertyName, string profilePropertyName) + /// The source property that maps to + /// the target property. + /// The target property that maps to + /// the source property. + public ParticipantPropertyReference(string sourcePropertyName, string targetPropertyName) { - InteractionPropertyName = interactionPropertyName; - ProfilePropertyName = profilePropertyName; + SourcePropertyName = sourcePropertyName; + TargetPropertyName = targetPropertyName; + CustomInit(); } /// - /// Gets or sets the interaction property that maps to the profile - /// property. + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the source property that maps to the target property. /// - [JsonProperty(PropertyName = "interactionPropertyName")] - public string InteractionPropertyName { get; set; } + [JsonProperty(PropertyName = "sourcePropertyName")] + public string SourcePropertyName { get; set; } /// - /// Gets or sets the profile property that maps to the interaction - /// property. + /// Gets or sets the target property that maps to the source property. /// - [JsonProperty(PropertyName = "profilePropertyName")] - public string ProfilePropertyName { get; set; } + [JsonProperty(PropertyName = "targetPropertyName")] + public string TargetPropertyName { get; set; } /// /// Validate the object. @@ -62,15 +68,14 @@ public ParticipantPropertyReference(string interactionPropertyName, string profi /// public virtual void Validate() { - if (InteractionPropertyName == null) + if (SourcePropertyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "InteractionPropertyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "SourcePropertyName"); } - if (ProfilePropertyName == null) + if (TargetPropertyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ProfilePropertyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "TargetPropertyName"); } } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PermissionTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PermissionTypes.cs index ba546b8f5e37f..fcaeb269bd515 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PermissionTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PermissionTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -29,5 +28,39 @@ public enum PermissionTypes [EnumMember(Value = "Manage")] Manage } -} + internal static class PermissionTypesEnumExtension + { + internal static string ToSerializedValue(this PermissionTypes? value) + { + return value == null ? null : ((PermissionTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this PermissionTypes value) + { + switch( value ) + { + case PermissionTypes.Read: + return "Read"; + case PermissionTypes.Write: + return "Write"; + case PermissionTypes.Manage: + return "Manage"; + } + return null; + } + internal static PermissionTypes? ParsePermissionTypes(this string value) + { + switch( value ) + { + case "Read": + return PermissionTypes.Read; + case "Write": + return PermissionTypes.Write; + case "Manage": + return PermissionTypes.Manage; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinition.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinition.cs new file mode 100644 index 0000000000000..7ca6d8df51f99 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinition.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The definition of the prediction distribution. + /// + public partial class PredictionDistributionDefinition + { + /// + /// Initializes a new instance of the PredictionDistributionDefinition + /// class. + /// + public PredictionDistributionDefinition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PredictionDistributionDefinition + /// class. + /// + /// Total positive in the + /// distribution. + /// Total negatives in the + /// distribution. + /// Distributions of the + /// prediction. + public PredictionDistributionDefinition(long? totalPositives = default(long?), long? totalNegatives = default(long?), IList distributions = default(IList)) + { + TotalPositives = totalPositives; + TotalNegatives = totalNegatives; + Distributions = distributions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets total positive in the distribution. + /// + [JsonProperty(PropertyName = "totalPositives")] + public long? TotalPositives { get; set; } + + /// + /// Gets or sets total negatives in the distribution. + /// + [JsonProperty(PropertyName = "totalNegatives")] + public long? TotalNegatives { get; set; } + + /// + /// Gets or sets distributions of the prediction. + /// + [JsonProperty(PropertyName = "distributions")] + public IList Distributions { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinitionDistributionsItem.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinitionDistributionsItem.cs new file mode 100644 index 0000000000000..63e55d92c807b --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionDistributionDefinitionDistributionsItem.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The definition of a prediction distribution. + /// + public partial class PredictionDistributionDefinitionDistributionsItem + { + /// + /// Initializes a new instance of the + /// PredictionDistributionDefinitionDistributionsItem class. + /// + public PredictionDistributionDefinitionDistributionsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PredictionDistributionDefinitionDistributionsItem class. + /// + /// Score threshold. + /// Number of positives. + /// Number of negatives. + /// Number of positives above + /// threshold. + /// Number of negatives above + /// threshold. + public PredictionDistributionDefinitionDistributionsItem(int? scoreThreshold = default(int?), long? positives = default(long?), long? negatives = default(long?), long? positivesAboveThreshold = default(long?), long? negativesAboveThreshold = default(long?)) + { + ScoreThreshold = scoreThreshold; + Positives = positives; + Negatives = negatives; + PositivesAboveThreshold = positivesAboveThreshold; + NegativesAboveThreshold = negativesAboveThreshold; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets score threshold. + /// + [JsonProperty(PropertyName = "scoreThreshold")] + public int? ScoreThreshold { get; set; } + + /// + /// Gets or sets number of positives. + /// + [JsonProperty(PropertyName = "positives")] + public long? Positives { get; set; } + + /// + /// Gets or sets number of negatives. + /// + [JsonProperty(PropertyName = "negatives")] + public long? Negatives { get; set; } + + /// + /// Gets or sets number of positives above threshold. + /// + [JsonProperty(PropertyName = "positivesAboveThreshold")] + public long? PositivesAboveThreshold { get; set; } + + /// + /// Gets or sets number of negatives above threshold. + /// + [JsonProperty(PropertyName = "negativesAboveThreshold")] + public long? NegativesAboveThreshold { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionGradesItem.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionGradesItem.cs new file mode 100644 index 0000000000000..cb7ff820951f9 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionGradesItem.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The definition of a prediction grade. + /// + public partial class PredictionGradesItem + { + /// + /// Initializes a new instance of the PredictionGradesItem class. + /// + public PredictionGradesItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PredictionGradesItem class. + /// + /// Name of the grade. + /// Minimum score threshold. + /// Maximum score threshold. + public PredictionGradesItem(string gradeName = default(string), int? minScoreThreshold = default(int?), int? maxScoreThreshold = default(int?)) + { + GradeName = gradeName; + MinScoreThreshold = minScoreThreshold; + MaxScoreThreshold = maxScoreThreshold; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the grade. + /// + [JsonProperty(PropertyName = "gradeName")] + public string GradeName { get; set; } + + /// + /// Gets or sets minimum score threshold. + /// + [JsonProperty(PropertyName = "minScoreThreshold")] + public int? MinScoreThreshold { get; set; } + + /// + /// Gets or sets maximum score threshold. + /// + [JsonProperty(PropertyName = "maxScoreThreshold")] + public int? MaxScoreThreshold { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionMappings.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionMappings.cs new file mode 100644 index 0000000000000..e3ff3c5e7dab3 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionMappings.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of the link mapping of prediction. + /// + public partial class PredictionMappings + { + /// + /// Initializes a new instance of the PredictionMappings class. + /// + public PredictionMappings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PredictionMappings class. + /// + /// The score of the link mapping. + /// The grade of the link mapping. + /// The reason of the link mapping. + public PredictionMappings(string score, string grade, string reason) + { + Score = score; + Grade = grade; + Reason = reason; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the score of the link mapping. + /// + [JsonProperty(PropertyName = "score")] + public string Score { get; set; } + + /// + /// Gets or sets the grade of the link mapping. + /// + [JsonProperty(PropertyName = "grade")] + public string Grade { get; set; } + + /// + /// Gets or sets the reason of the link mapping. + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Score == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Score"); + } + if (Grade == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Grade"); + } + if (Reason == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Reason"); + } + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelLifeCycle.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelLifeCycle.cs new file mode 100644 index 0000000000000..aad0e9b14e4ae --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelLifeCycle.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + + /// + /// Defines values for PredictionModelLifeCycle. + /// + public static class PredictionModelLifeCycle + { + public const string New = "New"; + public const string Provisioning = "Provisioning"; + public const string ProvisioningFailed = "ProvisioningFailed"; + public const string PendingDiscovering = "PendingDiscovering"; + public const string Discovering = "Discovering"; + public const string PendingFeaturing = "PendingFeaturing"; + public const string Featuring = "Featuring"; + public const string FeaturingFailed = "FeaturingFailed"; + public const string PendingTraining = "PendingTraining"; + public const string Training = "Training"; + public const string TrainingFailed = "TrainingFailed"; + public const string Evaluating = "Evaluating"; + public const string EvaluatingFailed = "EvaluatingFailed"; + public const string PendingModelConfirmation = "PendingModelConfirmation"; + public const string Active = "Active"; + public const string Deleted = "Deleted"; + public const string HumanIntervention = "HumanIntervention"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelStatus.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelStatus.cs new file mode 100644 index 0000000000000..fe7215a070cff --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionModelStatus.cs @@ -0,0 +1,161 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The prediction model status. + /// + public partial class PredictionModelStatus + { + /// + /// Initializes a new instance of the PredictionModelStatus class. + /// + public PredictionModelStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PredictionModelStatus class. + /// + /// Prediction model life cycle. When prediction + /// is in PendingModelConfirmation status, it is allowed to update the + /// status to PendingFeaturing or Active through API. Possible values + /// include: 'New', 'Provisioning', 'ProvisioningFailed', + /// 'PendingDiscovering', 'Discovering', 'PendingFeaturing', + /// 'Featuring', 'FeaturingFailed', 'PendingTraining', 'Training', + /// 'TrainingFailed', 'Evaluating', 'EvaluatingFailed', + /// 'PendingModelConfirmation', 'Active', 'Deleted', + /// 'HumanIntervention', 'Failed' + /// The hub name. + /// The prediction name. + /// The prediction GUID ID. + /// The model status message. + /// Count of the training set. + /// Count of the test set. + /// Count of the validation + /// set. + /// The training accuracy. + /// The signals used. + /// Version of the model. + public PredictionModelStatus(string status, string tenantId = default(string), string predictionName = default(string), string predictionGuidId = default(string), string message = default(string), int? trainingSetCount = default(int?), int? testSetCount = default(int?), int? validationSetCount = default(int?), int? trainingAccuracy = default(int?), int? signalsUsed = default(int?), string modelVersion = default(string)) + { + TenantId = tenantId; + PredictionName = predictionName; + PredictionGuidId = predictionGuidId; + Status = status; + Message = message; + TrainingSetCount = trainingSetCount; + TestSetCount = testSetCount; + ValidationSetCount = validationSetCount; + TrainingAccuracy = trainingAccuracy; + SignalsUsed = signalsUsed; + ModelVersion = modelVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the hub name. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets the prediction name. + /// + [JsonProperty(PropertyName = "predictionName")] + public string PredictionName { get; private set; } + + /// + /// Gets the prediction GUID ID. + /// + [JsonProperty(PropertyName = "predictionGuidId")] + public string PredictionGuidId { get; private set; } + + /// + /// Gets or sets prediction model life cycle. When prediction is in + /// PendingModelConfirmation status, it is allowed to update the status + /// to PendingFeaturing or Active through API. Possible values include: + /// 'New', 'Provisioning', 'ProvisioningFailed', 'PendingDiscovering', + /// 'Discovering', 'PendingFeaturing', 'Featuring', 'FeaturingFailed', + /// 'PendingTraining', 'Training', 'TrainingFailed', 'Evaluating', + /// 'EvaluatingFailed', 'PendingModelConfirmation', 'Active', + /// 'Deleted', 'HumanIntervention', 'Failed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets the model status message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets count of the training set. + /// + [JsonProperty(PropertyName = "trainingSetCount")] + public int? TrainingSetCount { get; private set; } + + /// + /// Gets count of the test set. + /// + [JsonProperty(PropertyName = "testSetCount")] + public int? TestSetCount { get; private set; } + + /// + /// Gets count of the validation set. + /// + [JsonProperty(PropertyName = "validationSetCount")] + public int? ValidationSetCount { get; private set; } + + /// + /// Gets the training accuracy. + /// + [JsonProperty(PropertyName = "trainingAccuracy")] + public int? TrainingAccuracy { get; private set; } + + /// + /// Gets the signals used. + /// + [JsonProperty(PropertyName = "signalsUsed")] + public int? SignalsUsed { get; private set; } + + /// + /// Gets version of the model. + /// + [JsonProperty(PropertyName = "modelVersion")] + public string ModelVersion { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionResourceFormat.cs new file mode 100644 index 0000000000000..43922521dbfb0 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionResourceFormat.cs @@ -0,0 +1,235 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The prediction resource format. + /// + [Rest.Serialization.JsonTransformation] + public partial class PredictionResourceFormat : ProxyResource + { + /// + /// Initializes a new instance of the PredictionResourceFormat class. + /// + public PredictionResourceFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PredictionResourceFormat class. + /// + /// Negative outcome + /// expression. + /// Positive outcome + /// expression. + /// Primary profile type. + /// Scope expression. + /// Whether do auto analyze. + /// Definition of the link mapping of + /// prediction. + /// Score label. + /// Resource ID. + /// Resource name. + /// Resource type. + /// Description of the prediction. + /// Display name of the prediction. + /// Interaction types involved + /// in the prediction. + /// KPI types involved in the + /// prediction. + /// Relationships involved in the + /// prediction. + /// Provisioning state. Possible values + /// include: 'Provisioning', 'Succeeded', 'Expiring', 'Deleting', + /// 'HumanIntervention', 'Failed' + /// Name of the prediction. + /// The hub name. + /// The prediction grades. + /// System generated + /// entities. + public PredictionResourceFormat(string negativeOutcomeExpression, string positiveOutcomeExpression, string primaryProfileType, string scopeExpression, bool autoAnalyze, PredictionMappings mappings, string scoreLabel, string id = default(string), string name = default(string), string type = default(string), IDictionary description = default(IDictionary), IDictionary displayName = default(IDictionary), IList involvedInteractionTypes = default(IList), IList involvedKpiTypes = default(IList), IList involvedRelationships = default(IList), string provisioningState = default(string), string predictionName = default(string), string tenantId = default(string), IList grades = default(IList), PredictionSystemGeneratedEntities systemGeneratedEntities = default(PredictionSystemGeneratedEntities)) + : base(id, name, type) + { + Description = description; + DisplayName = displayName; + InvolvedInteractionTypes = involvedInteractionTypes; + InvolvedKpiTypes = involvedKpiTypes; + InvolvedRelationships = involvedRelationships; + NegativeOutcomeExpression = negativeOutcomeExpression; + PositiveOutcomeExpression = positiveOutcomeExpression; + PrimaryProfileType = primaryProfileType; + ProvisioningState = provisioningState; + PredictionName = predictionName; + ScopeExpression = scopeExpression; + TenantId = tenantId; + AutoAnalyze = autoAnalyze; + Mappings = mappings; + ScoreLabel = scoreLabel; + Grades = grades; + SystemGeneratedEntities = systemGeneratedEntities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description of the prediction. + /// + [JsonProperty(PropertyName = "properties.description")] + public IDictionary Description { get; set; } + + /// + /// Gets or sets display name of the prediction. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public IDictionary DisplayName { get; set; } + + /// + /// Gets or sets interaction types involved in the prediction. + /// + [JsonProperty(PropertyName = "properties.involvedInteractionTypes")] + public IList InvolvedInteractionTypes { get; set; } + + /// + /// Gets or sets KPI types involved in the prediction. + /// + [JsonProperty(PropertyName = "properties.involvedKpiTypes")] + public IList InvolvedKpiTypes { get; set; } + + /// + /// Gets or sets relationships involved in the prediction. + /// + [JsonProperty(PropertyName = "properties.involvedRelationships")] + public IList InvolvedRelationships { get; set; } + + /// + /// Gets or sets negative outcome expression. + /// + [JsonProperty(PropertyName = "properties.negativeOutcomeExpression")] + public string NegativeOutcomeExpression { get; set; } + + /// + /// Gets or sets positive outcome expression. + /// + [JsonProperty(PropertyName = "properties.positiveOutcomeExpression")] + public string PositiveOutcomeExpression { get; set; } + + /// + /// Gets or sets primary profile type. + /// + [JsonProperty(PropertyName = "properties.primaryProfileType")] + public string PrimaryProfileType { get; set; } + + /// + /// Gets provisioning state. Possible values include: 'Provisioning', + /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets name of the prediction. + /// + [JsonProperty(PropertyName = "properties.predictionName")] + public string PredictionName { get; set; } + + /// + /// Gets or sets scope expression. + /// + [JsonProperty(PropertyName = "properties.scopeExpression")] + public string ScopeExpression { get; set; } + + /// + /// Gets the hub name. + /// + [JsonProperty(PropertyName = "properties.tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets whether do auto analyze. + /// + [JsonProperty(PropertyName = "properties.autoAnalyze")] + public bool AutoAnalyze { get; set; } + + /// + /// Gets or sets definition of the link mapping of prediction. + /// + [JsonProperty(PropertyName = "properties.mappings")] + public PredictionMappings Mappings { get; set; } + + /// + /// Gets or sets score label. + /// + [JsonProperty(PropertyName = "properties.scoreLabel")] + public string ScoreLabel { get; set; } + + /// + /// Gets or sets the prediction grades. + /// + [JsonProperty(PropertyName = "properties.grades")] + public IList Grades { get; set; } + + /// + /// Gets system generated entities. + /// + [JsonProperty(PropertyName = "properties.systemGeneratedEntities")] + public PredictionSystemGeneratedEntities SystemGeneratedEntities { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NegativeOutcomeExpression == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NegativeOutcomeExpression"); + } + if (PositiveOutcomeExpression == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PositiveOutcomeExpression"); + } + if (PrimaryProfileType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrimaryProfileType"); + } + if (ScopeExpression == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ScopeExpression"); + } + if (Mappings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Mappings"); + } + if (ScoreLabel == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ScoreLabel"); + } + if (Mappings != null) + { + Mappings.Validate(); + } + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionSystemGeneratedEntities.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionSystemGeneratedEntities.cs new file mode 100644 index 0000000000000..24741b27458c1 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionSystemGeneratedEntities.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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// System generated entities. + /// + public partial class PredictionSystemGeneratedEntities + { + /// + /// Initializes a new instance of the PredictionSystemGeneratedEntities + /// class. + /// + public PredictionSystemGeneratedEntities() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PredictionSystemGeneratedEntities + /// class. + /// + /// Generated interaction + /// types. + /// Generated links. + /// Generated KPIs. + public PredictionSystemGeneratedEntities(IList generatedInteractionTypes = default(IList), IList generatedLinks = default(IList), IDictionary generatedKpis = default(IDictionary)) + { + GeneratedInteractionTypes = generatedInteractionTypes; + GeneratedLinks = generatedLinks; + GeneratedKpis = generatedKpis; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets generated interaction types. + /// + [JsonProperty(PropertyName = "generatedInteractionTypes")] + public IList GeneratedInteractionTypes { get; set; } + + /// + /// Gets or sets generated links. + /// + [JsonProperty(PropertyName = "generatedLinks")] + public IList GeneratedLinks { get; set; } + + /// + /// Gets or sets generated KPIs. + /// + [JsonProperty(PropertyName = "generatedKpis")] + public IDictionary GeneratedKpis { get; set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionTrainingResults.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionTrainingResults.cs new file mode 100644 index 0000000000000..2c3398490ef27 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PredictionTrainingResults.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The training results of the prediction. + /// + public partial class PredictionTrainingResults + { + /// + /// Initializes a new instance of the PredictionTrainingResults class. + /// + public PredictionTrainingResults() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PredictionTrainingResults class. + /// + /// The hub name. + /// Score name. + /// Prediction + /// distribution. + /// Canonical profiles. + /// Instance count of the + /// primary profile. + public PredictionTrainingResults(string tenantId = default(string), string scoreName = default(string), PredictionDistributionDefinition predictionDistribution = default(PredictionDistributionDefinition), IList canonicalProfiles = default(IList), long? primaryProfileInstanceCount = default(long?)) + { + TenantId = tenantId; + ScoreName = scoreName; + PredictionDistribution = predictionDistribution; + CanonicalProfiles = canonicalProfiles; + PrimaryProfileInstanceCount = primaryProfileInstanceCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the hub name. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets score name. + /// + [JsonProperty(PropertyName = "scoreName")] + public string ScoreName { get; private set; } + + /// + /// Gets prediction distribution. + /// + [JsonProperty(PropertyName = "predictionDistribution")] + public PredictionDistributionDefinition PredictionDistribution { get; private set; } + + /// + /// Gets canonical profiles. + /// + [JsonProperty(PropertyName = "canonicalProfiles")] + public IList CanonicalProfiles { get; private set; } + + /// + /// Gets instance count of the primary profile. + /// + [JsonProperty(PropertyName = "primaryProfileInstanceCount")] + public long? PrimaryProfileInstanceCount { get; private set; } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProfileEnumValidValuesFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProfileEnumValidValuesFormat.cs index 2b3061849821b..70d9c98d460cd 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProfileEnumValidValuesFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProfileEnumValidValuesFormat.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class ProfileEnumValidValuesFormat /// Initializes a new instance of the ProfileEnumValidValuesFormat /// class. /// - public ProfileEnumValidValuesFormat() { } + public ProfileEnumValidValuesFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the ProfileEnumValidValuesFormat @@ -38,8 +40,14 @@ public ProfileEnumValidValuesFormat(int? value = default(int?), IDictionary + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the integer value of the enum member. /// @@ -54,4 +62,3 @@ public ProfileEnumValidValuesFormat(int? value = default(int?), IDictionary // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,13 +20,16 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The profile resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class ProfileResourceFormat : ProxyResource { /// /// Initializes a new instance of the ProfileResourceFormat class. /// - public ProfileResourceFormat() { } + public ProfileResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the ProfileResourceFormat class. @@ -49,8 +51,8 @@ public partial class ProfileResourceFormat : ProxyResource /// Large Image associated with the Property /// or EntityType. /// The api entity set name. This - /// becomes the odata entity set name for the entity Type being refered - /// in this object. + /// becomes the odata entity set name for the entity Type being + /// referred in this object. /// Type of entity. Possible values include: /// 'None', 'Profile', 'Interaction', 'Relationship' /// The properties of the Profile. @@ -89,8 +91,14 @@ public ProfileResourceFormat(string id = default(string), string name = default( TimestampFieldName = timestampFieldName; TypeName = typeName; StrongIds = strongIds; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the attributes for the Type. /// @@ -138,7 +146,7 @@ public ProfileResourceFormat(string id = default(string), string name = default( /// /// Gets or sets the api entity set name. This becomes the odata entity - /// set name for the entity Type being refered in this object. + /// set name for the entity Type being referred in this object. /// [JsonProperty(PropertyName = "properties.apiEntitySetName")] public string ApiEntitySetName { get; set; } @@ -166,14 +174,14 @@ public ProfileResourceFormat(string id = default(string), string name = default( /// Gets the last changed time for the type definition. /// [JsonProperty(PropertyName = "properties.lastChangedUtc")] - public System.DateTime? LastChangedUtc { get; protected set; } + public System.DateTime? LastChangedUtc { get; private set; } /// /// Gets provisioning state. Possible values include: 'Provisioning', /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the schema org link. This helps ACI identify and @@ -186,7 +194,7 @@ public ProfileResourceFormat(string id = default(string), string name = default( /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets or sets the timestamp property name. Represents the time when @@ -209,4 +217,3 @@ public ProfileResourceFormat(string id = default(string), string name = default( } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PropertyDefinition.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PropertyDefinition.cs index 00618125365fb..4e69117c4ef8f 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PropertyDefinition.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/PropertyDefinition.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class PropertyDefinition /// /// Initializes a new instance of the PropertyDefinition class. /// - public PropertyDefinition() { } + public PropertyDefinition() + { + CustomInit(); + } /// /// Initializes a new instance of the PropertyDefinition class. @@ -47,7 +49,7 @@ public partial class PropertyDefinition /// Whether the property is a name or a part of /// name. /// Whether property value is required on - /// instances, IsRequired field only for Intercation. Profile Instance + /// instances, IsRequired field only for Interaction. Profile Instance /// will not check for required field. /// The ID associated with the /// property. @@ -57,7 +59,11 @@ public partial class PropertyDefinition /// string. /// Whether property is available in /// graph or not. - public PropertyDefinition(string fieldName, string fieldType, string arrayValueSeparator = default(string), IList enumValidValues = default(IList), bool? isArray = default(bool?), bool? isEnum = default(bool?), bool? isFlagEnum = default(bool?), bool? isImage = default(bool?), bool? isLocalizedString = default(bool?), bool? isName = default(bool?), bool? isRequired = default(bool?), string propertyId = default(string), string schemaItemPropLink = default(string), int? maxLength = default(int?), bool? isAvailableInGraph = default(bool?)) + /// This is specific to + /// interactions modeled as activities. Data sources are used to + /// determine where data is stored and also in precedence + /// rules. + public PropertyDefinition(string fieldName, string fieldType, string arrayValueSeparator = default(string), IList enumValidValues = default(IList), bool? isArray = default(bool?), bool? isEnum = default(bool?), bool? isFlagEnum = default(bool?), bool? isImage = default(bool?), bool? isLocalizedString = default(bool?), bool? isName = default(bool?), bool? isRequired = default(bool?), string propertyId = default(string), string schemaItemPropLink = default(string), int? maxLength = default(int?), bool? isAvailableInGraph = default(bool?), IList dataSourcePrecedenceRules = default(IList)) { ArrayValueSeparator = arrayValueSeparator; EnumValidValues = enumValidValues; @@ -74,8 +80,15 @@ public PropertyDefinition(string fieldName, string fieldType, string arrayValueS SchemaItemPropLink = schemaItemPropLink; MaxLength = maxLength; IsAvailableInGraph = isAvailableInGraph; + DataSourcePrecedenceRules = dataSourcePrecedenceRules; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets array value separator for properties with isArray set. /// @@ -139,7 +152,7 @@ public PropertyDefinition(string fieldName, string fieldType, string arrayValueS /// /// Gets or sets whether property value is required on instances, - /// IsRequired field only for Intercation. Profile Instance will not + /// IsRequired field only for Interaction. Profile Instance will not /// check for required field. /// [JsonProperty(PropertyName = "isRequired")] @@ -170,6 +183,14 @@ public PropertyDefinition(string fieldName, string fieldType, string arrayValueS [JsonProperty(PropertyName = "isAvailableInGraph")] public bool? IsAvailableInGraph { get; set; } + /// + /// Gets this is specific to interactions modeled as activities. Data + /// sources are used to determine where data is stored and also in + /// precedence rules. + /// + [JsonProperty(PropertyName = "dataSourcePrecedenceRules")] + public IList DataSourcePrecedenceRules { get; private set; } + /// /// Validate the object. /// @@ -189,4 +210,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProvisioningStates.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProvisioningStates.cs index cd5d0b706c049..1b4284f65aa0a 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProvisioningStates.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProvisioningStates.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; /// /// Defines values for ProvisioningStates. @@ -25,4 +24,3 @@ public static class ProvisioningStates public const string Failed = "Failed"; } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProxyResource.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProxyResource.cs index 9c526182086e5..d09a0bd1bda6d 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProxyResource.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ProxyResource.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Newtonsoft.Json; using System.Linq; @@ -24,7 +23,10 @@ public partial class ProxyResource : IResource /// /// Initializes a new instance of the ProxyResource class. /// - public ProxyResource() { } + public ProxyResource() + { + CustomInit(); + } /// /// Initializes a new instance of the ProxyResource class. @@ -37,26 +39,31 @@ public ProxyResource(string id = default(string), string name = default(string), Id = id; Name = name; Type = type; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets resource ID. /// [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } + public string Id { get; private set; } /// /// Gets resource name. /// [JsonProperty(PropertyName = "name")] - public string Name { get; protected set; } + public string Name { get; private set; } /// /// Gets resource type. /// [JsonProperty(PropertyName = "type")] - public string Type { get; protected set; } + public string Type { get; private set; } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkFieldMapping.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkFieldMapping.cs index 90067320035dc..68e0b041a7a11 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkFieldMapping.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkFieldMapping.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -24,7 +23,10 @@ public partial class RelationshipLinkFieldMapping /// Initializes a new instance of the RelationshipLinkFieldMapping /// class. /// - public RelationshipLinkFieldMapping() { } + public RelationshipLinkFieldMapping() + { + CustomInit(); + } /// /// Initializes a new instance of the RelationshipLinkFieldMapping @@ -41,8 +43,14 @@ public RelationshipLinkFieldMapping(string interactionFieldName, string relation InteractionFieldName = interactionFieldName; LinkType = linkType; RelationshipFieldName = relationshipFieldName; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the field name on the Interaction Type. /// @@ -81,4 +89,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkResourceFormat.cs index 7b1c1f21467dd..d35c648ee38e3 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipLinkResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,14 +20,17 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The relationship link resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class RelationshipLinkResourceFormat : ProxyResource { /// /// Initializes a new instance of the RelationshipLinkResourceFormat /// class. /// - public RelationshipLinkResourceFormat() { } + public RelationshipLinkResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the RelationshipLinkResourceFormat @@ -57,7 +59,7 @@ public partial class RelationshipLinkResourceFormat : ProxyResource /// 'HumanIntervention', 'Failed' /// The relationship guid id. /// The hub name. - public RelationshipLinkResourceFormat(string interactionType, IList profilePropertyReferences, IList relatedProfilePropertyReferences, string relationshipName, string id = default(string), string name = default(string), string type = default(string), IDictionary displayName = default(IDictionary), IDictionary description = default(IDictionary), string linkName = default(string), IList mappings = default(IList), string provisioningState = default(string), string relationshipGuidId = default(string), string tenantId = default(string)) + public RelationshipLinkResourceFormat(string interactionType, IList profilePropertyReferences, IList relatedProfilePropertyReferences, string relationshipName, string id = default(string), string name = default(string), string type = default(string), IDictionary displayName = default(IDictionary), IDictionary description = default(IDictionary), string linkName = default(string), IList mappings = default(IList), string provisioningState = default(string), string relationshipGuidId = default(string), string tenantId = default(string)) : base(id, name, type) { DisplayName = displayName; @@ -71,8 +73,14 @@ public RelationshipLinkResourceFormat(string interactionType, IList + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets localized display name for the Relationship Link. /// @@ -96,7 +104,7 @@ public RelationshipLinkResourceFormat(string interactionType, IList [JsonProperty(PropertyName = "properties.linkName")] - public string LinkName { get; protected set; } + public string LinkName { get; private set; } /// /// Gets or sets the mappings between Interaction and Relationship @@ -110,21 +118,21 @@ public RelationshipLinkResourceFormat(string interactionType, IList [JsonProperty(PropertyName = "properties.profilePropertyReferences")] - public IList ProfilePropertyReferences { get; set; } + public IList ProfilePropertyReferences { get; set; } /// /// Gets provisioning state. Possible values include: 'Provisioning', /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets the property references for the Related Profile of the /// Relationship. /// [JsonProperty(PropertyName = "properties.relatedProfilePropertyReferences")] - public IList RelatedProfilePropertyReferences { get; set; } + public IList RelatedProfilePropertyReferences { get; set; } /// /// Gets or sets the Relationship associated with the Link. @@ -136,13 +144,13 @@ public RelationshipLinkResourceFormat(string interactionType, IList [JsonProperty(PropertyName = "properties.relationshipGuidId")] - public string RelationshipGuidId { get; protected set; } + public string RelationshipGuidId { get; private set; } /// /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Validate the object. @@ -201,4 +209,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipResourceFormat.cs index 93ab45a6d9a04..16b8c7ddb1e05 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,13 +20,16 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The relationship resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class RelationshipResourceFormat : ProxyResource { /// /// Initializes a new instance of the RelationshipResourceFormat class. /// - public RelationshipResourceFormat() { } + public RelationshipResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the RelationshipResourceFormat class. @@ -70,8 +72,14 @@ public RelationshipResourceFormat(string profileType, string relatedProfileType, RelatedProfileType = relatedProfileType; RelationshipGuidId = relationshipGuidId; TenantId = tenantId; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the Relationship Cardinality. Possible values include: /// 'OneToOne', 'OneToMany', 'ManyToMany' @@ -121,13 +129,13 @@ public RelationshipResourceFormat(string profileType, string relatedProfileType, /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets the Relationship name. /// [JsonProperty(PropertyName = "properties.relationshipName")] - public string RelationshipName { get; protected set; } + public string RelationshipName { get; private set; } /// /// Gets or sets related profile being referenced. @@ -139,13 +147,13 @@ public RelationshipResourceFormat(string profileType, string relatedProfileType, /// Gets the relationship guid id. /// [JsonProperty(PropertyName = "properties.relationshipGuidId")] - public string RelationshipGuidId { get; protected set; } + public string RelationshipGuidId { get; private set; } /// /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Validate the object. @@ -186,4 +194,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeFieldMapping.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeFieldMapping.cs index 9e7422b73157b..abfd82318a892 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeFieldMapping.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeFieldMapping.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -25,7 +24,10 @@ public partial class RelationshipTypeFieldMapping /// Initializes a new instance of the RelationshipTypeFieldMapping /// class. /// - public RelationshipTypeFieldMapping() { } + public RelationshipTypeFieldMapping() + { + CustomInit(); + } /// /// Initializes a new instance of the RelationshipTypeFieldMapping @@ -39,8 +41,14 @@ public RelationshipTypeFieldMapping(string profileFieldName, string relatedProfi { ProfileFieldName = profileFieldName; RelatedProfileKeyProperty = relatedProfileKeyProperty; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets specifies the fieldName in profile. /// @@ -73,4 +81,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeMapping.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeMapping.cs index e81b8f5c44188..0ae36dad1bd25 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeMapping.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipTypeMapping.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -26,7 +25,10 @@ public partial class RelationshipTypeMapping /// /// Initializes a new instance of the RelationshipTypeMapping class. /// - public RelationshipTypeMapping() { } + public RelationshipTypeMapping() + { + CustomInit(); + } /// /// Initializes a new instance of the RelationshipTypeMapping class. @@ -37,8 +39,14 @@ public partial class RelationshipTypeMapping public RelationshipTypeMapping(IList fieldMappings) { FieldMappings = fieldMappings; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets maps a profile property with the StrongId of related /// profile. This is an array to support StrongIds that are composite @@ -72,4 +80,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipsLookup.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipsLookup.cs index 6d594aad24081..953c1243874df 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipsLookup.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RelationshipsLookup.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +23,10 @@ public partial class RelationshipsLookup /// /// Initializes a new instance of the RelationshipsLookup class. /// - public RelationshipsLookup() { } + public RelationshipsLookup() + { + CustomInit(); + } /// /// Initializes a new instance of the RelationshipsLookup class. @@ -37,45 +39,50 @@ public partial class RelationshipsLookup /// references for the related profile type. /// The name of existing /// Relationship. - public RelationshipsLookup(string profileName = default(string), IList profilePropertyReferences = default(IList), string relatedProfileName = default(string), IList relatedProfilePropertyReferences = default(IList), string existingRelationshipName = default(string)) + public RelationshipsLookup(string profileName = default(string), IList profilePropertyReferences = default(IList), string relatedProfileName = default(string), IList relatedProfilePropertyReferences = default(IList), string existingRelationshipName = default(string)) { ProfileName = profileName; ProfilePropertyReferences = profilePropertyReferences; RelatedProfileName = relatedProfileName; RelatedProfilePropertyReferences = relatedProfilePropertyReferences; ExistingRelationshipName = existingRelationshipName; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the relationship profile. /// [JsonProperty(PropertyName = "profileName")] - public string ProfileName { get; protected set; } + public string ProfileName { get; private set; } /// /// Gets the property references for the profile type. /// [JsonProperty(PropertyName = "profilePropertyReferences")] - public IList ProfilePropertyReferences { get; protected set; } + public IList ProfilePropertyReferences { get; private set; } /// /// Gets the related profile. /// [JsonProperty(PropertyName = "relatedProfileName")] - public string RelatedProfileName { get; protected set; } + public string RelatedProfileName { get; private set; } /// /// Gets the property references for the related profile type. /// [JsonProperty(PropertyName = "relatedProfilePropertyReferences")] - public IList RelatedProfilePropertyReferences { get; protected set; } + public IList RelatedProfilePropertyReferences { get; private set; } /// /// Gets the name of existing Relationship. /// [JsonProperty(PropertyName = "existingRelationshipName")] - public string ExistingRelationshipName { get; protected set; } + public string ExistingRelationshipName { get; private set; } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Resource.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Resource.cs index 4c1f7aec5e2eb..1fae15a3aa4b8 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Resource.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Resource.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -26,42 +25,51 @@ public partial class Resource : IResource /// /// Initializes a new instance of the Resource class. /// - public Resource() { } + public Resource() + { + CustomInit(); + } /// /// Initializes a new instance of the Resource class. /// - /// Resource location. /// Resource ID. /// Resource name. /// Resource type. + /// Resource location. /// Resource tags. - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) { Id = id; Name = name; Type = type; Location = location; Tags = tags; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets resource ID. /// [JsonProperty(PropertyName = "id")] - public string Id { get; protected set; } + public string Id { get; private set; } /// /// Gets resource name. /// [JsonProperty(PropertyName = "name")] - public string Name { get; protected set; } + public string Name { get; private set; } /// /// Gets resource type. /// [JsonProperty(PropertyName = "type")] - public string Type { get; protected set; } + public string Type { get; private set; } /// /// Gets or sets resource location. @@ -75,19 +83,5 @@ public Resource(string location, string id = default(string), string name = defa [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ResourceSetDescription.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ResourceSetDescription.cs index da8ae2585e9c8..f5932742b45c7 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ResourceSetDescription.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ResourceSetDescription.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -24,7 +23,10 @@ public partial class ResourceSetDescription /// /// Initializes a new instance of the ResourceSetDescription class. /// - public ResourceSetDescription() { } + public ResourceSetDescription() + { + CustomInit(); + } /// /// Initializes a new instance of the ResourceSetDescription class. @@ -36,8 +38,14 @@ public ResourceSetDescription(IList elements = default(IList), I { Elements = elements; Exceptions = exceptions; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the elements included in the set. /// @@ -53,4 +61,3 @@ public ResourceSetDescription(IList elements = default(IList), I } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleAssignmentResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleAssignmentResourceFormat.cs index 89ab30568e130..35e1210df1af9 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleAssignmentResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleAssignmentResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,14 +20,17 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The Role Assignment resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class RoleAssignmentResourceFormat : ProxyResource { /// /// Initializes a new instance of the RoleAssignmentResourceFormat /// class. /// - public RoleAssignmentResourceFormat() { } + public RoleAssignmentResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the RoleAssignmentResourceFormat @@ -95,19 +97,25 @@ public RoleAssignmentResourceFormat(RoleTypes role, IList p RoleAssignments = roleAssignments; ConflationPolicies = conflationPolicies; Segments = segments; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets the name of the metadata object. /// [JsonProperty(PropertyName = "properties.assignmentName")] - public string AssignmentName { get; protected set; } + public string AssignmentName { get; private set; } /// /// Gets or sets localized display names for the metadata. @@ -126,7 +134,7 @@ public RoleAssignmentResourceFormat(RoleTypes role, IList p /// 'Succeeded', 'Expiring', 'Deleting', 'HumanIntervention', 'Failed' /// [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; protected set; } + public string ProvisioningState { get; private set; } /// /// Gets or sets type of roles. Possible values include: 'Admin', @@ -244,4 +252,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleResourceFormat.cs index c69c56e6370d7..739d68fde8bd3 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleResourceFormat.cs @@ -1,31 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Linq; /// /// The role resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class RoleResourceFormat : ProxyResource { /// /// Initializes a new instance of the RoleResourceFormat class. /// - public RoleResourceFormat() { } + public RoleResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the RoleResourceFormat class. @@ -40,8 +42,14 @@ public RoleResourceFormat(string id = default(string), string name = default(str { RoleName = roleName; Description = description; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the role name. /// @@ -56,4 +64,3 @@ public RoleResourceFormat(string id = default(string), string name = default(str } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleTypes.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleTypes.cs index ae48efdcef13d..892dcc2533eca 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleTypes.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/RoleTypes.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; @@ -35,5 +34,51 @@ public enum RoleTypes [EnumMember(Value = "DataReader")] DataReader } -} + internal static class RoleTypesEnumExtension + { + internal static string ToSerializedValue(this RoleTypes? value) + { + return value == null ? null : ((RoleTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this RoleTypes value) + { + switch( value ) + { + case RoleTypes.Admin: + return "Admin"; + case RoleTypes.Reader: + return "Reader"; + case RoleTypes.ManageAdmin: + return "ManageAdmin"; + case RoleTypes.ManageReader: + return "ManageReader"; + case RoleTypes.DataAdmin: + return "DataAdmin"; + case RoleTypes.DataReader: + return "DataReader"; + } + return null; + } + internal static RoleTypes? ParseRoleTypes(this string value) + { + switch( value ) + { + case "Admin": + return RoleTypes.Admin; + case "Reader": + return RoleTypes.Reader; + case "ManageAdmin": + return RoleTypes.ManageAdmin; + case "ManageReader": + return RoleTypes.ManageReader; + case "DataAdmin": + return RoleTypes.DataAdmin; + case "DataReader": + return RoleTypes.DataReader; + } + return null; + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceConnectorProperties.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceConnectorProperties.cs index db446cbf57c9e..9115fc982c919 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceConnectorProperties.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceConnectorProperties.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -26,7 +25,10 @@ public partial class SalesforceConnectorProperties /// Initializes a new instance of the SalesforceConnectorProperties /// class. /// - public SalesforceConnectorProperties() { } + public SalesforceConnectorProperties() + { + CustomInit(); + } /// /// Initializes a new instance of the SalesforceConnectorProperties @@ -38,8 +40,14 @@ public SalesforceConnectorProperties(SalesforceDiscoverSetting usersetting, ILis { Usersetting = usersetting; Salesforcetables = salesforcetables; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the user settings. /// @@ -85,4 +93,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceDiscoverSetting.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceDiscoverSetting.cs index 22dfb499f14f9..3020f99f15ecf 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceDiscoverSetting.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceDiscoverSetting.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class SalesforceDiscoverSetting /// /// Initializes a new instance of the SalesforceDiscoverSetting class. /// - public SalesforceDiscoverSetting() { } + public SalesforceDiscoverSetting() + { + CustomInit(); + } /// /// Initializes a new instance of the SalesforceDiscoverSetting class. @@ -33,8 +35,14 @@ public partial class SalesforceDiscoverSetting public SalesforceDiscoverSetting(string salesforceConnectionStringSecretUrl) { SalesforceConnectionStringSecretUrl = salesforceConnectionStringSecretUrl; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the salesforce connection string secret URL. /// @@ -56,4 +64,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceTable.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceTable.cs index 84e63cc8e62bd..a807a043d45bf 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceTable.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SalesforceTable.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,7 +22,10 @@ public partial class SalesforceTable /// /// Initializes a new instance of the SalesforceTable class. /// - public SalesforceTable() { } + public SalesforceTable() + { + CustomInit(); + } /// /// Initializes a new instance of the SalesforceTable class. @@ -41,8 +43,14 @@ public SalesforceTable(string tableCategory, string tableName, string tableSchem TableName = tableName; TableRemarks = tableRemarks; TableSchema = tableSchema; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets indicating whether this instance is profile. /// @@ -96,4 +104,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Status.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Status.cs new file mode 100644 index 0000000000000..69791a777c742 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/Status.cs @@ -0,0 +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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights.Models +{ + + /// + /// Defines values for Status. + /// + public static class Status + { + public const string None = "None"; + public const string Active = "Active"; + public const string Deleted = "Deleted"; + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/StrongId.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/StrongId.cs index d1ada77d0713a..31ee6db753f21 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/StrongId.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/StrongId.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class StrongId /// /// Initializes a new instance of the StrongId class. /// - public StrongId() { } + public StrongId() + { + CustomInit(); + } /// /// Initializes a new instance of the StrongId class. @@ -42,8 +44,14 @@ public StrongId(IList keyPropertyNames, string strongIdName, IDictionary StrongIdName = strongIdName; DisplayName = displayName; Description = description; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets or sets the properties which make up the unique ID. /// @@ -87,4 +95,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SuggestRelationshipLinksResponse.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SuggestRelationshipLinksResponse.cs index 6efcd66aabd35..956f0b2465966 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SuggestRelationshipLinksResponse.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/SuggestRelationshipLinksResponse.cs @@ -1,16 +1,15 @@ +// // 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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -25,7 +24,10 @@ public partial class SuggestRelationshipLinksResponse /// Initializes a new instance of the SuggestRelationshipLinksResponse /// class. /// - public SuggestRelationshipLinksResponse() { } + public SuggestRelationshipLinksResponse() + { + CustomInit(); + } /// /// Initializes a new instance of the SuggestRelationshipLinksResponse @@ -38,20 +40,25 @@ public SuggestRelationshipLinksResponse(string interactionName = default(string) { InteractionName = interactionName; SuggestedRelationships = suggestedRelationships; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets the interaction name. /// [JsonProperty(PropertyName = "interactionName")] - public string InteractionName { get; protected set; } + public string InteractionName { get; private set; } /// /// Gets suggested relationships for the type. /// [JsonProperty(PropertyName = "suggestedRelationships")] - public IList SuggestedRelationships { get; protected set; } + public IList SuggestedRelationships { get; private set; } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/TypePropertiesMapping.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/TypePropertiesMapping.cs index 2070f8ddc5da1..ead5030eead9a 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/TypePropertiesMapping.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/TypePropertiesMapping.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -23,45 +22,44 @@ public partial class TypePropertiesMapping /// /// Initializes a new instance of the TypePropertiesMapping class. /// - public TypePropertiesMapping() { } + public TypePropertiesMapping() + { + CustomInit(); + } /// /// Initializes a new instance of the TypePropertiesMapping class. /// - /// Property name on the - /// source Interaction Type. - /// Property name on the target - /// Profile Type. - /// Flag to indicate whether the Profile - /// Type property is an id on the Profile Type. + /// Property name on the source + /// Entity Type. + /// Property name on the target Entity + /// Type. /// Link type. Possible values include: /// 'UpdateAlways', 'CopyIfNull' - public TypePropertiesMapping(string interactionTypePropertyName, string profileTypePropertyName, bool? isProfileTypeId = default(bool?), LinkTypes? linkType = default(LinkTypes?)) + public TypePropertiesMapping(string sourcePropertyName, string targetPropertyName, LinkTypes? linkType = default(LinkTypes?)) { - InteractionTypePropertyName = interactionTypePropertyName; - ProfileTypePropertyName = profileTypePropertyName; - IsProfileTypeId = isProfileTypeId; + SourcePropertyName = sourcePropertyName; + TargetPropertyName = targetPropertyName; LinkType = linkType; + CustomInit(); } /// - /// Gets or sets Property name on the source Interaction Type. + /// An initialization method that performs custom operations like setting defaults /// - [JsonProperty(PropertyName = "interactionTypePropertyName")] - public string InteractionTypePropertyName { get; set; } + partial void CustomInit(); /// - /// Gets or sets property name on the target Profile Type. + /// Gets or sets Property name on the source Entity Type. /// - [JsonProperty(PropertyName = "profileTypePropertyName")] - public string ProfileTypePropertyName { get; set; } + [JsonProperty(PropertyName = "sourcePropertyName")] + public string SourcePropertyName { get; set; } /// - /// Gets or sets flag to indicate whether the Profile Type property is - /// an id on the Profile Type. + /// Gets or sets property name on the target Entity Type. /// - [JsonProperty(PropertyName = "isProfileTypeId")] - public bool? IsProfileTypeId { get; set; } + [JsonProperty(PropertyName = "targetPropertyName")] + public string TargetPropertyName { get; set; } /// /// Gets or sets link type. Possible values include: 'UpdateAlways', @@ -78,15 +76,14 @@ public TypePropertiesMapping(string interactionTypePropertyName, string profileT /// public virtual void Validate() { - if (InteractionTypePropertyName == null) + if (SourcePropertyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "InteractionTypePropertyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "SourcePropertyName"); } - if (ProfileTypePropertyName == null) + if (TargetPropertyName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ProfileTypePropertyName"); + throw new ValidationException(ValidationRules.CannotBeNull, "TargetPropertyName"); } } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ViewResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ViewResourceFormat.cs index 1e0a69fcea420..d7d13aa1c1b8f 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ViewResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/ViewResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,13 +20,16 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The view resource format. /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class ViewResourceFormat : ProxyResource { /// /// Initializes a new instance of the ViewResourceFormat class. /// - public ViewResourceFormat() { } + public ViewResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the ViewResourceFormat class. @@ -54,13 +56,19 @@ public ViewResourceFormat(string definition, string id = default(string), string Definition = definition; Changed = changed; Created = created; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets name of the view. /// [JsonProperty(PropertyName = "properties.viewName")] - public string ViewName { get; protected set; } + public string ViewName { get; private set; } /// /// Gets or sets the user ID. @@ -72,7 +80,7 @@ public ViewResourceFormat(string definition, string id = default(string), string /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets or sets localized display name for the view. @@ -90,13 +98,13 @@ public ViewResourceFormat(string definition, string id = default(string), string /// Gets date time when view was last modified. /// [JsonProperty(PropertyName = "properties.changed")] - public System.DateTime? Changed { get; protected set; } + public System.DateTime? Changed { get; private set; } /// /// Gets date time when view was created. /// [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; protected set; } + public System.DateTime? Created { get; private set; } /// /// Validate the object. @@ -113,4 +121,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/WidgetTypeResourceFormat.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/WidgetTypeResourceFormat.cs index 9aefa9b066c7b..2e8742ffa30d1 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/WidgetTypeResourceFormat.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Models/WidgetTypeResourceFormat.cs @@ -1,18 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights.Models { - using Azure; - using Management; - using CustomerInsights; - using Rest; - using Rest.Serialization; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -21,13 +20,16 @@ namespace Microsoft.Azure.Management.CustomerInsights.Models /// /// The WidgetTypeResourceFormat /// - [JsonTransformation] + [Rest.Serialization.JsonTransformation] public partial class WidgetTypeResourceFormat : ProxyResource { /// /// Initializes a new instance of the WidgetTypeResourceFormat class. /// - public WidgetTypeResourceFormat() { } + public WidgetTypeResourceFormat() + { + CustomInit(); + } /// /// Initializes a new instance of the WidgetTypeResourceFormat class. @@ -59,13 +61,19 @@ public WidgetTypeResourceFormat(string definition, string id = default(string), WidgetVersion = widgetVersion; Changed = changed; Created = created; + CustomInit(); } + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + /// /// Gets name of the widget type. /// [JsonProperty(PropertyName = "properties.widgetTypeName")] - public string WidgetTypeName { get; protected set; } + public string WidgetTypeName { get; private set; } /// /// Gets or sets definition for widget type. @@ -95,7 +103,7 @@ public WidgetTypeResourceFormat(string definition, string id = default(string), /// Gets the hub name. /// [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; protected set; } + public string TenantId { get; private set; } /// /// Gets or sets the widget version. @@ -107,13 +115,13 @@ public WidgetTypeResourceFormat(string definition, string id = default(string), /// Gets date time when widget type was last modified. /// [JsonProperty(PropertyName = "properties.changed")] - public System.DateTime? Changed { get; protected set; } + public System.DateTime? Changed { get; private set; } /// /// Gets date time when widget type was created. /// [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; protected set; } + public System.DateTime? Created { get; private set; } /// /// Validate the object. @@ -130,4 +138,3 @@ public virtual void Validate() } } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Operations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Operations.cs new file mode 100644 index 0000000000000..93bf4a57bb826 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/Operations.cs @@ -0,0 +1,400 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights +{ + using Microsoft.Rest; + using Microsoft.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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(CustomerInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the CustomerInsightsManagementClient + /// + public CustomerInsightsManagementClient Client { get; private set; } + + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.CustomerInsights/operations").ToString(); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/OperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/OperationsExtensions.cs new file mode 100644 index 0000000000000..e934b7d498148 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/OperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available Customer Insights REST API operations. + /// + /// + /// 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 IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperations.cs new file mode 100644 index 0000000000000..9ca66074ab45c --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperations.cs @@ -0,0 +1,1711 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights +{ + using Microsoft.Rest; + using Microsoft.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; + + /// + /// PredictionsOperations operations. + /// + internal partial class PredictionsOperations : IServiceOperations, IPredictionsOperations + { + /// + /// Initializes a new instance of the PredictionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PredictionsOperations(CustomerInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the CustomerInsightsManagementClient + /// + public CustomerInsightsManagementClient Client { get; private set; } + + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (hubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + } + if (predictionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "predictionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("hubName", hubName); + tracingParameters.Add("predictionName", predictionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/predictions/{predictionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); + _url = _url.Replace("{predictionName}", System.Uri.EscapeDataString(predictionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets training results. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetTrainingResultsWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (hubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + } + if (predictionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "predictionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("hubName", hubName); + tracingParameters.Add("predictionName", predictionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetTrainingResults", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/predictions/{predictionName}/getTrainingResults").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); + _url = _url.Replace("{predictionName}", System.Uri.EscapeDataString(predictionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets model status of the prediction. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetModelStatusWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (hubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + } + if (predictionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "predictionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("hubName", hubName); + tracingParameters.Add("predictionName", predictionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetModelStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/predictions/{predictionName}/getModelStatus").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); + _url = _url.Replace("{predictionName}", System.Uri.EscapeDataString(predictionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates the model status of prediction. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update prediction model status operation. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task ModelStatusWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, PredictionModelStatus parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (hubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + } + if (predictionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "predictionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("hubName", hubName); + tracingParameters.Add("predictionName", predictionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ModelStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/predictions/{predictionName}/modelStatus").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); + _url = _url.Replace("{predictionName}", System.Uri.EscapeDataString(predictionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHubWithHttpMessagesAsync(string resourceGroupName, string hubName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (hubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("hubName", hubName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHub", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/predictions").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (hubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + } + if (predictionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "predictionName"); + } + if (predictionName != null) + { + if (predictionName.Length > 512) + { + throw new ValidationException(ValidationRules.MaxLength, "predictionName", 512); + } + if (predictionName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "predictionName", 1); + } + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("hubName", hubName); + tracingParameters.Add("predictionName", predictionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/predictions/{predictionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); + _url = _url.Replace("{predictionName}", System.Uri.EscapeDataString(predictionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string hubName, string predictionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (hubName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "hubName"); + } + if (predictionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "predictionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("hubName", hubName); + tracingParameters.Add("predictionName", predictionName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomerInsights/hubs/{hubName}/predictions/{predictionName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{hubName}", System.Uri.EscapeDataString(hubName)); + _url = _url.Replace("{predictionName}", System.Uri.EscapeDataString(predictionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByHubNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByHubNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", 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 (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + 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) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperationsExtensions.cs new file mode 100644 index 0000000000000..be5de5d8a652e --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/PredictionsOperationsExtensions.cs @@ -0,0 +1,476 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PredictionsOperations. + /// + public static partial class PredictionsOperationsExtensions + { + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction operation. + /// + public static PredictionResourceFormat CreateOrUpdate(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, hubName, predictionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + public static PredictionResourceFormat Get(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName) + { + return operations.GetAsync(resourceGroupName, hubName, predictionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + public static void Delete(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName) + { + operations.DeleteAsync(resourceGroupName, hubName, predictionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets training results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + public static PredictionTrainingResults GetTrainingResults(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName) + { + return operations.GetTrainingResultsAsync(resourceGroupName, hubName, predictionName).GetAwaiter().GetResult(); + } + + /// + /// Gets training results. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// The cancellation token. + /// + public static async Task GetTrainingResultsAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetTrainingResultsWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets model status of the prediction. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + public static PredictionModelStatus GetModelStatus(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName) + { + return operations.GetModelStatusAsync(resourceGroupName, hubName, predictionName).GetAwaiter().GetResult(); + } + + /// + /// Gets model status of the prediction. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// The cancellation token. + /// + public static async Task GetModelStatusAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetModelStatusWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates the model status of prediction. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update prediction model status operation. + /// + public static void ModelStatus(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, PredictionModelStatus parameters) + { + operations.ModelStatusAsync(resourceGroupName, hubName, predictionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the model status of prediction. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update prediction model status operation. + /// + /// + /// The cancellation token. + /// + public static async Task ModelStatusAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, PredictionModelStatus parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ModelStatusWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + public static IPage ListByHub(this IPredictionsOperations operations, string resourceGroupName, string hubName) + { + return operations.ListByHubAsync(resourceGroupName, hubName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHubAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHubWithHttpMessagesAsync(resourceGroupName, hubName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction operation. + /// + public static PredictionResourceFormat BeginCreateOrUpdate(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, hubName, predictionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a Prediction or updates an existing Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// Parameters supplied to the create/update Prediction operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, PredictionResourceFormat parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + public static void BeginDelete(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName) + { + operations.BeginDeleteAsync(resourceGroupName, hubName, predictionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Prediction in the hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the hub. + /// + /// + /// The name of the Prediction. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IPredictionsOperations operations, string resourceGroupName, string hubName, string predictionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, predictionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByHubNext(this IPredictionsOperations operations, string nextPageLink) + { + return operations.ListByHubNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the predictions in the specified hub. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByHubNextAsync(this IPredictionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByHubNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperations.cs index c6fa3e5ccfc97..4ea62e41ab0a9 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -171,9 +171,9 @@ public async Task> GetWithHttpMess _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -403,9 +403,9 @@ public async Task>> ListByHu _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -610,9 +610,9 @@ public async Task>> GetEnrichingKpis _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -838,9 +838,9 @@ public async Task> BeginCreateOrUp _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -874,7 +874,7 @@ public async Task> BeginCreateOrUp if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -1054,9 +1054,9 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1110,11 +1110,19 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -1201,9 +1209,9 @@ public async Task>> ListByHu _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1323,4 +1331,3 @@ public async Task>> ListByHu } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperationsExtensions.cs index 26364ea272152..714c8760a0a3e 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ProfilesOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; @@ -173,7 +173,7 @@ public static void Delete(this IProfilesOperations operations, string resourceGr /// public static async Task DeleteAsync(this IProfilesOperations operations, string resourceGroupName, string hubName, string profileName, string localeCode = "en-us", CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, profileName, localeCode, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, profileName, localeCode, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -370,7 +370,7 @@ public static void BeginDelete(this IProfilesOperations operations, string resou /// public static async Task BeginDeleteAsync(this IProfilesOperations operations, string resourceGroupName, string hubName, string profileName, string localeCode = "en-us", CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, profileName, localeCode, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, profileName, localeCode, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -409,4 +409,3 @@ public static async Task> ListByHubNextAsync(this I } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperations.cs index 233281002e5e7..d6138f70d0bdb 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -164,9 +164,9 @@ public async Task> GetWit _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -385,9 +385,9 @@ public async Task>> _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -618,9 +618,9 @@ public async Task> BeginC _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -654,7 +654,7 @@ public async Task> BeginC if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -826,9 +826,9 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -879,14 +879,22 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -973,9 +981,9 @@ public async Task>> _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1095,4 +1103,3 @@ public async Task>> } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperationsExtensions.cs index 4b765f6dc8e06..47831ab418c13 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipLinksOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -161,7 +161,7 @@ public static void Delete(this IRelationshipLinksOperations operations, string r /// public static async Task DeleteAsync(this IRelationshipLinksOperations operations, string resourceGroupName, string hubName, string relationshipLinkName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipLinkName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipLinkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -298,7 +298,7 @@ public static void BeginDelete(this IRelationshipLinksOperations operations, str /// public static async Task BeginDeleteAsync(this IRelationshipLinksOperations operations, string resourceGroupName, string hubName, string relationshipLinkName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipLinkName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipLinkName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -337,4 +337,3 @@ public static async Task> ListByHubNextAsy } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperations.cs index a4fb23349dfae..d00b0d8b0525a 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -163,9 +163,9 @@ public async Task> GetWithHtt _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -384,9 +384,9 @@ public async Task>> Lis _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -616,9 +616,9 @@ public async Task> BeginCreat _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -652,7 +652,7 @@ public async Task> BeginCreat if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -824,9 +824,9 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -877,14 +877,22 @@ public async Task BeginDeleteWithHttpMessagesAsync(strin HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -971,9 +979,9 @@ public async Task>> Lis _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1093,4 +1101,3 @@ public async Task>> Lis } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperationsExtensions.cs index 35f1af652d3a4..b8447517cf3a1 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RelationshipsOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -159,7 +159,7 @@ public static void Delete(this IRelationshipsOperations operations, string resou /// public static async Task DeleteAsync(this IRelationshipsOperations operations, string resourceGroupName, string hubName, string relationshipName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -294,7 +294,7 @@ public static void BeginDelete(this IRelationshipsOperations operations, string /// public static async Task BeginDeleteAsync(this IRelationshipsOperations operations, string resourceGroupName, string hubName, string relationshipName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipName, null, cancellationToken).ConfigureAwait(false); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, hubName, relationshipName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -333,4 +333,3 @@ public static async Task> ListByHubNextAsync(t } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperations.cs index f2aeaefb201f7..d4e55053e63b2 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -126,9 +126,9 @@ public async Task>> L _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -359,9 +359,9 @@ public async Task> GetWithH _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -561,9 +561,9 @@ public async Task DeleteWithHttpMessagesAsync(string res _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -617,11 +617,19 @@ public async Task DeleteWithHttpMessagesAsync(string res if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -767,9 +775,9 @@ public async Task> BeginCre _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -803,7 +811,7 @@ public async Task> BeginCre if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -946,9 +954,9 @@ public async Task>> L _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1068,4 +1076,3 @@ public async Task>> L } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperationsExtensions.cs index 519e740cc24f1..ada5bd07c7e7d 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RoleAssignmentsOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -199,7 +199,7 @@ public static void Delete(this IRoleAssignmentsOperations operations, string res /// public static async Task DeleteAsync(this IRoleAssignmentsOperations operations, string resourceGroupName, string hubName, string assignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, assignmentName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, assignmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -290,4 +290,3 @@ public static async Task> ListByHubNextAsync } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperations.cs index 87ba96432527e..197f731fd399f 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -126,9 +126,9 @@ public async Task>> ListByHubWi _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -299,9 +299,9 @@ public async Task>> ListByHubNe _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -421,4 +421,3 @@ public async Task>> ListByHubNe } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperationsExtensions.cs index f2b50e8d7898d..7900b0280b532 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/RolesOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -97,4 +97,3 @@ public static async Task> ListByHubNextAsync(this IRol } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/SdkInfo_CustomerInsightsManagementClient.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/SdkInfo_CustomerInsightsManagementClient.cs new file mode 100644 index 0000000000000..12bb96015dad5 --- /dev/null +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/SdkInfo_CustomerInsightsManagementClient.cs @@ -0,0 +1,43 @@ + +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CustomerInsights +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_CustomerInsightsManagementClient + { + get + { + return new Tuple[] + { + new Tuple("CustomerInsights", "AuthorizationPolicies", "2017-04-26"), + new Tuple("CustomerInsights", "ConnectorMappings", "2017-04-26"), + new Tuple("CustomerInsights", "Connectors", "2017-04-26"), + new Tuple("CustomerInsights", "Hubs", "2017-04-26"), + new Tuple("CustomerInsights", "Images", "2017-04-26"), + new Tuple("CustomerInsights", "Interactions", "2017-04-26"), + new Tuple("CustomerInsights", "Kpi", "2017-04-26"), + new Tuple("CustomerInsights", "Links", "2017-04-26"), + new Tuple("CustomerInsights", "Operations", "2017-04-26"), + new Tuple("CustomerInsights", "Predictions", "2017-04-26"), + new Tuple("CustomerInsights", "Profiles", "2017-04-26"), + new Tuple("CustomerInsights", "RelationshipLinks", "2017-04-26"), + new Tuple("CustomerInsights", "Relationships", "2017-04-26"), + new Tuple("CustomerInsights", "RoleAssignments", "2017-04-26"), + new Tuple("CustomerInsights", "Roles", "2017-04-26"), + new Tuple("CustomerInsights", "Views", "2017-04-26"), + new Tuple("CustomerInsights", "WidgetTypes", "2017-04-26"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperations.cs index b10311c2bdbcc..6625934b683fe 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -60,7 +60,7 @@ internal ViewsOperations(CustomerInsightsManagementClient client) /// The name of the hub. /// /// - /// The user ID. Use * to retreive hub level views. + /// The user ID. Use * to retrieve hub level views. /// /// /// Headers that will be added to request. @@ -138,9 +138,9 @@ public async Task>> ListByHubWi _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -259,7 +259,7 @@ public async Task>> ListByHubWi } /// - /// Creates a view or updates an exisiting view in the hub. + /// Creates a view or updates an existing view in the hub. /// /// /// The name of the resource group. @@ -366,9 +366,9 @@ public async Task> CreateOrUpdateWith _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -402,7 +402,7 @@ public async Task> CreateOrUpdateWith if(parameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials @@ -505,7 +505,7 @@ public async Task> CreateOrUpdateWith /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// /// /// Headers that will be added to request. @@ -589,9 +589,9 @@ public async Task> GetWithHttpMessage _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -722,7 +722,7 @@ public async Task> GetWithHttpMessage /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// /// /// Headers that will be added to request. @@ -803,9 +803,9 @@ public async Task DeleteWithHttpMessagesAsync(string res _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -859,11 +859,19 @@ public async Task DeleteWithHttpMessagesAsync(string res if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); @@ -950,9 +958,9 @@ public async Task>> ListByHubNe _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1072,4 +1080,3 @@ public async Task>> ListByHubNe } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperationsExtensions.cs index df12d13009727..45732afdb291d 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/ViewsOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -34,7 +34,7 @@ public static partial class ViewsOperationsExtensions /// The name of the hub. /// /// - /// The user ID. Use * to retreive hub level views. + /// The user ID. Use * to retrieve hub level views. /// public static IPage ListByHub(this IViewsOperations operations, string resourceGroupName, string hubName, string userId) { @@ -54,7 +54,7 @@ public static IPage ListByHub(this IViewsOperations operatio /// The name of the hub. /// /// - /// The user ID. Use * to retreive hub level views. + /// The user ID. Use * to retrieve hub level views. /// /// /// The cancellation token. @@ -68,7 +68,7 @@ public static async Task> ListByHubAsync(this IViewsOp } /// - /// Creates a view or updates an exisiting view in the hub. + /// Creates a view or updates an existing view in the hub. /// /// /// The operations group for this extension method. @@ -91,7 +91,7 @@ public static ViewResourceFormat CreateOrUpdate(this IViewsOperations operations } /// - /// Creates a view or updates an exisiting view in the hub. + /// Creates a view or updates an existing view in the hub. /// /// /// The operations group for this extension method. @@ -135,7 +135,7 @@ public static async Task CreateOrUpdateAsync(this IViewsOper /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// public static ViewResourceFormat Get(this IViewsOperations operations, string resourceGroupName, string hubName, string viewName, string userId) { @@ -158,7 +158,7 @@ public static ViewResourceFormat Get(this IViewsOperations operations, string re /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// /// /// The cancellation token. @@ -187,7 +187,7 @@ public static async Task GetAsync(this IViewsOperations oper /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// public static void Delete(this IViewsOperations operations, string resourceGroupName, string hubName, string viewName, string userId) { @@ -210,14 +210,14 @@ public static void Delete(this IViewsOperations operations, string resourceGroup /// The name of the view. /// /// - /// The user ID. Use * to retreive hub level view. + /// The user ID. Use * to retrieve hub level view. /// /// /// The cancellation token. /// public static async Task DeleteAsync(this IViewsOperations operations, string resourceGroupName, string hubName, string viewName, string userId, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, viewName, userId, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, hubName, viewName, userId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -256,4 +256,3 @@ public static async Task> ListByHubNextAsync(this IVie } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperations.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperations.cs index 1eb86977f6551..e7240c50eeeb4 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperations.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperations.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; @@ -126,9 +126,9 @@ public async Task>> ListB _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -331,9 +331,9 @@ public async Task> GetWithHttpM _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -504,9 +504,9 @@ public async Task>> ListB _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -626,4 +626,3 @@ public async Task>> ListB } } - diff --git a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperationsExtensions.cs b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperationsExtensions.cs index e0a61db6fecbf..eee79aa5297e6 100644 --- a/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperationsExtensions.cs +++ b/sdk/customer-insights/Microsoft.Azure.Management.CustomerInsights/src/Generated/WidgetTypesOperationsExtensions.cs @@ -1,17 +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 +// Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. +// namespace Microsoft.Azure.Management.CustomerInsights { - using Azure; - using Management; - using Rest; - using Rest.Azure; + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; @@ -143,4 +143,3 @@ public static async Task> ListByHubNextAsync(thi } } -