From c725b6d7f79c6d34d8b92ce1bf14bfe94a67474d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 2 Jul 2021 10:00:50 +0000 Subject: [PATCH] CodeGen from PR 14935 in Azure/azure-rest-api-specs [EdgeOrder] Update 2020-12-01-preview swagger and add readme files (#14935) * new api changes (#1) * new api changes * referer url change * EdgeOrder 2020-12-01-preview Swagger changes (#5) * readme changes * Swagger refresh and update examples * Change examples as per oav validations * Minor swagger modifications * Minor spacing adjustments * Set ModelAsString to true for enums and modify examples * Fix swagger lint validation error * Modify readme and examples * Modify readme.go.md * Update swagger * Minor prettier fix * Change python package version in readme * Fix spell check error Co-authored-by: sashanm <54701252+sashanm@users.noreply.github.com> --- .../Generated/EdgeOrderManagementClient.cs | 6833 +++++++++++++++++ .../EdgeOrderManagementClientExtensions.cs | 1658 ++++ .../Generated/IEdgeOrderManagementClient.cs | 792 ++ .../src/Generated/Models/ActionStatusEnum.cs | 28 + .../src/Generated/Models/ActionType.cs | 21 + .../src/Generated/Models/AddressDetails.cs | 83 + .../src/Generated/Models/AddressProperties.cs | 83 + .../src/Generated/Models/AddressResource.cs | 107 + .../src/Generated/Models/AddressType.cs | 32 + .../Models/AddressUpdateParameter.cs | 95 + .../Models/AvailabilityInformation.cs | 78 + .../src/Generated/Models/AvailabilityStage.cs | 44 + .../Generated/Models/AzureEntityResource.cs | 62 + .../src/Generated/Models/BasicInformation.cs | 99 + .../Generated/Models/BillingMeterDetails.cs | 78 + .../Generated/Models/CancellationReason.cs | 65 + .../src/Generated/Models/ChargingType.cs | 28 + .../src/Generated/Models/CommonProperties.cs | 67 + .../src/Generated/Models/Configuration.cs | 128 + .../Generated/Models/ConfigurationFilters.cs | 87 + .../Generated/Models/ConfigurationsRequest.cs | 99 + .../src/Generated/Models/ContactDetails.cs | 109 + .../src/Generated/Models/CostInformation.cs | 63 + .../src/Generated/Models/CreatedByType.cs | 24 + .../Models/CustomerSubscriptionDetails.cs | 89 + .../CustomerSubscriptionRegisteredFeatures.cs | 62 + .../src/Generated/Models/Description.cs | 96 + .../src/Generated/Models/DescriptionType.cs | 24 + .../src/Generated/Models/DeviceDetails.cs | 59 + .../src/Generated/Models/Dimensions.cs | 103 + .../src/Generated/Models/DisabledReason.cs | 53 + .../src/Generated/Models/DisplayInfo.cs | 61 + .../Models/DoubleEncryptionStatus.cs | 28 + .../Generated/Models/EncryptionPreferences.cs | 54 + .../Generated/Models/ErrorAdditionalInfo.cs | 59 + .../src/Generated/Models/ErrorDetail.cs | 85 + .../src/Generated/Models/ErrorResponse.cs | 56 + .../Models/ErrorResponseException.cs | 62 + .../Generated/Models/FilterableProperty.cs | 81 + .../Generated/Models/HierarchyInformation.cs | 83 + .../src/Generated/Models/ImageInformation.cs | 61 + .../src/Generated/Models/ImageType.cs | 32 + .../src/Generated/Models/LengthHeightUnit.cs | 28 + .../src/Generated/Models/Link.cs | 63 + .../src/Generated/Models/LinkType.cs | 44 + .../Models/ManagementResourcePreferences.cs | 54 + .../src/Generated/Models/MeterDetails.cs | 62 + .../src/Generated/Models/MeteringType.cs | 32 + .../Models/NotificationPreference.cs | 76 + .../Generated/Models/NotificationStageName.cs | 28 + .../src/Generated/Models/Operation.cs | 109 + .../src/Generated/Models/OperationDisplay.cs | 89 + .../Models/OrderItemCancellationEnum.cs | 32 + .../src/Generated/Models/OrderItemDetails.cs | 208 + .../src/Generated/Models/OrderItemResource.cs | 132 + .../Generated/Models/OrderItemReturnEnum.cs | 32 + .../src/Generated/Models/OrderItemType.cs | 28 + .../Models/OrderItemUpdateParameter.cs | 103 + .../src/Generated/Models/OrderResource.cs | 90 + .../src/Generated/Models/Origin.cs | 23 + .../src/Generated/Models/Page.cs | 53 + .../src/Generated/Models/Pav2MeterDetails.cs | 58 + .../src/Generated/Models/Preferences.cs | 105 + .../src/Generated/Models/Product.cs | 120 + .../src/Generated/Models/ProductDetails.cs | 93 + .../Models/ProductFamiliesMetadataDetails.cs | 122 + .../Models/ProductFamiliesRequest.cs | 100 + .../src/Generated/Models/ProductFamily.cs | 120 + .../src/Generated/Models/ProductLine.cs | 119 + .../src/Generated/Models/ProxyResource.cs | 53 + .../Generated/Models/PurchaseMeterDetails.cs | 73 + .../src/Generated/Models/Resource.cs | 79 + .../src/Generated/Models/ResourceIdentity.cs | 68 + .../Models/ReturnOrderItemDetails.cs | 77 + .../src/Generated/Models/ShippingAddress.cs | 144 + .../src/Generated/Models/ShippingDetails.cs | 77 + .../src/Generated/Models/Specification.cs | 59 + .../src/Generated/Models/StageDetails.cs | 85 + .../src/Generated/Models/StageName.cs | 68 + .../src/Generated/Models/StageStatus.cs | 44 + .../Generated/Models/SupportedFilterTypes.cs | 28 + .../src/Generated/Models/SystemData.cs | 103 + .../src/Generated/Models/TrackedResource.cs | 87 + .../Generated/Models/TransportPreferences.cs | 69 + .../Models/TransportShipmentTypes.cs | 28 + .../Generated/Models/WeightMeasurementUnit.cs | 28 + .../SdkInfo_EdgeOrderManagementClient.cs | 47 + 87 files changed, 15251 insertions(+) create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClient.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClientExtensions.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/IEdgeOrderManagementClient.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionStatusEnum.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressProperties.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressResource.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressUpdateParameter.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityInformation.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityStage.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AzureEntityResource.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BasicInformation.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BillingMeterDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CancellationReason.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ChargingType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CommonProperties.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Configuration.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationFilters.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationsRequest.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ContactDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CostInformation.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CreatedByType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionRegisteredFeatures.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Description.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DescriptionType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DeviceDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Dimensions.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisabledReason.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisplayInfo.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DoubleEncryptionStatus.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/EncryptionPreferences.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorAdditionalInfo.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorDetail.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponse.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponseException.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/FilterableProperty.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/HierarchyInformation.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageInformation.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LengthHeightUnit.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Link.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LinkType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ManagementResourcePreferences.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeterDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeteringType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationPreference.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationStageName.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Operation.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OperationDisplay.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemCancellationEnum.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemResource.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemReturnEnum.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemType.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemUpdateParameter.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderResource.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Origin.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Page.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Pav2MeterDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Preferences.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Product.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesMetadataDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesRequest.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamily.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductLine.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProxyResource.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/PurchaseMeterDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Resource.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ResourceIdentity.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ReturnOrderItemDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingAddress.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Specification.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageDetails.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageName.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageStatus.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SupportedFilterTypes.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SystemData.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TrackedResource.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportPreferences.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportShipmentTypes.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/WeightMeasurementUnit.cs create mode 100644 sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/SdkInfo_EdgeOrderManagementClient.cs diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClient.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClient.cs new file mode 100644 index 0000000000000..a5d241a160cc0 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClient.cs @@ -0,0 +1,6833 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + 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; + + /// + /// Edge Order API's + /// + public partial class EdgeOrderManagementClient : ServiceClient, IEdgeOrderManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The API version to use for this operation. + /// + public string ApiVersion { get; private set; } + + /// + /// The ID of the target subscription. + /// + public string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// 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; } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling EdgeOrderManagementClient.Dispose(). False: will not dispose provided httpClient + protected EdgeOrderManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected EdgeOrderManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected EdgeOrderManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected EdgeOrderManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected EdgeOrderManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public EdgeOrderManagementClient(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 EdgeOrderManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling EdgeOrderManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public EdgeOrderManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public EdgeOrderManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public EdgeOrderManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the EdgeOrderManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public EdgeOrderManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2020-12-01-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("billingType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("billingType")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// 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>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // 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, "ListOperations", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.EdgeOrder/operations").ToString(); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// $filter is supported to filter based on shipping address properties. Filter + /// supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides the next + /// page in the list of addresses. + /// + /// + /// 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>> ListAddressesAtSubscriptionLevelWithHttpMessagesAsync(string filter = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("filter", filter); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAddressesAtSubscriptionLevel", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/addresses").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// Filters for showing the product families. + /// + /// + /// $expand is supported on configurations parameter for product, which + /// provides details on the configurations for the product. + /// + /// + /// $skipToken is supported on list of product families, which provides the + /// next page in the list of product families. + /// + /// + /// 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>> ListProductFamiliesWithHttpMessagesAsync(ProductFamiliesRequest productFamiliesRequest, string expand = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (productFamiliesRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "productFamiliesRequest"); + } + if (productFamiliesRequest != null) + { + productFamiliesRequest.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("expand", expand); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("productFamiliesRequest", productFamiliesRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListProductFamilies", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(productFamiliesRequest != null) + { + _requestContent = SafeJsonConvert.SerializeObject(productFamiliesRequest, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method provides the list of configurations for the given product + /// family, product line and product under subscription. + /// + /// + /// Filters for showing the configurations. + /// + /// + /// $skipToken is supported on list of configurations, which provides the next + /// page in the list of configurations. + /// + /// + /// 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>> ListConfigurationsWithHttpMessagesAsync(ConfigurationsRequest configurationsRequest, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (configurationsRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationsRequest"); + } + if (configurationsRequest != null) + { + configurationsRequest.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("configurationsRequest", configurationsRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListConfigurations", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(configurationsRequest != null) + { + _requestContent = SafeJsonConvert.SerializeObject(configurationsRequest, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method provides the list of product families metadata for the given + /// subscription. + /// + /// + /// $skipToken is supported on list of product families metadata, which + /// provides the next page in the list of product families metadata. + /// + /// + /// 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>> ListProductFamiliesMetadataWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListProductFamiliesMetadata", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/productFamiliesMetadata").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists order at subscription level. + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page + /// in the list of order. + /// + /// + /// 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>> ListOrderAtSubscriptionLevelWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListOrderAtSubscriptionLevel", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists order at subscription level. + /// + /// + /// $filter is supported to filter based on order id. Filter supports only + /// equals operation. + /// + /// + /// $skipToken is supported on Get list of orders, which provides the next page + /// in the list of order. + /// + /// + /// 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>> ListOrderItemsAtSubscriptionLevelWithHttpMessagesAsync(string filter = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("filter", filter); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListOrderItemsAtSubscriptionLevel", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on shipping address properties. Filter + /// supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides the next + /// page in the list of address. + /// + /// + /// 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>> ListAddressesAtResourceGroupLevelWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAddressesAtResourceGroupLevel", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets information about the specified address. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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> GetAddressByNameWithHttpMessagesAsync(string addressName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (addressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "addressName"); + } + if (addressName != null) + { + if (addressName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "addressName", 24); + } + if (addressName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "addressName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(addressName, "^[-\\w\\.]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "addressName", "^[-\\w\\.]+$"); + } + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("addressName", addressName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAddressByName", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}").ToString(); + _url = _url.Replace("{addressName}", System.Uri.EscapeDataString(addressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates a new address with the specified parameters. Existing address + /// cannot be updated with this API and should instead be updated with the + /// Update address API. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressResource addressResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateAddressWithHttpMessagesAsync(addressName, resourceGroupName, addressResource, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an address. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteAddressByNameWithHttpMessagesAsync(string addressName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteAddressByNameWithHttpMessagesAsync(addressName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the properties of an existing address. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the job on the server matches this value. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateAddressWithHttpMessagesAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists order at resource group level. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page + /// in the list of order. + /// + /// + /// 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>> ListOrderAtResourceGroupLevelWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListOrderAtResourceGroupLevel", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orders").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets an order. + /// + /// + /// The name of the order + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of Azure region. + /// + /// + /// 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> GetOrderByNameWithHttpMessagesAsync(string orderName, string resourceGroupName, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (orderName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (location != null) + { + if (location.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "location", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("orderName", orderName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("location", location); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetOrderByName", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName}").ToString(); + _url = _url.Replace("{orderName}", System.Uri.EscapeDataString(orderName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists order item at resource group level. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on order id. Filter supports only + /// equals operation. + /// + /// + /// $expand is supported on device details parameter for order item, which + /// provides details on the devices of the product. + /// + /// + /// $skipToken is supported on Get list of order items, which provides the next + /// page in the list of order items. + /// + /// + /// 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>> ListOrderItemsAtResourceGroupLevelWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string expand = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("expand", expand); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListOrderItemsAtResourceGroupLevel", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets an order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $expand is supported on device details parameter for order item, which + /// provides details on the devices of the product. + /// + /// + /// 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> GetOrderItemByNameWithHttpMessagesAsync(string orderItemName, string resourceGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (orderItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("orderItemName", orderItemName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetOrderItemByName", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}").ToString(); + _url = _url.Replace("{orderItemName}", System.Uri.EscapeDataString(orderItemName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates an order item. Existing order item cannot be updated with this api + /// and should instead be updated with the Update order item API. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemResource orderItemResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, orderItemResource, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteOrderItemByNameWithHttpMessagesAsync(string orderItemName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteOrderItemByNameWithHttpMessagesAsync(orderItemName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the order on the server matches this value. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Cancel order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Reason for cancellation. + /// + /// + /// 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 CancelOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, CancellationReason cancellationReason, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (orderItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (cancellationReason == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "cancellationReason"); + } + if (cancellationReason != null) + { + cancellationReason.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("orderItemName", orderItemName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationReason", cancellationReason); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CancelOrderItem", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/cancel").ToString(); + _url = _url.Replace("{orderItemName}", System.Uri.EscapeDataString(orderItemName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(cancellationReason != null) + { + _requestContent = SafeJsonConvert.SerializeObject(cancellationReason, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Return order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ReturnOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginReturnOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, returnOrderItemDetails, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new address with the specified parameters. Existing address + /// cannot be updated with this API and should instead be updated with the + /// Update address API. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + /// + /// 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> BeginCreateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressResource addressResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (addressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "addressName"); + } + if (addressName != null) + { + if (addressName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "addressName", 24); + } + if (addressName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "addressName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(addressName, "^[-\\w\\.]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "addressName", "^[-\\w\\.]+$"); + } + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (addressResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "addressResource"); + } + if (addressResource != null) + { + addressResource.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("addressName", addressName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("addressResource", addressResource); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateAddress", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}").ToString(); + _url = _url.Replace("{addressName}", System.Uri.EscapeDataString(addressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(addressResource != null) + { + _requestContent = SafeJsonConvert.SerializeObject(addressResource, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an address. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 BeginDeleteAddressByNameWithHttpMessagesAsync(string addressName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (addressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "addressName"); + } + if (addressName != null) + { + if (addressName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "addressName", 24); + } + if (addressName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "addressName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(addressName, "^[-\\w\\.]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "addressName", "^[-\\w\\.]+$"); + } + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("addressName", addressName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteAddressByName", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}").ToString(); + _url = _url.Replace("{addressName}", System.Uri.EscapeDataString(addressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates the properties of an existing address. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the job on the server matches this value. + /// + /// + /// 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> BeginUpdateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (addressName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "addressName"); + } + if (addressName != null) + { + if (addressName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "addressName", 24); + } + if (addressName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "addressName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(addressName, "^[-\\w\\.]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "addressName", "^[-\\w\\.]+$"); + } + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (addressUpdateParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "addressUpdateParameter"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("addressName", addressName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("addressUpdateParameter", addressUpdateParameter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateAddress", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses/{addressName}").ToString(); + _url = _url.Replace("{addressName}", System.Uri.EscapeDataString(addressName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(addressUpdateParameter != null) + { + _requestContent = SafeJsonConvert.SerializeObject(addressUpdateParameter, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates an order item. Existing order item cannot be updated with this api + /// and should instead be updated with the Update order item API. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + /// + /// 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> BeginCreateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemResource orderItemResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (orderItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (orderItemResource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemResource"); + } + if (orderItemResource != null) + { + orderItemResource.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("orderItemName", orderItemName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("orderItemResource", orderItemResource); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrderItem", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}").ToString(); + _url = _url.Replace("{orderItemName}", System.Uri.EscapeDataString(orderItemName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(orderItemResource != null) + { + _requestContent = SafeJsonConvert.SerializeObject(orderItemResource, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 BeginDeleteOrderItemByNameWithHttpMessagesAsync(string orderItemName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (orderItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("orderItemName", orderItemName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteOrderItemByName", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}").ToString(); + _url = _url.Replace("{orderItemName}", System.Uri.EscapeDataString(orderItemName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the order on the server matches this value. + /// + /// + /// 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> BeginUpdateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (orderItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (orderItemUpdateParameter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemUpdateParameter"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("orderItemName", orderItemName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("orderItemUpdateParameter", orderItemUpdateParameter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateOrderItem", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}").ToString(); + _url = _url.Replace("{orderItemName}", System.Uri.EscapeDataString(orderItemName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(orderItemUpdateParameter != null) + { + _requestContent = SafeJsonConvert.SerializeObject(orderItemUpdateParameter, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Return order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + /// + /// 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 BeginReturnOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (orderItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "orderItemName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (SubscriptionId != null) + { + if (SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + if (ApiVersion != null) + { + if (ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "ApiVersion", 1); + } + } + if (returnOrderItemDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "returnOrderItemDetails"); + } + if (returnOrderItemDetails != null) + { + returnOrderItemDetails.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("orderItemName", orderItemName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("returnOrderItemDetails", returnOrderItemDetails); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginReturnOrderItem", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName}/return").ToString(); + _url = _url.Replace("{orderItemName}", System.Uri.EscapeDataString(orderItemName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(returnOrderItemDetails != null) + { + _requestContent = SafeJsonConvert.SerializeObject(returnOrderItemDetails, 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 (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// 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>> ListOperationsNextWithHttpMessagesAsync(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, "ListOperationsNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// 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>> ListAddressesAtSubscriptionLevelNextWithHttpMessagesAsync(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, "ListAddressesAtSubscriptionLevelNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// 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>> ListProductFamiliesNextWithHttpMessagesAsync(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, "ListProductFamiliesNext", 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method provides the list of configurations for the given product + /// family, product line and product under subscription. + /// + /// + /// 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>> ListConfigurationsNextWithHttpMessagesAsync(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, "ListConfigurationsNext", 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method provides the list of product families metadata for the given + /// subscription. + /// + /// + /// 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>> ListProductFamiliesMetadataNextWithHttpMessagesAsync(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, "ListProductFamiliesMetadataNext", 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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists order at subscription level. + /// + /// + /// 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>> ListOrderAtSubscriptionLevelNextWithHttpMessagesAsync(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, "ListOrderAtSubscriptionLevelNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists order at subscription level. + /// + /// + /// 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>> ListOrderItemsAtSubscriptionLevelNextWithHttpMessagesAsync(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, "ListOrderItemsAtSubscriptionLevelNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAddressesAtResourceGroupLevelNextWithHttpMessagesAsync(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, "ListAddressesAtResourceGroupLevelNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists order at resource group level. + /// + /// + /// 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>> ListOrderAtResourceGroupLevelNextWithHttpMessagesAsync(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, "ListOrderAtResourceGroupLevelNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists order item at resource group level. + /// + /// + /// 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>> ListOrderItemsAtResourceGroupLevelNextWithHttpMessagesAsync(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, "ListOrderItemsAtResourceGroupLevelNext", 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 (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject>(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClientExtensions.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClientExtensions.cs new file mode 100644 index 0000000000000..99d4e82892f3e --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/EdgeOrderManagementClientExtensions.cs @@ -0,0 +1,1658 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for EdgeOrderManagementClient. + /// + public static partial class EdgeOrderManagementClientExtensions + { + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListOperations(this IEdgeOrderManagementClient operations) + { + return operations.ListOperationsAsync().GetAwaiter().GetResult(); + } + + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOperationsAsync(this IEdgeOrderManagementClient operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOperationsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $filter is supported to filter based on shipping address properties. Filter + /// supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides the next + /// page in the list of addresses. + /// + public static IPage ListAddressesAtSubscriptionLevel(this IEdgeOrderManagementClient operations, string filter = default(string), string skipToken = default(string)) + { + return operations.ListAddressesAtSubscriptionLevelAsync(filter, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $filter is supported to filter based on shipping address properties. Filter + /// supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides the next + /// page in the list of addresses. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAddressesAtSubscriptionLevelAsync(this IEdgeOrderManagementClient operations, string filter = default(string), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAddressesAtSubscriptionLevelWithHttpMessagesAsync(filter, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filters for showing the product families. + /// + /// + /// $expand is supported on configurations parameter for product, which + /// provides details on the configurations for the product. + /// + /// + /// $skipToken is supported on list of product families, which provides the + /// next page in the list of product families. + /// + public static IPage ListProductFamilies(this IEdgeOrderManagementClient operations, ProductFamiliesRequest productFamiliesRequest, string expand = default(string), string skipToken = default(string)) + { + return operations.ListProductFamiliesAsync(productFamiliesRequest, expand, skipToken).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filters for showing the product families. + /// + /// + /// $expand is supported on configurations parameter for product, which + /// provides details on the configurations for the product. + /// + /// + /// $skipToken is supported on list of product families, which provides the + /// next page in the list of product families. + /// + /// + /// The cancellation token. + /// + public static async Task> ListProductFamiliesAsync(this IEdgeOrderManagementClient operations, ProductFamiliesRequest productFamiliesRequest, string expand = default(string), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListProductFamiliesWithHttpMessagesAsync(productFamiliesRequest, expand, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method provides the list of configurations for the given product + /// family, product line and product under subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filters for showing the configurations. + /// + /// + /// $skipToken is supported on list of configurations, which provides the next + /// page in the list of configurations. + /// + public static IPage ListConfigurations(this IEdgeOrderManagementClient operations, ConfigurationsRequest configurationsRequest, string skipToken = default(string)) + { + return operations.ListConfigurationsAsync(configurationsRequest, skipToken).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of configurations for the given product + /// family, product line and product under subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filters for showing the configurations. + /// + /// + /// $skipToken is supported on list of configurations, which provides the next + /// page in the list of configurations. + /// + /// + /// The cancellation token. + /// + public static async Task> ListConfigurationsAsync(this IEdgeOrderManagementClient operations, ConfigurationsRequest configurationsRequest, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListConfigurationsWithHttpMessagesAsync(configurationsRequest, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method provides the list of product families metadata for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $skipToken is supported on list of product families metadata, which + /// provides the next page in the list of product families metadata. + /// + public static IPage ListProductFamiliesMetadata(this IEdgeOrderManagementClient operations, string skipToken = default(string)) + { + return operations.ListProductFamiliesMetadataAsync(skipToken).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of product families metadata for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $skipToken is supported on list of product families metadata, which + /// provides the next page in the list of product families metadata. + /// + /// + /// The cancellation token. + /// + public static async Task> ListProductFamiliesMetadataAsync(this IEdgeOrderManagementClient operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListProductFamiliesMetadataWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page + /// in the list of order. + /// + public static IPage ListOrderAtSubscriptionLevel(this IEdgeOrderManagementClient operations, string skipToken = default(string)) + { + return operations.ListOrderAtSubscriptionLevelAsync(skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page + /// in the list of order. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderAtSubscriptionLevelAsync(this IEdgeOrderManagementClient operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderAtSubscriptionLevelWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $filter is supported to filter based on order id. Filter supports only + /// equals operation. + /// + /// + /// $skipToken is supported on Get list of orders, which provides the next page + /// in the list of order. + /// + public static IPage ListOrderItemsAtSubscriptionLevel(this IEdgeOrderManagementClient operations, string filter = default(string), string skipToken = default(string)) + { + return operations.ListOrderItemsAtSubscriptionLevelAsync(filter, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// $filter is supported to filter based on order id. Filter supports only + /// equals operation. + /// + /// + /// $skipToken is supported on Get list of orders, which provides the next page + /// in the list of order. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderItemsAtSubscriptionLevelAsync(this IEdgeOrderManagementClient operations, string filter = default(string), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderItemsAtSubscriptionLevelWithHttpMessagesAsync(filter, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on shipping address properties. Filter + /// supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides the next + /// page in the list of address. + /// + public static IPage ListAddressesAtResourceGroupLevel(this IEdgeOrderManagementClient operations, string resourceGroupName, string filter = default(string), string skipToken = default(string)) + { + return operations.ListAddressesAtResourceGroupLevelAsync(resourceGroupName, filter, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on shipping address properties. Filter + /// supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides the next + /// page in the list of address. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAddressesAtResourceGroupLevelAsync(this IEdgeOrderManagementClient operations, string resourceGroupName, string filter = default(string), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAddressesAtResourceGroupLevelWithHttpMessagesAsync(resourceGroupName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets information about the specified address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static AddressResource GetAddressByName(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName) + { + return operations.GetAddressByNameAsync(addressName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about the specified address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task GetAddressByNameAsync(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAddressByNameWithHttpMessagesAsync(addressName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new address with the specified parameters. Existing address + /// cannot be updated with this API and should instead be updated with the + /// Update address API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + public static AddressResource CreateAddress(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressResource addressResource) + { + return operations.CreateAddressAsync(addressName, resourceGroupName, addressResource).GetAwaiter().GetResult(); + } + + /// + /// Creates a new address with the specified parameters. Existing address + /// cannot be updated with this API and should instead be updated with the + /// Update address API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAddressAsync(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressResource addressResource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateAddressWithHttpMessagesAsync(addressName, resourceGroupName, addressResource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static void DeleteAddressByName(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName) + { + operations.DeleteAddressByNameAsync(addressName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAddressByNameAsync(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteAddressByNameWithHttpMessagesAsync(addressName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the properties of an existing address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the job on the server matches this value. + /// + public static AddressResource UpdateAddress(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string)) + { + return operations.UpdateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates the properties of an existing address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the job on the server matches this value. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAddressAsync(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateAddressWithHttpMessagesAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page + /// in the list of order. + /// + public static IPage ListOrderAtResourceGroupLevel(this IEdgeOrderManagementClient operations, string resourceGroupName, string skipToken = default(string)) + { + return operations.ListOrderAtResourceGroupLevelAsync(resourceGroupName, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists order at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $skipToken is supported on Get list of order, which provides the next page + /// in the list of order. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderAtResourceGroupLevelAsync(this IEdgeOrderManagementClient operations, string resourceGroupName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderAtResourceGroupLevelWithHttpMessagesAsync(resourceGroupName, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an order. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of Azure region. + /// + public static OrderResource GetOrderByName(this IEdgeOrderManagementClient operations, string orderName, string resourceGroupName, string location) + { + return operations.GetOrderByNameAsync(orderName, resourceGroupName, location).GetAwaiter().GetResult(); + } + + /// + /// Gets an order. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of Azure region. + /// + /// + /// The cancellation token. + /// + public static async Task GetOrderByNameAsync(this IEdgeOrderManagementClient operations, string orderName, string resourceGroupName, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetOrderByNameWithHttpMessagesAsync(orderName, resourceGroupName, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order item at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on order id. Filter supports only + /// equals operation. + /// + /// + /// $expand is supported on device details parameter for order item, which + /// provides details on the devices of the product. + /// + /// + /// $skipToken is supported on Get list of order items, which provides the next + /// page in the list of order items. + /// + public static IPage ListOrderItemsAtResourceGroupLevel(this IEdgeOrderManagementClient operations, string resourceGroupName, string filter = default(string), string expand = default(string), string skipToken = default(string)) + { + return operations.ListOrderItemsAtResourceGroupLevelAsync(resourceGroupName, filter, expand, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Lists order item at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on order id. Filter supports only + /// equals operation. + /// + /// + /// $expand is supported on device details parameter for order item, which + /// provides details on the devices of the product. + /// + /// + /// $skipToken is supported on Get list of order items, which provides the next + /// page in the list of order items. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderItemsAtResourceGroupLevelAsync(this IEdgeOrderManagementClient operations, string resourceGroupName, string filter = default(string), string expand = default(string), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderItemsAtResourceGroupLevelWithHttpMessagesAsync(resourceGroupName, filter, expand, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $expand is supported on device details parameter for order item, which + /// provides details on the devices of the product. + /// + public static OrderItemResource GetOrderItemByName(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, string expand = default(string)) + { + return operations.GetOrderItemByNameAsync(orderItemName, resourceGroupName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets an order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $expand is supported on device details parameter for order item, which + /// provides details on the devices of the product. + /// + /// + /// The cancellation token. + /// + public static async Task GetOrderItemByNameAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetOrderItemByNameWithHttpMessagesAsync(orderItemName, resourceGroupName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates an order item. Existing order item cannot be updated with this api + /// and should instead be updated with the Update order item API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + public static OrderItemResource CreateOrderItem(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemResource orderItemResource) + { + return operations.CreateOrderItemAsync(orderItemName, resourceGroupName, orderItemResource).GetAwaiter().GetResult(); + } + + /// + /// Creates an order item. Existing order item cannot be updated with this api + /// and should instead be updated with the Update order item API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrderItemAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemResource orderItemResource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, orderItemResource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static void DeleteOrderItemByName(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName) + { + operations.DeleteOrderItemByNameAsync(orderItemName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteOrderItemByNameAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteOrderItemByNameWithHttpMessagesAsync(orderItemName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the order on the server matches this value. + /// + public static OrderItemResource UpdateOrderItem(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string)) + { + return operations.UpdateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the order on the server matches this value. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateOrderItemAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Cancel order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Reason for cancellation. + /// + public static void CancelOrderItem(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, CancellationReason cancellationReason) + { + operations.CancelOrderItemAsync(orderItemName, resourceGroupName, cancellationReason).GetAwaiter().GetResult(); + } + + /// + /// Cancel order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Reason for cancellation. + /// + /// + /// The cancellation token. + /// + public static async Task CancelOrderItemAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, CancellationReason cancellationReason, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CancelOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, cancellationReason, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Return order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + public static void ReturnOrderItem(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails) + { + operations.ReturnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails).GetAwaiter().GetResult(); + } + + /// + /// Return order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + /// + /// The cancellation token. + /// + public static async Task ReturnOrderItemAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ReturnOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, returnOrderItemDetails, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new address with the specified parameters. Existing address + /// cannot be updated with this API and should instead be updated with the + /// Update address API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + public static AddressResource BeginCreateAddress(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressResource addressResource) + { + return operations.BeginCreateAddressAsync(addressName, resourceGroupName, addressResource).GetAwaiter().GetResult(); + } + + /// + /// Creates a new address with the specified parameters. Existing address + /// cannot be updated with this API and should instead be updated with the + /// Update address API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAddressAsync(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressResource addressResource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateAddressWithHttpMessagesAsync(addressName, resourceGroupName, addressResource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static void BeginDeleteAddressByName(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName) + { + operations.BeginDeleteAddressByNameAsync(addressName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAddressByNameAsync(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteAddressByNameWithHttpMessagesAsync(addressName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the properties of an existing address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the job on the server matches this value. + /// + public static AddressResource BeginUpdateAddress(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string)) + { + return operations.BeginUpdateAddressAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates the properties of an existing address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the address Resource within the specified resource group. + /// address names must be between 3 and 24 characters in length and use any + /// alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the job on the server matches this value. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAddressAsync(this IEdgeOrderManagementClient operations, string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateAddressWithHttpMessagesAsync(addressName, resourceGroupName, addressUpdateParameter, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates an order item. Existing order item cannot be updated with this api + /// and should instead be updated with the Update order item API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + public static OrderItemResource BeginCreateOrderItem(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemResource orderItemResource) + { + return operations.BeginCreateOrderItemAsync(orderItemName, resourceGroupName, orderItemResource).GetAwaiter().GetResult(); + } + + /// + /// Creates an order item. Existing order item cannot be updated with this api + /// and should instead be updated with the Update order item API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrderItemAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemResource orderItemResource, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, orderItemResource, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static void BeginDeleteOrderItemByName(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName) + { + operations.BeginDeleteOrderItemByNameAsync(orderItemName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteOrderItemByNameAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteOrderItemByNameWithHttpMessagesAsync(orderItemName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the order on the server matches this value. + /// + public static OrderItemResource BeginUpdateOrderItem(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string)) + { + return operations.BeginUpdateOrderItemAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if the + /// ETag of the order on the server matches this value. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateOrderItemAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, orderItemUpdateParameter, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Return order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + public static void BeginReturnOrderItem(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails) + { + operations.BeginReturnOrderItemAsync(orderItemName, resourceGroupName, returnOrderItemDetails).GetAwaiter().GetResult(); + } + + /// + /// Return order item. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + /// + /// The cancellation token. + /// + public static async Task BeginReturnOrderItemAsync(this IEdgeOrderManagementClient operations, string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginReturnOrderItemWithHttpMessagesAsync(orderItemName, resourceGroupName, returnOrderItemDetails, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListOperationsNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListOperationsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOperationsNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOperationsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAddressesAtSubscriptionLevelNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListAddressesAtSubscriptionLevelNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAddressesAtSubscriptionLevelNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAddressesAtSubscriptionLevelNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListProductFamiliesNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListProductFamiliesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListProductFamiliesNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListProductFamiliesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method provides the list of configurations for the given product + /// family, product line and product under subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListConfigurationsNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListConfigurationsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of configurations for the given product + /// family, product line and product under subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListConfigurationsNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListConfigurationsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method provides the list of product families metadata for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListProductFamiliesMetadataNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListProductFamiliesMetadataNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of product families metadata for the given + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListProductFamiliesMetadataNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListProductFamiliesMetadataNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListOrderAtSubscriptionLevelNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListOrderAtSubscriptionLevelNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderAtSubscriptionLevelNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderAtSubscriptionLevelNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListOrderItemsAtSubscriptionLevelNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListOrderItemsAtSubscriptionLevelNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists order at subscription level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderItemsAtSubscriptionLevelNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderItemsAtSubscriptionLevelNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAddressesAtResourceGroupLevelNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListAddressesAtResourceGroupLevelNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAddressesAtResourceGroupLevelNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAddressesAtResourceGroupLevelNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListOrderAtResourceGroupLevelNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListOrderAtResourceGroupLevelNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists order at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderAtResourceGroupLevelNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderAtResourceGroupLevelNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists order item at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListOrderItemsAtResourceGroupLevelNext(this IEdgeOrderManagementClient operations, string nextPageLink) + { + return operations.ListOrderItemsAtResourceGroupLevelNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists order item at resource group level. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListOrderItemsAtResourceGroupLevelNextAsync(this IEdgeOrderManagementClient operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListOrderItemsAtResourceGroupLevelNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/IEdgeOrderManagementClient.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/IEdgeOrderManagementClient.cs new file mode 100644 index 0000000000000..b303449e4f204 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/IEdgeOrderManagementClient.cs @@ -0,0 +1,792 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Edge Order API's + /// + public partial interface IEdgeOrderManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The API version to use for this operation. + /// + string ApiVersion { get; } + + /// + /// The ID of the target subscription. + /// + string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// 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; } + + + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOperationsWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// $filter is supported to filter based on shipping address + /// properties. Filter supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides + /// the next page in the list of addresses. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListAddressesAtSubscriptionLevelWithHttpMessagesAsync(string filter = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// Filters for showing the product families. + /// + /// + /// $expand is supported on configurations parameter for product, which + /// provides details on the configurations for the product. + /// + /// + /// $skipToken is supported on list of product families, which provides + /// the next page in the list of product families. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListProductFamiliesWithHttpMessagesAsync(ProductFamiliesRequest productFamiliesRequest, string expand = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// This method provides the list of configurations for the given + /// product family, product line and product under subscription. + /// + /// + /// Filters for showing the configurations. + /// + /// + /// $skipToken is supported on list of configurations, which provides + /// the next page in the list of configurations. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListConfigurationsWithHttpMessagesAsync(ConfigurationsRequest configurationsRequest, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// This method provides the list of product families metadata for the + /// given subscription. + /// + /// + /// $skipToken is supported on list of product families metadata, which + /// provides the next page in the list of product families metadata. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListProductFamiliesMetadataWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order at subscription level. + /// + /// + /// $skipToken is supported on Get list of order, which provides the + /// next page in the list of order. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderAtSubscriptionLevelWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order at subscription level. + /// + /// + /// $filter is supported to filter based on order id. Filter supports + /// only equals operation. + /// + /// + /// $skipToken is supported on Get list of orders, which provides the + /// next page in the list of order. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderItemsAtSubscriptionLevelWithHttpMessagesAsync(string filter = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on shipping address + /// properties. Filter supports only equals operation. + /// + /// + /// $skipToken is supported on Get list of addresses, which provides + /// the next page in the list of address. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListAddressesAtResourceGroupLevelWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Gets information about the specified address. + /// + /// + /// The name of the address Resource within the specified resource + /// group. address names must be between 3 and 24 characters in length + /// and use any alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetAddressByNameWithHttpMessagesAsync(string addressName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Creates a new address with the specified parameters. Existing + /// address cannot be updated with this API and should instead be + /// updated with the Update address API. + /// + /// + /// The name of the address Resource within the specified resource + /// group. address names must be between 3 and 24 characters in length + /// and use any alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> CreateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressResource addressResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes an address. + /// + /// + /// The name of the address Resource within the specified resource + /// group. address names must be between 3 and 24 characters in length + /// and use any alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task DeleteAddressByNameWithHttpMessagesAsync(string addressName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates the properties of an existing address. + /// + /// + /// The name of the address Resource within the specified resource + /// group. address names must be between 3 and 24 characters in length + /// and use any alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if + /// the ETag of the job on the server matches this value. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> UpdateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order at resource group level. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $skipToken is supported on Get list of order, which provides the + /// next page in the list of order. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderAtResourceGroupLevelWithHttpMessagesAsync(string resourceGroupName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Gets an order. + /// + /// + /// The name of the order + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of Azure region. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetOrderByNameWithHttpMessagesAsync(string orderName, string resourceGroupName, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order item at resource group level. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $filter is supported to filter based on order id. Filter supports + /// only equals operation. + /// + /// + /// $expand is supported on device details parameter for order item, + /// which provides details on the devices of the product. + /// + /// + /// $skipToken is supported on Get list of order items, which provides + /// the next page in the list of order items. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderItemsAtResourceGroupLevelWithHttpMessagesAsync(string resourceGroupName, string filter = default(string), string expand = default(string), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Gets an order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// $expand is supported on device details parameter for order item, + /// which provides details on the devices of the product. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> GetOrderItemByNameWithHttpMessagesAsync(string orderItemName, string resourceGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Creates an order item. Existing order item cannot be updated with + /// this api and should instead be updated with the Update order item + /// API. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> CreateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemResource orderItemResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes an order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task DeleteOrderItemByNameWithHttpMessagesAsync(string orderItemName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if + /// the ETag of the order on the server matches this value. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> UpdateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Cancel order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Reason for cancellation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task CancelOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, CancellationReason cancellationReason, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Return order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task ReturnOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Creates a new address with the specified parameters. Existing + /// address cannot be updated with this API and should instead be + /// updated with the Update address API. + /// + /// + /// The name of the address Resource within the specified resource + /// group. address names must be between 3 and 24 characters in length + /// and use any alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address details from request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> BeginCreateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressResource addressResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes an address. + /// + /// + /// The name of the address Resource within the specified resource + /// group. address names must be between 3 and 24 characters in length + /// and use any alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginDeleteAddressByNameWithHttpMessagesAsync(string addressName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates the properties of an existing address. + /// + /// + /// The name of the address Resource within the specified resource + /// group. address names must be between 3 and 24 characters in length + /// and use any alphanumeric and underscore only + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Address update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if + /// the ETag of the job on the server matches this value. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> BeginUpdateAddressWithHttpMessagesAsync(string addressName, string resourceGroupName, AddressUpdateParameter addressUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Creates an order item. Existing order item cannot be updated with + /// this api and should instead be updated with the Update order item + /// API. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Order item details from request body. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> BeginCreateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemResource orderItemResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Deletes an order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginDeleteOrderItemByNameWithHttpMessagesAsync(string orderItemName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Updates the properties of an existing order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// order item update parameters from request body. + /// + /// + /// Defines the If-Match condition. The patch will be performed only if + /// the ETag of the order on the server matches this value. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> BeginUpdateOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, OrderItemUpdateParameter orderItemUpdateParameter, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Return order item. + /// + /// + /// The name of the order item + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Return order item CurrentStatus. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginReturnOrderItemWithHttpMessagesAsync(string orderItemName, string resourceGroupName, ReturnOrderItemDetails returnOrderItemDetails, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// This method gets all the operations that are exposed for customer. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOperationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists all the addresses available under the subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListAddressesAtSubscriptionLevelNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// This method provides the list of product families for the given + /// subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListProductFamiliesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// This method provides the list of configurations for the given + /// product family, product line and product under subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListConfigurationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// This method provides the list of product families metadata for the + /// given subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListProductFamiliesMetadataNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order at subscription level. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderAtSubscriptionLevelNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order at subscription level. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderItemsAtSubscriptionLevelNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists all the addresses available under the given resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListAddressesAtResourceGroupLevelNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order at resource group level. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderAtResourceGroupLevelNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Lists order item at resource group level. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task>> ListOrderItemsAtResourceGroupLevelNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionStatusEnum.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionStatusEnum.cs new file mode 100644 index 0000000000000..aa5a9180d8094 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionStatusEnum.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for ActionStatusEnum. + /// + public static class ActionStatusEnum + { + /// + /// Allowed flag. + /// + public const string Allowed = "Allowed"; + /// + /// Not Allowed flag. + /// + public const string NotAllowed = "NotAllowed"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionType.cs new file mode 100644 index 0000000000000..dc878565d3c5a --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ActionType.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for ActionType. + /// + public static class ActionType + { + public const string Internal = "Internal"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressDetails.cs new file mode 100644 index 0000000000000..bf93590d8d9a1 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressDetails.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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Address details for an order item. + /// + public partial class AddressDetails + { + /// + /// Initializes a new instance of the AddressDetails class. + /// + public AddressDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddressDetails class. + /// + /// Customer address and contact details. + /// It should be address resource + /// Return shipping address + public AddressDetails(AddressProperties forwardAddress, AddressProperties returnAddress = default(AddressProperties)) + { + ForwardAddress = forwardAddress; + ReturnAddress = returnAddress; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets customer address and contact details. It should be + /// address resource + /// + [JsonProperty(PropertyName = "forwardAddress")] + public AddressProperties ForwardAddress { get; set; } + + /// + /// Gets return shipping address + /// + [JsonProperty(PropertyName = "returnAddress")] + public AddressProperties ReturnAddress { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ForwardAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ForwardAddress"); + } + if (ForwardAddress != null) + { + ForwardAddress.Validate(); + } + if (ReturnAddress != null) + { + ReturnAddress.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressProperties.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressProperties.cs new file mode 100644 index 0000000000000..2827058745a6b --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressProperties.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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Address Properties + /// + public partial class AddressProperties + { + /// + /// Initializes a new instance of the AddressProperties class. + /// + public AddressProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddressProperties class. + /// + /// Contact details for the + /// address + /// Shipping details for the + /// address + public AddressProperties(ContactDetails contactDetails, ShippingAddress shippingAddress = default(ShippingAddress)) + { + ShippingAddress = shippingAddress; + ContactDetails = contactDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets shipping details for the address + /// + [JsonProperty(PropertyName = "shippingAddress")] + public ShippingAddress ShippingAddress { get; set; } + + /// + /// Gets or sets contact details for the address + /// + [JsonProperty(PropertyName = "contactDetails")] + public ContactDetails ContactDetails { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ContactDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactDetails"); + } + if (ShippingAddress != null) + { + ShippingAddress.Validate(); + } + if (ContactDetails != null) + { + ContactDetails.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressResource.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressResource.cs new file mode 100644 index 0000000000000..da6c6f6851c05 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressResource.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Address Resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class AddressResource : TrackedResource + { + /// + /// Initializes a new instance of the AddressResource class. + /// + public AddressResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddressResource class. + /// + /// The geo-location where the resource + /// lives + /// Contact details for the + /// address + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// Shipping details for the + /// address + /// Represents resource creation and update + /// time + public AddressResource(string location, ContactDetails contactDetails, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), ShippingAddress shippingAddress = default(ShippingAddress), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) + { + ShippingAddress = shippingAddress; + ContactDetails = contactDetails; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets shipping details for the address + /// + [JsonProperty(PropertyName = "properties.shippingAddress")] + public ShippingAddress ShippingAddress { get; set; } + + /// + /// Gets or sets contact details for the address + /// + [JsonProperty(PropertyName = "properties.contactDetails")] + public ContactDetails ContactDetails { get; set; } + + /// + /// Gets represents resource creation and update time + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (ContactDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactDetails"); + } + if (ShippingAddress != null) + { + ShippingAddress.Validate(); + } + if (ContactDetails != null) + { + ContactDetails.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressType.cs new file mode 100644 index 0000000000000..c748b8fe3aca9 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressType.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for AddressType. + /// + public static class AddressType + { + /// + /// Address type not known. + /// + public const string None = "None"; + /// + /// Residential Address. + /// + public const string Residential = "Residential"; + /// + /// Commercial Address. + /// + public const string Commercial = "Commercial"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressUpdateParameter.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressUpdateParameter.cs new file mode 100644 index 0000000000000..53403c9a726c5 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AddressUpdateParameter.cs @@ -0,0 +1,95 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Address update parameters + /// + [Rest.Serialization.JsonTransformation] + public partial class AddressUpdateParameter + { + /// + /// Initializes a new instance of the AddressUpdateParameter class. + /// + public AddressUpdateParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddressUpdateParameter class. + /// + /// Shipping details for the + /// address + /// Contact details for the + /// address + /// The list of key value pairs that describe the + /// resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). + public AddressUpdateParameter(ShippingAddress shippingAddress = default(ShippingAddress), ContactDetails contactDetails = default(ContactDetails), IDictionary tags = default(IDictionary)) + { + ShippingAddress = shippingAddress; + ContactDetails = contactDetails; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets shipping details for the address + /// + [JsonProperty(PropertyName = "properties.shippingAddress")] + public ShippingAddress ShippingAddress { get; set; } + + /// + /// Gets or sets contact details for the address + /// + [JsonProperty(PropertyName = "properties.contactDetails")] + public ContactDetails ContactDetails { get; set; } + + /// + /// Gets or sets the list of key value pairs that describe the + /// resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ShippingAddress != null) + { + ShippingAddress.Validate(); + } + if (ContactDetails != null) + { + ContactDetails.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityInformation.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityInformation.cs new file mode 100644 index 0000000000000..8bd611de429f1 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityInformation.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Availability information of a product system. + /// + public partial class AvailabilityInformation + { + /// + /// Initializes a new instance of the AvailabilityInformation class. + /// + public AvailabilityInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AvailabilityInformation class. + /// + /// Current availability stage of the + /// product. Availability stage. Possible values include: 'Available', + /// 'ComingSoon', 'Preview', 'Deprecated', 'Signup', + /// 'Unavailable' + /// Reason why the product is disabled. + /// Possible values include: 'None', 'Country', 'Region', 'Feature', + /// 'OfferType', 'NoSubscriptionInfo', 'NotAvailable', + /// 'OutOfStock' + /// Message for why the product is + /// disabled. + public AvailabilityInformation(string availabilityStage = default(string), string disabledReason = default(string), string disabledReasonMessage = default(string)) + { + AvailabilityStage = availabilityStage; + DisabledReason = disabledReason; + DisabledReasonMessage = disabledReasonMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets current availability stage of the product. Availability stage. + /// Possible values include: 'Available', 'ComingSoon', 'Preview', + /// 'Deprecated', 'Signup', 'Unavailable' + /// + [JsonProperty(PropertyName = "availabilityStage")] + public string AvailabilityStage { get; private set; } + + /// + /// Gets reason why the product is disabled. Possible values include: + /// 'None', 'Country', 'Region', 'Feature', 'OfferType', + /// 'NoSubscriptionInfo', 'NotAvailable', 'OutOfStock' + /// + [JsonProperty(PropertyName = "disabledReason")] + public string DisabledReason { get; private set; } + + /// + /// Gets message for why the product is disabled. + /// + [JsonProperty(PropertyName = "disabledReasonMessage")] + public string DisabledReasonMessage { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityStage.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityStage.cs new file mode 100644 index 0000000000000..84840a14f1398 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AvailabilityStage.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for AvailabilityStage. + /// + public static class AvailabilityStage + { + /// + /// Product is available. + /// + public const string Available = "Available"; + /// + /// Product is coming soon. + /// + public const string ComingSoon = "ComingSoon"; + /// + /// Product is in preview. + /// + public const string Preview = "Preview"; + /// + /// Product is deprecated. + /// + public const string Deprecated = "Deprecated"; + /// + /// Product is available only on signup. + /// + public const string Signup = "Signup"; + /// + /// Product is not available. + /// + public const string Unavailable = "Unavailable"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AzureEntityResource.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AzureEntityResource.cs new file mode 100644 index 0000000000000..da0a651b0d53a --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/AzureEntityResource.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Entity Resource + /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource Etag. + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type) + { + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Etag. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BasicInformation.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BasicInformation.cs new file mode 100644 index 0000000000000..b59690bd32391 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BasicInformation.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Basic information for any product system + /// + public partial class BasicInformation + { + /// + /// Initializes a new instance of the BasicInformation class. + /// + public BasicInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BasicInformation class. + /// + /// Display Name for the product + /// system. + /// Description related to the product + /// system. + /// Image information for the product + /// system. + /// Cost information for the product + /// system. + /// Availability information of + /// the product system. + /// Hierarchy information of a + /// product. + public BasicInformation(string displayName = default(string), Description description = default(Description), IList imageInformation = default(IList), CostInformation costInformation = default(CostInformation), AvailabilityInformation availabilityInformation = default(AvailabilityInformation), HierarchyInformation hierarchyInformation = default(HierarchyInformation)) + { + DisplayName = displayName; + Description = description; + ImageInformation = imageInformation; + CostInformation = costInformation; + AvailabilityInformation = availabilityInformation; + HierarchyInformation = hierarchyInformation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display Name for the product system. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description related to the product system. + /// + [JsonProperty(PropertyName = "description")] + public Description Description { get; private set; } + + /// + /// Gets image information for the product system. + /// + [JsonProperty(PropertyName = "imageInformation")] + public IList ImageInformation { get; private set; } + + /// + /// Gets cost information for the product system. + /// + [JsonProperty(PropertyName = "costInformation")] + public CostInformation CostInformation { get; private set; } + + /// + /// Gets availability information of the product system. + /// + [JsonProperty(PropertyName = "availabilityInformation")] + public AvailabilityInformation AvailabilityInformation { get; private set; } + + /// + /// Gets hierarchy information of a product. + /// + [JsonProperty(PropertyName = "hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BillingMeterDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BillingMeterDetails.cs new file mode 100644 index 0000000000000..04e787782a3d4 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/BillingMeterDetails.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Holds billing meter details for each type of billing + /// + public partial class BillingMeterDetails + { + /// + /// Initializes a new instance of the BillingMeterDetails class. + /// + public BillingMeterDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingMeterDetails class. + /// + /// Represents Billing type name + /// Represents MeterDetails + /// Represents Metering type (eg one-time or + /// recurrent). Possible values include: 'OneTime', 'Recurring', + /// 'Adhoc' + /// Frequency of recurrence + public BillingMeterDetails(string name = default(string), MeterDetails meterDetails = default(MeterDetails), string meteringType = default(string), string frequency = default(string)) + { + Name = name; + MeterDetails = meterDetails; + MeteringType = meteringType; + Frequency = frequency; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets represents Billing type name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets represents MeterDetails + /// + [JsonProperty(PropertyName = "meterDetails")] + public MeterDetails MeterDetails { get; private set; } + + /// + /// Gets represents Metering type (eg one-time or recurrent). Possible + /// values include: 'OneTime', 'Recurring', 'Adhoc' + /// + [JsonProperty(PropertyName = "meteringType")] + public string MeteringType { get; private set; } + + /// + /// Gets frequency of recurrence + /// + [JsonProperty(PropertyName = "frequency")] + public string Frequency { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CancellationReason.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CancellationReason.cs new file mode 100644 index 0000000000000..ae51aa6c4ce05 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CancellationReason.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Reason for cancellation. + /// + public partial class CancellationReason + { + /// + /// Initializes a new instance of the CancellationReason class. + /// + public CancellationReason() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CancellationReason class. + /// + /// Reason for cancellation. + public CancellationReason(string reason) + { + Reason = reason; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets reason for cancellation. + /// + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Reason == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Reason"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ChargingType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ChargingType.cs new file mode 100644 index 0000000000000..9e155508bbfe0 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ChargingType.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for ChargingType. + /// + public static class ChargingType + { + /// + /// Per order charging type. + /// + public const string PerOrder = "PerOrder"; + /// + /// Per device charging type. + /// + public const string PerDevice = "PerDevice"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CommonProperties.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CommonProperties.cs new file mode 100644 index 0000000000000..bdcf99fd6957f --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CommonProperties.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents common properties across product hierarchy + /// + public partial class CommonProperties : BasicInformation + { + /// + /// Initializes a new instance of the CommonProperties class. + /// + public CommonProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CommonProperties class. + /// + /// Display Name for the product + /// system. + /// Description related to the product + /// system. + /// Image information for the product + /// system. + /// Cost information for the product + /// system. + /// Availability information of + /// the product system. + /// Hierarchy information of a + /// product. + /// list of filters supported for a + /// product + public CommonProperties(string displayName = default(string), Description description = default(Description), IList imageInformation = default(IList), CostInformation costInformation = default(CostInformation), AvailabilityInformation availabilityInformation = default(AvailabilityInformation), HierarchyInformation hierarchyInformation = default(HierarchyInformation), IList filterableProperties = default(IList)) + : base(displayName, description, imageInformation, costInformation, availabilityInformation, hierarchyInformation) + { + FilterableProperties = filterableProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of filters supported for a product + /// + [JsonProperty(PropertyName = "filterableProperties")] + public IList FilterableProperties { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Configuration.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Configuration.cs new file mode 100644 index 0000000000000..71d30e6781a76 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Configuration.cs @@ -0,0 +1,128 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Configuration object. + /// + [Rest.Serialization.JsonTransformation] + public partial class Configuration + { + /// + /// Initializes a new instance of the Configuration class. + /// + public Configuration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Configuration class. + /// + /// Display Name for the product + /// system. + /// Description related to the product + /// system. + /// Image information for the product + /// system. + /// Cost information for the product + /// system. + /// Availability information of + /// the product system. + /// Hierarchy information of a + /// product. + /// list of filters supported for a + /// product + /// Specifications of the + /// configuration + /// Dimensions of the configuration + public Configuration(string displayName = default(string), Description description = default(Description), IList imageInformation = default(IList), CostInformation costInformation = default(CostInformation), AvailabilityInformation availabilityInformation = default(AvailabilityInformation), HierarchyInformation hierarchyInformation = default(HierarchyInformation), IList filterableProperties = default(IList), IList specifications = default(IList), Dimensions dimensions = default(Dimensions)) + { + DisplayName = displayName; + Description = description; + ImageInformation = imageInformation; + CostInformation = costInformation; + AvailabilityInformation = availabilityInformation; + HierarchyInformation = hierarchyInformation; + FilterableProperties = filterableProperties; + Specifications = specifications; + Dimensions = dimensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display Name for the product system. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description related to the product system. + /// + [JsonProperty(PropertyName = "properties.description")] + public Description Description { get; private set; } + + /// + /// Gets image information for the product system. + /// + [JsonProperty(PropertyName = "properties.imageInformation")] + public IList ImageInformation { get; private set; } + + /// + /// Gets cost information for the product system. + /// + [JsonProperty(PropertyName = "properties.costInformation")] + public CostInformation CostInformation { get; private set; } + + /// + /// Gets availability information of the product system. + /// + [JsonProperty(PropertyName = "properties.availabilityInformation")] + public AvailabilityInformation AvailabilityInformation { get; private set; } + + /// + /// Gets hierarchy information of a product. + /// + [JsonProperty(PropertyName = "properties.hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; private set; } + + /// + /// Gets list of filters supported for a product + /// + [JsonProperty(PropertyName = "properties.filterableProperties")] + public IList FilterableProperties { get; private set; } + + /// + /// Gets specifications of the configuration + /// + [JsonProperty(PropertyName = "properties.specifications")] + public IList Specifications { get; private set; } + + /// + /// Gets dimensions of the configuration + /// + [JsonProperty(PropertyName = "properties.dimensions")] + public Dimensions Dimensions { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationFilters.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationFilters.cs new file mode 100644 index 0000000000000..47dfb1bca54fa --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationFilters.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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Configuration filters + /// + public partial class ConfigurationFilters + { + /// + /// Initializes a new instance of the ConfigurationFilters class. + /// + public ConfigurationFilters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigurationFilters class. + /// + /// Product hierarchy + /// information + /// Filters specific to + /// product + public ConfigurationFilters(HierarchyInformation hierarchyInformation, IList filterableProperty = default(IList)) + { + HierarchyInformation = hierarchyInformation; + FilterableProperty = filterableProperty; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets product hierarchy information + /// + [JsonProperty(PropertyName = "hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; set; } + + /// + /// Gets or sets filters specific to product + /// + [JsonProperty(PropertyName = "filterableProperty")] + public IList FilterableProperty { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (HierarchyInformation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "HierarchyInformation"); + } + if (FilterableProperty != null) + { + foreach (var element in FilterableProperty) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationsRequest.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationsRequest.cs new file mode 100644 index 0000000000000..035e9ad254832 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ConfigurationsRequest.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Configuration request object. + /// + public partial class ConfigurationsRequest + { + /// + /// Initializes a new instance of the ConfigurationsRequest class. + /// + public ConfigurationsRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigurationsRequest class. + /// + /// Holds details about product + /// hierarchy information and filterable property. + /// Customer subscription + /// properties. Clients can display available products to unregistered + /// customers by explicitly passing subscription details + public ConfigurationsRequest(IList configurationFilters, CustomerSubscriptionDetails customerSubscriptionDetails = default(CustomerSubscriptionDetails)) + { + ConfigurationFilters = configurationFilters; + CustomerSubscriptionDetails = customerSubscriptionDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets holds details about product hierarchy information and + /// filterable property. + /// + [JsonProperty(PropertyName = "configurationFilters")] + public IList ConfigurationFilters { get; set; } + + /// + /// Gets or sets customer subscription properties. Clients can display + /// available products to unregistered customers by explicitly passing + /// subscription details + /// + [JsonProperty(PropertyName = "customerSubscriptionDetails")] + public CustomerSubscriptionDetails CustomerSubscriptionDetails { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConfigurationFilters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConfigurationFilters"); + } + if (ConfigurationFilters != null) + { + if (ConfigurationFilters.Count != System.Linq.Enumerable.Count(System.Linq.Enumerable.Distinct(ConfigurationFilters))) + { + throw new ValidationException(ValidationRules.UniqueItems, "ConfigurationFilters"); + } + foreach (var element in ConfigurationFilters) + { + if (element != null) + { + element.Validate(); + } + } + } + if (CustomerSubscriptionDetails != null) + { + CustomerSubscriptionDetails.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ContactDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ContactDetails.cs new file mode 100644 index 0000000000000..b5c0c41f74759 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ContactDetails.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Contact Details. + /// + public partial class ContactDetails + { + /// + /// Initializes a new instance of the ContactDetails class. + /// + public ContactDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContactDetails class. + /// + /// Contact name of the person. + /// Phone number of the contact person. + /// List of Email-ids to be notified about job + /// progress. + /// Phone extension number of the contact + /// person. + /// Mobile number of the contact person. + public ContactDetails(string contactName, string phone, IList emailList, string phoneExtension = default(string), string mobile = default(string)) + { + ContactName = contactName; + Phone = phone; + PhoneExtension = phoneExtension; + Mobile = mobile; + EmailList = emailList; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets contact name of the person. + /// + [JsonProperty(PropertyName = "contactName")] + public string ContactName { get; set; } + + /// + /// Gets or sets phone number of the contact person. + /// + [JsonProperty(PropertyName = "phone")] + public string Phone { get; set; } + + /// + /// Gets or sets phone extension number of the contact person. + /// + [JsonProperty(PropertyName = "phoneExtension")] + public string PhoneExtension { get; set; } + + /// + /// Gets or sets mobile number of the contact person. + /// + [JsonProperty(PropertyName = "mobile")] + public string Mobile { get; set; } + + /// + /// Gets or sets list of Email-ids to be notified about job progress. + /// + [JsonProperty(PropertyName = "emailList")] + public IList EmailList { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ContactName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactName"); + } + if (Phone == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Phone"); + } + if (EmailList == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EmailList"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CostInformation.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CostInformation.cs new file mode 100644 index 0000000000000..b34bc80c08d7a --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CostInformation.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Cost information for the product system + /// + public partial class CostInformation + { + /// + /// Initializes a new instance of the CostInformation class. + /// + public CostInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CostInformation class. + /// + /// Details on the various billing + /// aspects for the product system. + /// Default url to display billing + /// information + public CostInformation(IList billingMeterDetails = default(IList), string billingInfoUrl = default(string)) + { + BillingMeterDetails = billingMeterDetails; + BillingInfoUrl = billingInfoUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets details on the various billing aspects for the product system. + /// + [JsonProperty(PropertyName = "billingMeterDetails")] + public IList BillingMeterDetails { get; private set; } + + /// + /// Gets default url to display billing information + /// + [JsonProperty(PropertyName = "billingInfoUrl")] + public string BillingInfoUrl { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CreatedByType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CreatedByType.cs new file mode 100644 index 0000000000000..8bc3911e9013a --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionDetails.cs new file mode 100644 index 0000000000000..97fe99f4c3083 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionDetails.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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Holds Customer subscription details. Clients can display available + /// products to unregistered customers by explicitly passing subscription + /// details + /// + public partial class CustomerSubscriptionDetails + { + /// + /// Initializes a new instance of the CustomerSubscriptionDetails + /// class. + /// + public CustomerSubscriptionDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomerSubscriptionDetails + /// class. + /// + /// Quota ID of a subscription + /// List of registered feature flags + /// for subscription + /// Location placement Id of a + /// subscription + public CustomerSubscriptionDetails(string quotaId, IList registeredFeatures = default(IList), string locationPlacementId = default(string)) + { + RegisteredFeatures = registeredFeatures; + LocationPlacementId = locationPlacementId; + QuotaId = quotaId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of registered feature flags for subscription + /// + [JsonProperty(PropertyName = "registeredFeatures")] + public IList RegisteredFeatures { get; set; } + + /// + /// Gets or sets location placement Id of a subscription + /// + [JsonProperty(PropertyName = "locationPlacementId")] + public string LocationPlacementId { get; set; } + + /// + /// Gets or sets quota ID of a subscription + /// + [JsonProperty(PropertyName = "quotaId")] + public string QuotaId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (QuotaId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "QuotaId"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionRegisteredFeatures.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionRegisteredFeatures.cs new file mode 100644 index 0000000000000..aa8c07839e79b --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/CustomerSubscriptionRegisteredFeatures.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents subscription registered features + /// + public partial class CustomerSubscriptionRegisteredFeatures + { + /// + /// Initializes a new instance of the + /// CustomerSubscriptionRegisteredFeatures class. + /// + public CustomerSubscriptionRegisteredFeatures() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CustomerSubscriptionRegisteredFeatures class. + /// + /// Name of subscription registered feature + /// State of subscription registered + /// feature + public CustomerSubscriptionRegisteredFeatures(string name = default(string), string state = default(string)) + { + Name = name; + State = state; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of subscription registered feature + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets state of subscription registered feature + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Description.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Description.cs new file mode 100644 index 0000000000000..fd0ab4fbcc936 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Description.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Description related properties of a product system. + /// + public partial class Description + { + /// + /// Initializes a new instance of the Description class. + /// + public Description() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Description class. + /// + /// Type of description. Possible values + /// include: 'Base' + /// Short description of the product + /// system. + /// Long description of the product + /// system. + /// Keywords for the product system. + /// Attributes for the product system. + /// Links for the product system. + public Description(string descriptionType = default(string), string shortDescription = default(string), string longDescription = default(string), IList keywords = default(IList), IList attributes = default(IList), IList links = default(IList)) + { + DescriptionType = descriptionType; + ShortDescription = shortDescription; + LongDescription = longDescription; + Keywords = keywords; + Attributes = attributes; + Links = links; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets type of description. Possible values include: 'Base' + /// + [JsonProperty(PropertyName = "descriptionType")] + public string DescriptionType { get; private set; } + + /// + /// Gets short description of the product system. + /// + [JsonProperty(PropertyName = "shortDescription")] + public string ShortDescription { get; private set; } + + /// + /// Gets long description of the product system. + /// + [JsonProperty(PropertyName = "longDescription")] + public string LongDescription { get; private set; } + + /// + /// Gets keywords for the product system. + /// + [JsonProperty(PropertyName = "keywords")] + public IList Keywords { get; private set; } + + /// + /// Gets attributes for the product system. + /// + [JsonProperty(PropertyName = "attributes")] + public IList Attributes { get; private set; } + + /// + /// Gets links for the product system. + /// + [JsonProperty(PropertyName = "links")] + public IList Links { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DescriptionType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DescriptionType.cs new file mode 100644 index 0000000000000..25650ee30bf22 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DescriptionType.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.EdgeOrder.Models +{ + + /// + /// Defines values for DescriptionType. + /// + public static class DescriptionType + { + /// + /// Base description. + /// + public const string Base = "Base"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DeviceDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DeviceDetails.cs new file mode 100644 index 0000000000000..108d150a28c30 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DeviceDetails.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Device details. + /// + public partial class DeviceDetails + { + /// + /// Initializes a new instance of the DeviceDetails class. + /// + public DeviceDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeviceDetails class. + /// + /// device serial number + /// Management Resource Id + public DeviceDetails(string serialNumber = default(string), string managementResourceId = default(string)) + { + SerialNumber = serialNumber; + ManagementResourceId = managementResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets device serial number + /// + [JsonProperty(PropertyName = "serialNumber")] + public string SerialNumber { get; private set; } + + /// + /// Gets management Resource Id + /// + [JsonProperty(PropertyName = "managementResourceId")] + public string ManagementResourceId { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Dimensions.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Dimensions.cs new file mode 100644 index 0000000000000..c0ef368fbcb05 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Dimensions.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Dimensions of a configuration. + /// + public partial class Dimensions + { + /// + /// Initializes a new instance of the Dimensions class. + /// + public Dimensions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Dimensions class. + /// + /// Length of the device. + /// Height of the device. + /// Width of the device. + /// Unit for the dimensions of length, + /// height and width. Possible values include: 'IN', 'CM' + /// Weight of the device. + /// Depth of the device. + /// Unit for the dimensions of weight. + /// Possible values include: 'LBS', 'KGS' + public Dimensions(double? length = default(double?), double? height = default(double?), double? width = default(double?), string lengthHeightUnit = default(string), double? weight = default(double?), double? depth = default(double?), string weightUnit = default(string)) + { + Length = length; + Height = height; + Width = width; + LengthHeightUnit = lengthHeightUnit; + Weight = weight; + Depth = depth; + WeightUnit = weightUnit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets length of the device. + /// + [JsonProperty(PropertyName = "length")] + public double? Length { get; private set; } + + /// + /// Gets height of the device. + /// + [JsonProperty(PropertyName = "height")] + public double? Height { get; private set; } + + /// + /// Gets width of the device. + /// + [JsonProperty(PropertyName = "width")] + public double? Width { get; private set; } + + /// + /// Gets unit for the dimensions of length, height and width. Possible + /// values include: 'IN', 'CM' + /// + [JsonProperty(PropertyName = "lengthHeightUnit")] + public string LengthHeightUnit { get; private set; } + + /// + /// Gets weight of the device. + /// + [JsonProperty(PropertyName = "weight")] + public double? Weight { get; private set; } + + /// + /// Gets depth of the device. + /// + [JsonProperty(PropertyName = "depth")] + public double? Depth { get; private set; } + + /// + /// Gets unit for the dimensions of weight. Possible values include: + /// 'LBS', 'KGS' + /// + [JsonProperty(PropertyName = "weightUnit")] + public string WeightUnit { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisabledReason.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisabledReason.cs new file mode 100644 index 0000000000000..91c4ac4ec1407 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisabledReason.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for DisabledReason. + /// + public static class DisabledReason + { + /// + /// Not disabled. + /// + public const string None = "None"; + /// + /// Not available in the requested country. + /// + public const string Country = "Country"; + /// + /// Not available to push data to the requested Azure region. + /// + public const string Region = "Region"; + /// + /// Required features are not enabled. + /// + public const string Feature = "Feature"; + /// + /// Subscription does not have required offer types. + /// + public const string OfferType = "OfferType"; + /// + /// Subscription has not registered to Microsoft.DataBox and Service + /// does not have the subscription notification. + /// + public const string NoSubscriptionInfo = "NoSubscriptionInfo"; + /// + /// The product is not yet available. + /// + public const string NotAvailable = "NotAvailable"; + /// + /// The product is out of stock. + /// + public const string OutOfStock = "OutOfStock"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisplayInfo.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisplayInfo.cs new file mode 100644 index 0000000000000..fc1f71c87136e --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DisplayInfo.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes product display information + /// + public partial class DisplayInfo + { + /// + /// Initializes a new instance of the DisplayInfo class. + /// + public DisplayInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DisplayInfo class. + /// + /// Product family display + /// name + /// Configuration display + /// name + public DisplayInfo(string productFamilyDisplayName = default(string), string configurationDisplayName = default(string)) + { + ProductFamilyDisplayName = productFamilyDisplayName; + ConfigurationDisplayName = configurationDisplayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets product family display name + /// + [JsonProperty(PropertyName = "productFamilyDisplayName")] + public string ProductFamilyDisplayName { get; private set; } + + /// + /// Gets configuration display name + /// + [JsonProperty(PropertyName = "configurationDisplayName")] + public string ConfigurationDisplayName { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DoubleEncryptionStatus.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DoubleEncryptionStatus.cs new file mode 100644 index 0000000000000..fd7bd75e6c5dd --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/DoubleEncryptionStatus.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for DoubleEncryptionStatus. + /// + public static class DoubleEncryptionStatus + { + /// + /// Double encryption is disabled + /// + public const string Disabled = "Disabled"; + /// + /// Double encryption is enabled + /// + public const string Enabled = "Enabled"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/EncryptionPreferences.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/EncryptionPreferences.cs new file mode 100644 index 0000000000000..543b6b6c9c589 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/EncryptionPreferences.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Preferences related to the double encryption + /// + public partial class EncryptionPreferences + { + /// + /// Initializes a new instance of the EncryptionPreferences class. + /// + public EncryptionPreferences() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionPreferences class. + /// + /// Defines secondary layer of + /// software-based encryption enablement. Possible values include: + /// 'Disabled', 'Enabled' + public EncryptionPreferences(string doubleEncryptionStatus = default(string)) + { + DoubleEncryptionStatus = doubleEncryptionStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets defines secondary layer of software-based encryption + /// enablement. Possible values include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "doubleEncryptionStatus")] + public string DoubleEncryptionStatus { get; set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 0000000000000..3500609d90c9a --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorDetail.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 0000000000000..087691f3fa284 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponse.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 0000000000000..3976de96b19b6 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponseException.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 0000000000000..d9995ccb4dea5 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ErrorResponseException.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.EdgeOrder.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/FilterableProperty.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/FilterableProperty.cs new file mode 100644 index 0000000000000..842622eec5a35 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/FilterableProperty.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Different types of filters supported and its values. + /// + public partial class FilterableProperty + { + /// + /// Initializes a new instance of the FilterableProperty class. + /// + public FilterableProperty() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FilterableProperty class. + /// + /// Type of product filter. Possible values include: + /// 'ShipToCountries', 'DoubleEncryptionStatus' + /// Values to be filtered. + public FilterableProperty(string type, IList supportedValues) + { + Type = type; + SupportedValues = supportedValues; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of product filter. Possible values include: + /// 'ShipToCountries', 'DoubleEncryptionStatus' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets values to be filtered. + /// + [JsonProperty(PropertyName = "supportedValues")] + public IList SupportedValues { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (SupportedValues == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SupportedValues"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/HierarchyInformation.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/HierarchyInformation.cs new file mode 100644 index 0000000000000..e25d175f8c51e --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/HierarchyInformation.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Holds details about product hierarchy information + /// + public partial class HierarchyInformation + { + /// + /// Initializes a new instance of the HierarchyInformation class. + /// + public HierarchyInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HierarchyInformation class. + /// + /// Represents product family name that + /// uniquely identifies product family + /// Represents product line name that + /// uniquely identifies product line + /// Represents product name that uniquely + /// identifies product + /// Represents configuration name that + /// uniquely identifies configuration + public HierarchyInformation(string productFamilyName = default(string), string productLineName = default(string), string productName = default(string), string configurationName = default(string)) + { + ProductFamilyName = productFamilyName; + ProductLineName = productLineName; + ProductName = productName; + ConfigurationName = configurationName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets represents product family name that uniquely + /// identifies product family + /// + [JsonProperty(PropertyName = "productFamilyName")] + public string ProductFamilyName { get; set; } + + /// + /// Gets or sets represents product line name that uniquely identifies + /// product line + /// + [JsonProperty(PropertyName = "productLineName")] + public string ProductLineName { get; set; } + + /// + /// Gets or sets represents product name that uniquely identifies + /// product + /// + [JsonProperty(PropertyName = "productName")] + public string ProductName { get; set; } + + /// + /// Gets or sets represents configuration name that uniquely identifies + /// configuration + /// + [JsonProperty(PropertyName = "configurationName")] + public string ConfigurationName { get; set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageInformation.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageInformation.cs new file mode 100644 index 0000000000000..208f02fd4b7c3 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageInformation.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Image for the product + /// + public partial class ImageInformation + { + /// + /// Initializes a new instance of the ImageInformation class. + /// + public ImageInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ImageInformation class. + /// + /// Type of the image. Possible values include: + /// 'MainImage', 'BulletImage', 'GenericImage' + /// Url of the image + public ImageInformation(string imageType = default(string), string imageUrl = default(string)) + { + ImageType = imageType; + ImageUrl = imageUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets type of the image. Possible values include: 'MainImage', + /// 'BulletImage', 'GenericImage' + /// + [JsonProperty(PropertyName = "imageType")] + public string ImageType { get; private set; } + + /// + /// Gets url of the image + /// + [JsonProperty(PropertyName = "imageUrl")] + public string ImageUrl { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageType.cs new file mode 100644 index 0000000000000..883bf5ef56127 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ImageType.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for ImageType. + /// + public static class ImageType + { + /// + /// Main image. + /// + public const string MainImage = "MainImage"; + /// + /// Bullet image. + /// + public const string BulletImage = "BulletImage"; + /// + /// Generic image. + /// + public const string GenericImage = "GenericImage"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LengthHeightUnit.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LengthHeightUnit.cs new file mode 100644 index 0000000000000..533fa054ff762 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LengthHeightUnit.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for LengthHeightUnit. + /// + public static class LengthHeightUnit + { + /// + /// Inch, applicable for West US. + /// + public const string IN = "IN"; + /// + /// Centimeter. + /// + public const string CM = "CM"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Link.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Link.cs new file mode 100644 index 0000000000000..6610a2539c9c4 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Link.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Returns link related to the product + /// + public partial class Link + { + /// + /// Initializes a new instance of the Link class. + /// + public Link() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Link class. + /// + /// Type of link. Possible values include: + /// 'Generic', 'TermsAndConditions', 'Specification', 'Documentation', + /// 'KnowMore', 'SignUp' + /// Url of the link + public Link(string linkType = default(string), string linkUrl = default(string)) + { + LinkType = linkType; + LinkUrl = linkUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets type of link. Possible values include: 'Generic', + /// 'TermsAndConditions', 'Specification', 'Documentation', 'KnowMore', + /// 'SignUp' + /// + [JsonProperty(PropertyName = "linkType")] + public string LinkType { get; private set; } + + /// + /// Gets url of the link + /// + [JsonProperty(PropertyName = "linkUrl")] + public string LinkUrl { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LinkType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LinkType.cs new file mode 100644 index 0000000000000..d5a42d3ace99c --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/LinkType.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for LinkType. + /// + public static class LinkType + { + /// + /// Generic link. + /// + public const string Generic = "Generic"; + /// + /// Terms and conditions link. + /// + public const string TermsAndConditions = "TermsAndConditions"; + /// + /// Link to product specification. + /// + public const string Specification = "Specification"; + /// + /// Link to product documentation + /// + public const string Documentation = "Documentation"; + /// + /// Link to know more + /// + public const string KnowMore = "KnowMore"; + /// + /// Link to sign up for products + /// + public const string SignUp = "SignUp"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ManagementResourcePreferences.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ManagementResourcePreferences.cs new file mode 100644 index 0000000000000..abe75f44c1bd7 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ManagementResourcePreferences.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Management resource preference to link device + /// + public partial class ManagementResourcePreferences + { + /// + /// Initializes a new instance of the ManagementResourcePreferences + /// class. + /// + public ManagementResourcePreferences() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagementResourcePreferences + /// class. + /// + /// Customer preferred + /// Management resource ARM ID + public ManagementResourcePreferences(string preferredManagementResourceId = default(string)) + { + PreferredManagementResourceId = preferredManagementResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets customer preferred Management resource ARM ID + /// + [JsonProperty(PropertyName = "preferredManagementResourceId")] + public string PreferredManagementResourceId { get; set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeterDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeterDetails.cs new file mode 100644 index 0000000000000..07475bd8d9d55 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeterDetails.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Holds details about billing type and its meter guids + /// + public partial class MeterDetails + { + /// + /// Initializes a new instance of the MeterDetails class. + /// + public MeterDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MeterDetails class. + /// + /// Billing unit applicable for Pav2 + /// billing + /// Charging type. Possible values include: + /// 'PerOrder', 'PerDevice' + public MeterDetails(double? multiplier = default(double?), string chargingType = default(string)) + { + Multiplier = multiplier; + ChargingType = chargingType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets billing unit applicable for Pav2 billing + /// + [JsonProperty(PropertyName = "multiplier")] + public double? Multiplier { get; private set; } + + /// + /// Gets charging type. Possible values include: 'PerOrder', + /// 'PerDevice' + /// + [JsonProperty(PropertyName = "chargingType")] + public string ChargingType { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeteringType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeteringType.cs new file mode 100644 index 0000000000000..e8c5b43d1ed3f --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/MeteringType.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for MeteringType. + /// + public static class MeteringType + { + /// + /// One time billing. + /// + public const string OneTime = "OneTime"; + /// + /// Recurring billing. + /// + public const string Recurring = "Recurring"; + /// + /// Adhoc billing. + /// + public const string Adhoc = "Adhoc"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationPreference.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationPreference.cs new file mode 100644 index 0000000000000..c5f5bf5d20e02 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationPreference.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Notification preference for a job stage. + /// + public partial class NotificationPreference + { + /// + /// Initializes a new instance of the NotificationPreference class. + /// + public NotificationPreference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotificationPreference class. + /// + /// Name of the stage. Possible values include: + /// 'Shipped', 'Delivered' + /// Notification is required or + /// not. + public NotificationPreference(string stageName, bool sendNotification) + { + StageName = stageName; + SendNotification = sendNotification; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the stage. Possible values include: 'Shipped', + /// 'Delivered' + /// + [JsonProperty(PropertyName = "stageName")] + public string StageName { get; set; } + + /// + /// Gets or sets notification is required or not. + /// + [JsonProperty(PropertyName = "sendNotification")] + public bool SendNotification { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StageName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StageName"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationStageName.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationStageName.cs new file mode 100644 index 0000000000000..dbcc1b5b3dc0b --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/NotificationStageName.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for NotificationStageName. + /// + public static class NotificationStageName + { + /// + /// Notification at order item shipped from microsoft datacenter. + /// + public const string Shipped = "Shipped"; + /// + /// Notification at order item delivered to customer. + /// + public const string Delivered = "Delivered"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Operation.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Operation.cs new file mode 100644 index 0000000000000..8ce4bbc069ece --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Operation.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// REST API Operation + /// + /// + /// Details of a REST API operation, returned from the Resource Provider + /// Operations API + /// + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// The name of the operation, as per Resource-Based + /// Access Control (RBAC). Examples: + /// "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// Whether the operation applies to + /// data-plane. This is "true" for data-plane operations and "false" + /// for ARM/control-plane operations. + /// Localized display information for this + /// particular operation. + /// The intended executor of the operation; as in + /// Resource Based Access Control (RBAC) and audit logs UX. Default + /// value is "user,system". Possible values include: 'user', 'system', + /// 'user,system' + /// Enum. Indicates the action type. + /// "Internal" refers to actions that are for internal only APIs. + /// Possible values include: 'Internal' + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay), string origin = default(string), string actionType = default(string)) + { + Name = name; + IsDataAction = isDataAction; + Display = display; + Origin = origin; + ActionType = actionType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the operation, as per Resource-Based Access + /// Control (RBAC). Examples: + /// "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets whether the operation applies to data-plane. This is "true" + /// for data-plane operations and "false" for ARM/control-plane + /// operations. + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; private set; } + + /// + /// Gets or sets localized display information for this particular + /// operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + /// + /// Gets the intended executor of the operation; as in Resource Based + /// Access Control (RBAC) and audit logs UX. Default value is + /// "user,system". Possible values include: 'user', 'system', + /// 'user,system' + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; private set; } + + /// + /// Gets enum. Indicates the action type. "Internal" refers to actions + /// that are for internal only APIs. Possible values include: + /// 'Internal' + /// + [JsonProperty(PropertyName = "actionType")] + public string ActionType { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OperationDisplay.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..f22203178c884 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OperationDisplay.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Localized display information for this particular operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// The localized friendly form of the resource + /// provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + /// Compute". + /// The localized friendly name of the resource + /// type related to this operation. E.g. "Virtual Machines" or "Job + /// Schedule Collections". + /// The concise, localized friendly name for + /// the operation; suitable for dropdowns. E.g. "Create or Update + /// Virtual Machine", "Restart Virtual Machine". + /// The short, localized friendly description + /// of the operation; suitable for tool tips and detailed + /// views. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the localized friendly form of the resource provider name, + /// e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; private set; } + + /// + /// Gets the localized friendly name of the resource type related to + /// this operation. E.g. "Virtual Machines" or "Job Schedule + /// Collections". + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; private set; } + + /// + /// Gets the concise, localized friendly name for the operation; + /// suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; private set; } + + /// + /// Gets the short, localized friendly description of the operation; + /// suitable for tool tips and detailed views. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemCancellationEnum.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemCancellationEnum.cs new file mode 100644 index 0000000000000..aefda4f7eed4f --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemCancellationEnum.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for OrderItemCancellationEnum. + /// + public static class OrderItemCancellationEnum + { + /// + /// Order item can be cancelled without fee. + /// + public const string Cancellable = "Cancellable"; + /// + /// Order item can be cancelled with fee. + /// + public const string CancellableWithFee = "CancellableWithFee"; + /// + /// Order item not cancellable. + /// + public const string NotCancellable = "NotCancellable"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemDetails.cs new file mode 100644 index 0000000000000..479b55e8a0a8a --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemDetails.cs @@ -0,0 +1,208 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Order item details + /// + public partial class OrderItemDetails + { + /// + /// Initializes a new instance of the OrderItemDetails class. + /// + public OrderItemDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrderItemDetails class. + /// + /// Unique identifier for + /// configuration. + /// Order item type. Possible values + /// include: 'Purchase', 'Rental' + /// Current Order item Status + /// Order item status + /// history + /// Customer notification Preferences + /// Forward Package Shipping + /// details + /// Reverse Package Shipping + /// details + /// Additional notification email + /// list + /// Cancellation reason. + /// Describes whether the orderItem is + /// cancellable or not. Possible values include: 'Cancellable', + /// 'CancellableWithFee', 'NotCancellable' + /// Describes whether the order item is + /// deletable or not. Possible values include: 'Allowed', + /// 'NotAllowed' + /// Return reason. + /// Describes whether the orderItem is + /// returnable or not. Possible values include: 'Returnable', + /// 'ReturnableWithFee', 'NotReturnable' + /// parent RP details + /// Top level error for the job. + public OrderItemDetails(ProductDetails productDetails, string orderItemType, StageDetails currentStage = default(StageDetails), IList orderItemStageHistory = default(IList), Preferences preferences = default(Preferences), ShippingDetails forwardShippingDetails = default(ShippingDetails), ShippingDetails reverseShippingDetails = default(ShippingDetails), IList notificationEmailList = default(IList), string cancellationReason = default(string), string cancellationStatus = default(string), string deletionStatus = default(string), string returnReason = default(string), string returnStatus = default(string), object managementRpDetails = default(object), ErrorDetail error = default(ErrorDetail)) + { + ProductDetails = productDetails; + OrderItemType = orderItemType; + CurrentStage = currentStage; + OrderItemStageHistory = orderItemStageHistory; + Preferences = preferences; + ForwardShippingDetails = forwardShippingDetails; + ReverseShippingDetails = reverseShippingDetails; + NotificationEmailList = notificationEmailList; + CancellationReason = cancellationReason; + CancellationStatus = cancellationStatus; + DeletionStatus = deletionStatus; + ReturnReason = returnReason; + ReturnStatus = returnStatus; + ManagementRpDetails = managementRpDetails; + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique identifier for configuration. + /// + [JsonProperty(PropertyName = "productDetails")] + public ProductDetails ProductDetails { get; set; } + + /// + /// Gets or sets order item type. Possible values include: 'Purchase', + /// 'Rental' + /// + [JsonProperty(PropertyName = "orderItemType")] + public string OrderItemType { get; set; } + + /// + /// Gets current Order item Status + /// + [JsonProperty(PropertyName = "currentStage")] + public StageDetails CurrentStage { get; private set; } + + /// + /// Gets order item status history + /// + [JsonProperty(PropertyName = "orderItemStageHistory")] + public IList OrderItemStageHistory { get; private set; } + + /// + /// Gets or sets customer notification Preferences + /// + [JsonProperty(PropertyName = "preferences")] + public Preferences Preferences { get; set; } + + /// + /// Gets forward Package Shipping details + /// + [JsonProperty(PropertyName = "forwardShippingDetails")] + public ShippingDetails ForwardShippingDetails { get; private set; } + + /// + /// Gets reverse Package Shipping details + /// + [JsonProperty(PropertyName = "reverseShippingDetails")] + public ShippingDetails ReverseShippingDetails { get; private set; } + + /// + /// Gets or sets additional notification email list + /// + [JsonProperty(PropertyName = "notificationEmailList")] + public IList NotificationEmailList { get; set; } + + /// + /// Gets cancellation reason. + /// + [JsonProperty(PropertyName = "cancellationReason")] + public string CancellationReason { get; private set; } + + /// + /// Gets describes whether the orderItem is cancellable or not. + /// Possible values include: 'Cancellable', 'CancellableWithFee', + /// 'NotCancellable' + /// + [JsonProperty(PropertyName = "cancellationStatus")] + public string CancellationStatus { get; private set; } + + /// + /// Gets describes whether the order item is deletable or not. Possible + /// values include: 'Allowed', 'NotAllowed' + /// + [JsonProperty(PropertyName = "deletionStatus")] + public string DeletionStatus { get; private set; } + + /// + /// Gets return reason. + /// + [JsonProperty(PropertyName = "returnReason")] + public string ReturnReason { get; private set; } + + /// + /// Gets describes whether the orderItem is returnable or not. Possible + /// values include: 'Returnable', 'ReturnableWithFee', 'NotReturnable' + /// + [JsonProperty(PropertyName = "returnStatus")] + public string ReturnStatus { get; private set; } + + /// + /// Gets parent RP details + /// + [JsonProperty(PropertyName = "managementRpDetails")] + public object ManagementRpDetails { get; private set; } + + /// + /// Gets top level error for the job. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ProductDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ProductDetails"); + } + if (OrderItemType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OrderItemType"); + } + if (ProductDetails != null) + { + ProductDetails.Validate(); + } + if (Preferences != null) + { + Preferences.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemResource.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemResource.cs new file mode 100644 index 0000000000000..0daea08897961 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemResource.cs @@ -0,0 +1,132 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents order item contract + /// + [Rest.Serialization.JsonTransformation] + public partial class OrderItemResource : TrackedResource + { + /// + /// Initializes a new instance of the OrderItemResource class. + /// + public OrderItemResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrderItemResource class. + /// + /// The geo-location where the resource + /// lives + /// Represents order item + /// details. + /// Represents shipping and return address + /// for order item + /// Id of the order to which order item belongs + /// to + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + /// Start time of order item + /// Represents resource creation and update + /// time + public OrderItemResource(string location, OrderItemDetails orderItemDetails, AddressDetails addressDetails, string orderId, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.DateTime? startTime = default(System.DateTime?), SystemData systemData = default(SystemData)) + : base(location, id, name, type, tags) + { + OrderItemDetails = orderItemDetails; + AddressDetails = addressDetails; + StartTime = startTime; + OrderId = orderId; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets represents order item details. + /// + [JsonProperty(PropertyName = "properties.orderItemDetails")] + public OrderItemDetails OrderItemDetails { get; set; } + + /// + /// Gets or sets represents shipping and return address for order item + /// + [JsonProperty(PropertyName = "properties.addressDetails")] + public AddressDetails AddressDetails { get; set; } + + /// + /// Gets start time of order item + /// + [JsonProperty(PropertyName = "properties.startTime")] + public System.DateTime? StartTime { get; private set; } + + /// + /// Gets or sets id of the order to which order item belongs to + /// + [JsonProperty(PropertyName = "properties.orderId")] + public string OrderId { get; set; } + + /// + /// Gets represents resource creation and update time + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (OrderItemDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OrderItemDetails"); + } + if (AddressDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AddressDetails"); + } + if (OrderId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OrderId"); + } + if (OrderItemDetails != null) + { + OrderItemDetails.Validate(); + } + if (AddressDetails != null) + { + AddressDetails.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemReturnEnum.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemReturnEnum.cs new file mode 100644 index 0000000000000..4369f6a155eb5 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemReturnEnum.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + + /// + /// Defines values for OrderItemReturnEnum. + /// + public static class OrderItemReturnEnum + { + /// + /// Order item can be returned without fee. + /// + public const string Returnable = "Returnable"; + /// + /// Order item can be returned with fee. + /// + public const string ReturnableWithFee = "ReturnableWithFee"; + /// + /// Order item not returnable. + /// + public const string NotReturnable = "NotReturnable"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemType.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemType.cs new file mode 100644 index 0000000000000..393cc1180b787 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemType.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for OrderItemType. + /// + public static class OrderItemType + { + /// + /// Purchase OrderItem. + /// + public const string Purchase = "Purchase"; + /// + /// Rental OrderItem. + /// + public const string Rental = "Rental"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemUpdateParameter.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemUpdateParameter.cs new file mode 100644 index 0000000000000..7fcc7f1bce2fb --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderItemUpdateParameter.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Updates order item parameters. + /// + [Rest.Serialization.JsonTransformation] + public partial class OrderItemUpdateParameter + { + /// + /// Initializes a new instance of the OrderItemUpdateParameter class. + /// + public OrderItemUpdateParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrderItemUpdateParameter class. + /// + /// Updates forward shipping address and + /// contact details. + /// Customer preference. + /// Additional notification email + /// list. + /// The list of key value pairs that describe the + /// resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). + public OrderItemUpdateParameter(AddressProperties forwardAddress = default(AddressProperties), Preferences preferences = default(Preferences), IList notificationEmailList = default(IList), IDictionary tags = default(IDictionary)) + { + ForwardAddress = forwardAddress; + Preferences = preferences; + NotificationEmailList = notificationEmailList; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets updates forward shipping address and contact details. + /// + [JsonProperty(PropertyName = "properties.forwardAddress")] + public AddressProperties ForwardAddress { get; set; } + + /// + /// Gets or sets customer preference. + /// + [JsonProperty(PropertyName = "properties.preferences")] + public Preferences Preferences { get; set; } + + /// + /// Gets or sets additional notification email list. + /// + [JsonProperty(PropertyName = "properties.notificationEmailList")] + public IList NotificationEmailList { get; set; } + + /// + /// Gets or sets the list of key value pairs that describe the + /// resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ForwardAddress != null) + { + ForwardAddress.Validate(); + } + if (Preferences != null) + { + Preferences.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderResource.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderResource.cs new file mode 100644 index 0000000000000..1873dac800c3d --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/OrderResource.cs @@ -0,0 +1,90 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies the properties or parameters for an order. Order is a + /// grouping of one or more order items. + /// + [Rest.Serialization.JsonTransformation] + public partial class OrderResource : ProxyResource + { + /// + /// Initializes a new instance of the OrderResource class. + /// + public OrderResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrderResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// List of order item ARM Ids which are + /// part of an order. + /// Order current status. + /// Order status history. + /// Represents resource creation and update + /// time + public OrderResource(string id = default(string), string name = default(string), string type = default(string), IList orderItemIds = default(IList), StageDetails currentStage = default(StageDetails), IList orderStageHistory = default(IList), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + OrderItemIds = orderItemIds; + CurrentStage = currentStage; + OrderStageHistory = orderStageHistory; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of order item ARM Ids which are part of an order. + /// + [JsonProperty(PropertyName = "properties.orderItemIds")] + public IList OrderItemIds { get; private set; } + + /// + /// Gets order current status. + /// + [JsonProperty(PropertyName = "properties.currentStage")] + public StageDetails CurrentStage { get; private set; } + + /// + /// Gets order status history. + /// + [JsonProperty(PropertyName = "properties.orderStageHistory")] + public IList OrderStageHistory { get; private set; } + + /// + /// Gets represents resource creation and update time + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Origin.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Origin.cs new file mode 100644 index 0000000000000..df5a74551733e --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Origin.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.EdgeOrder.Models +{ + + /// + /// Defines values for Origin. + /// + public static class Origin + { + public const string User = "user"; + public const string System = "system"; + public const string Usersystem = "user,system"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Page.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Page.cs new file mode 100644 index 0000000000000..9786d54a6d1f0 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Pav2MeterDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Pav2MeterDetails.cs new file mode 100644 index 0000000000000..491f318916895 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Pav2MeterDetails.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Billing type PAV2 meter details + /// + [Newtonsoft.Json.JsonObject("Pav2")] + public partial class Pav2MeterDetails : MeterDetails + { + /// + /// Initializes a new instance of the Pav2MeterDetails class. + /// + public Pav2MeterDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Pav2MeterDetails class. + /// + /// Billing unit applicable for Pav2 + /// billing + /// Charging type. Possible values include: + /// 'PerOrder', 'PerDevice' + /// Validation status of requested data center + /// and transport. + public Pav2MeterDetails(double? multiplier = default(double?), string chargingType = default(string), string meterGuid = default(string)) + : base(multiplier, chargingType) + { + MeterGuid = meterGuid; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets validation status of requested data center and transport. + /// + [JsonProperty(PropertyName = "meterGuid")] + public string MeterGuid { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Preferences.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Preferences.cs new file mode 100644 index 0000000000000..9262d5a082563 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Preferences.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Preferences related to the order + /// + public partial class Preferences + { + /// + /// Initializes a new instance of the Preferences class. + /// + public Preferences() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Preferences class. + /// + /// Notification + /// preferences. + /// Preferences related to the + /// shipment logistics of the order. + /// Preferences related to the + /// Encryption. + /// Preferences related to + /// the Management resource. + public Preferences(IList notificationPreferences = default(IList), TransportPreferences transportPreferences = default(TransportPreferences), EncryptionPreferences encryptionPreferences = default(EncryptionPreferences), ManagementResourcePreferences managementResourcePreferences = default(ManagementResourcePreferences)) + { + NotificationPreferences = notificationPreferences; + TransportPreferences = transportPreferences; + EncryptionPreferences = encryptionPreferences; + ManagementResourcePreferences = managementResourcePreferences; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets notification preferences. + /// + [JsonProperty(PropertyName = "notificationPreferences")] + public IList NotificationPreferences { get; set; } + + /// + /// Gets or sets preferences related to the shipment logistics of the + /// order. + /// + [JsonProperty(PropertyName = "transportPreferences")] + public TransportPreferences TransportPreferences { get; set; } + + /// + /// Gets or sets preferences related to the Encryption. + /// + [JsonProperty(PropertyName = "encryptionPreferences")] + public EncryptionPreferences EncryptionPreferences { get; set; } + + /// + /// Gets or sets preferences related to the Management resource. + /// + [JsonProperty(PropertyName = "managementResourcePreferences")] + public ManagementResourcePreferences ManagementResourcePreferences { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NotificationPreferences != null) + { + foreach (var element in NotificationPreferences) + { + if (element != null) + { + element.Validate(); + } + } + } + if (TransportPreferences != null) + { + TransportPreferences.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Product.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Product.cs new file mode 100644 index 0000000000000..041e5fe4b7b52 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Product.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// List of Products + /// + [Rest.Serialization.JsonTransformation] + public partial class Product + { + /// + /// Initializes a new instance of the Product class. + /// + public Product() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Product class. + /// + /// Display Name for the product + /// system. + /// Description related to the product + /// system. + /// Image information for the product + /// system. + /// Cost information for the product + /// system. + /// Availability information of + /// the product system. + /// Hierarchy information of a + /// product. + /// list of filters supported for a + /// product + /// List of configurations for the + /// product + public Product(string displayName = default(string), Description description = default(Description), IList imageInformation = default(IList), CostInformation costInformation = default(CostInformation), AvailabilityInformation availabilityInformation = default(AvailabilityInformation), HierarchyInformation hierarchyInformation = default(HierarchyInformation), IList filterableProperties = default(IList), IList configurations = default(IList)) + { + DisplayName = displayName; + Description = description; + ImageInformation = imageInformation; + CostInformation = costInformation; + AvailabilityInformation = availabilityInformation; + HierarchyInformation = hierarchyInformation; + FilterableProperties = filterableProperties; + Configurations = configurations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display Name for the product system. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description related to the product system. + /// + [JsonProperty(PropertyName = "properties.description")] + public Description Description { get; private set; } + + /// + /// Gets image information for the product system. + /// + [JsonProperty(PropertyName = "properties.imageInformation")] + public IList ImageInformation { get; private set; } + + /// + /// Gets cost information for the product system. + /// + [JsonProperty(PropertyName = "properties.costInformation")] + public CostInformation CostInformation { get; private set; } + + /// + /// Gets availability information of the product system. + /// + [JsonProperty(PropertyName = "properties.availabilityInformation")] + public AvailabilityInformation AvailabilityInformation { get; private set; } + + /// + /// Gets hierarchy information of a product. + /// + [JsonProperty(PropertyName = "properties.hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; private set; } + + /// + /// Gets list of filters supported for a product + /// + [JsonProperty(PropertyName = "properties.filterableProperties")] + public IList FilterableProperties { get; private set; } + + /// + /// Gets list of configurations for the product + /// + [JsonProperty(PropertyName = "properties.configurations")] + public IList Configurations { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductDetails.cs new file mode 100644 index 0000000000000..7542055632476 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductDetails.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents product details + /// + public partial class ProductDetails + { + /// + /// Initializes a new instance of the ProductDetails class. + /// + public ProductDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProductDetails class. + /// + /// Hierarchy of the product which + /// uniquely identifies the product + /// Display details of the product + /// Quantity of the product + /// list of device details + public ProductDetails(HierarchyInformation hierarchyInformation, DisplayInfo displayInfo = default(DisplayInfo), int? count = default(int?), IList deviceDetails = default(IList)) + { + DisplayInfo = displayInfo; + HierarchyInformation = hierarchyInformation; + Count = count; + DeviceDetails = deviceDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display details of the product + /// + [JsonProperty(PropertyName = "displayInfo")] + public DisplayInfo DisplayInfo { get; set; } + + /// + /// Gets or sets hierarchy of the product which uniquely identifies the + /// product + /// + [JsonProperty(PropertyName = "hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; set; } + + /// + /// Gets or sets quantity of the product + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; set; } + + /// + /// Gets list of device details + /// + [JsonProperty(PropertyName = "deviceDetails")] + public IList DeviceDetails { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (HierarchyInformation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "HierarchyInformation"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesMetadataDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesMetadataDetails.cs new file mode 100644 index 0000000000000..d76755e431b37 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesMetadataDetails.cs @@ -0,0 +1,122 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Product families metadata details. + /// + [Rest.Serialization.JsonTransformation] + public partial class ProductFamiliesMetadataDetails + { + /// + /// Initializes a new instance of the ProductFamiliesMetadataDetails + /// class. + /// + public ProductFamiliesMetadataDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProductFamiliesMetadataDetails + /// class. + /// + /// Display Name for the product + /// system. + /// Description related to the product + /// system. + /// Image information for the product + /// system. + /// Cost information for the product + /// system. + /// Availability information of + /// the product system. + /// Hierarchy information of a + /// product. + /// list of filters supported for a + /// product + /// List of product lines supported in the + /// product family + public ProductFamiliesMetadataDetails(string displayName = default(string), Description description = default(Description), IList imageInformation = default(IList), CostInformation costInformation = default(CostInformation), AvailabilityInformation availabilityInformation = default(AvailabilityInformation), HierarchyInformation hierarchyInformation = default(HierarchyInformation), IList filterableProperties = default(IList), IList productLines = default(IList)) + { + DisplayName = displayName; + Description = description; + ImageInformation = imageInformation; + CostInformation = costInformation; + AvailabilityInformation = availabilityInformation; + HierarchyInformation = hierarchyInformation; + FilterableProperties = filterableProperties; + ProductLines = productLines; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display Name for the product system. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description related to the product system. + /// + [JsonProperty(PropertyName = "properties.description")] + public Description Description { get; private set; } + + /// + /// Gets image information for the product system. + /// + [JsonProperty(PropertyName = "properties.imageInformation")] + public IList ImageInformation { get; private set; } + + /// + /// Gets cost information for the product system. + /// + [JsonProperty(PropertyName = "properties.costInformation")] + public CostInformation CostInformation { get; private set; } + + /// + /// Gets availability information of the product system. + /// + [JsonProperty(PropertyName = "properties.availabilityInformation")] + public AvailabilityInformation AvailabilityInformation { get; private set; } + + /// + /// Gets hierarchy information of a product. + /// + [JsonProperty(PropertyName = "properties.hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; private set; } + + /// + /// Gets list of filters supported for a product + /// + [JsonProperty(PropertyName = "properties.filterableProperties")] + public IList FilterableProperties { get; private set; } + + /// + /// Gets list of product lines supported in the product family + /// + [JsonProperty(PropertyName = "properties.productLines")] + public IList ProductLines { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesRequest.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesRequest.cs new file mode 100644 index 0000000000000..1401599209ad6 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamiliesRequest.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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The filters for showing the product families. + /// + public partial class ProductFamiliesRequest + { + /// + /// Initializes a new instance of the ProductFamiliesRequest class. + /// + public ProductFamiliesRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProductFamiliesRequest class. + /// + /// Dictionary of filterable + /// properties on product family. + /// Customer subscription + /// properties. Clients can display available products to unregistered + /// customers by explicitly passing subscription details + public ProductFamiliesRequest(IDictionary> filterableProperties, CustomerSubscriptionDetails customerSubscriptionDetails = default(CustomerSubscriptionDetails)) + { + FilterableProperties = filterableProperties; + CustomerSubscriptionDetails = customerSubscriptionDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets dictionary of filterable properties on product family. + /// + [JsonProperty(PropertyName = "filterableProperties")] + public IDictionary> FilterableProperties { get; set; } + + /// + /// Gets or sets customer subscription properties. Clients can display + /// available products to unregistered customers by explicitly passing + /// subscription details + /// + [JsonProperty(PropertyName = "customerSubscriptionDetails")] + public CustomerSubscriptionDetails CustomerSubscriptionDetails { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (FilterableProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "FilterableProperties"); + } + if (FilterableProperties != null) + { + foreach (var valueElement in FilterableProperties.Values) + { + if (valueElement != null) + { + foreach (var element in valueElement) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } + if (CustomerSubscriptionDetails != null) + { + CustomerSubscriptionDetails.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamily.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamily.cs new file mode 100644 index 0000000000000..41e3b3de0f36f --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductFamily.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Product Family + /// + [Rest.Serialization.JsonTransformation] + public partial class ProductFamily + { + /// + /// Initializes a new instance of the ProductFamily class. + /// + public ProductFamily() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProductFamily class. + /// + /// Display Name for the product + /// system. + /// Description related to the product + /// system. + /// Image information for the product + /// system. + /// Cost information for the product + /// system. + /// Availability information of + /// the product system. + /// Hierarchy information of a + /// product. + /// list of filters supported for a + /// product + /// List of product lines supported in the + /// product family + public ProductFamily(string displayName = default(string), Description description = default(Description), IList imageInformation = default(IList), CostInformation costInformation = default(CostInformation), AvailabilityInformation availabilityInformation = default(AvailabilityInformation), HierarchyInformation hierarchyInformation = default(HierarchyInformation), IList filterableProperties = default(IList), IList productLines = default(IList)) + { + DisplayName = displayName; + Description = description; + ImageInformation = imageInformation; + CostInformation = costInformation; + AvailabilityInformation = availabilityInformation; + HierarchyInformation = hierarchyInformation; + FilterableProperties = filterableProperties; + ProductLines = productLines; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display Name for the product system. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description related to the product system. + /// + [JsonProperty(PropertyName = "properties.description")] + public Description Description { get; private set; } + + /// + /// Gets image information for the product system. + /// + [JsonProperty(PropertyName = "properties.imageInformation")] + public IList ImageInformation { get; private set; } + + /// + /// Gets cost information for the product system. + /// + [JsonProperty(PropertyName = "properties.costInformation")] + public CostInformation CostInformation { get; private set; } + + /// + /// Gets availability information of the product system. + /// + [JsonProperty(PropertyName = "properties.availabilityInformation")] + public AvailabilityInformation AvailabilityInformation { get; private set; } + + /// + /// Gets hierarchy information of a product. + /// + [JsonProperty(PropertyName = "properties.hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; private set; } + + /// + /// Gets list of filters supported for a product + /// + [JsonProperty(PropertyName = "properties.filterableProperties")] + public IList FilterableProperties { get; private set; } + + /// + /// Gets list of product lines supported in the product family + /// + [JsonProperty(PropertyName = "properties.productLines")] + public IList ProductLines { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductLine.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductLine.cs new file mode 100644 index 0000000000000..cc40a5e64d03a --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProductLine.cs @@ -0,0 +1,119 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Product line + /// + [Rest.Serialization.JsonTransformation] + public partial class ProductLine + { + /// + /// Initializes a new instance of the ProductLine class. + /// + public ProductLine() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProductLine class. + /// + /// Display Name for the product + /// system. + /// Description related to the product + /// system. + /// Image information for the product + /// system. + /// Cost information for the product + /// system. + /// Availability information of + /// the product system. + /// Hierarchy information of a + /// product. + /// list of filters supported for a + /// product + /// List of products in the product line + public ProductLine(string displayName = default(string), Description description = default(Description), IList imageInformation = default(IList), CostInformation costInformation = default(CostInformation), AvailabilityInformation availabilityInformation = default(AvailabilityInformation), HierarchyInformation hierarchyInformation = default(HierarchyInformation), IList filterableProperties = default(IList), IList products = default(IList)) + { + DisplayName = displayName; + Description = description; + ImageInformation = imageInformation; + CostInformation = costInformation; + AvailabilityInformation = availabilityInformation; + HierarchyInformation = hierarchyInformation; + FilterableProperties = filterableProperties; + Products = products; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets display Name for the product system. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets description related to the product system. + /// + [JsonProperty(PropertyName = "properties.description")] + public Description Description { get; private set; } + + /// + /// Gets image information for the product system. + /// + [JsonProperty(PropertyName = "properties.imageInformation")] + public IList ImageInformation { get; private set; } + + /// + /// Gets cost information for the product system. + /// + [JsonProperty(PropertyName = "properties.costInformation")] + public CostInformation CostInformation { get; private set; } + + /// + /// Gets availability information of the product system. + /// + [JsonProperty(PropertyName = "properties.availabilityInformation")] + public AvailabilityInformation AvailabilityInformation { get; private set; } + + /// + /// Gets hierarchy information of a product. + /// + [JsonProperty(PropertyName = "properties.hierarchyInformation")] + public HierarchyInformation HierarchyInformation { get; private set; } + + /// + /// Gets list of filters supported for a product + /// + [JsonProperty(PropertyName = "properties.filterableProperties")] + public IList FilterableProperties { get; private set; } + + /// + /// Gets list of products in the product line + /// + [JsonProperty(PropertyName = "properties.products")] + public IList Products { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProxyResource.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProxyResource.cs new file mode 100644 index 0000000000000..5ea4896accaf1 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ProxyResource.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using System.Linq; + + /// + /// Proxy Resource + /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/PurchaseMeterDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/PurchaseMeterDetails.cs new file mode 100644 index 0000000000000..15f20a5144240 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/PurchaseMeterDetails.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Billing type Purchase meter details + /// + [Newtonsoft.Json.JsonObject("Purchase")] + public partial class PurchaseMeterDetails : MeterDetails + { + /// + /// Initializes a new instance of the PurchaseMeterDetails class. + /// + public PurchaseMeterDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PurchaseMeterDetails class. + /// + /// Billing unit applicable for Pav2 + /// billing + /// Charging type. Possible values include: + /// 'PerOrder', 'PerDevice' + /// Product Id + /// Sku Id + /// Term Id + public PurchaseMeterDetails(double? multiplier = default(double?), string chargingType = default(string), string productId = default(string), string skuId = default(string), string termId = default(string)) + : base(multiplier, chargingType) + { + ProductId = productId; + SkuId = skuId; + TermId = termId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets product Id + /// + [JsonProperty(PropertyName = "productId")] + public string ProductId { get; private set; } + + /// + /// Gets sku Id + /// + [JsonProperty(PropertyName = "skuId")] + public string SkuId { get; private set; } + + /// + /// Gets term Id + /// + [JsonProperty(PropertyName = "termId")] + public string TermId { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Resource.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Resource.cs new file mode 100644 index 0000000000000..8a0c6049ffca3 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Resource.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public Resource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ResourceIdentity.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ResourceIdentity.cs new file mode 100644 index 0000000000000..201627174fe6b --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ResourceIdentity.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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Msi identity details of the resource + /// + public partial class ResourceIdentity + { + /// + /// Initializes a new instance of the ResourceIdentity class. + /// + public ResourceIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceIdentity class. + /// + /// Identity type + /// Service Principal Id backing the + /// Msi + /// Home Tenant Id + public ResourceIdentity(string type = default(string), string principalId = default(string), string tenantId = default(string)) + { + Type = type; + PrincipalId = principalId; + TenantId = tenantId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets identity type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets service Principal Id backing the Msi + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets home Tenant Id + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ReturnOrderItemDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ReturnOrderItemDetails.cs new file mode 100644 index 0000000000000..b7c38ae11ea61 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ReturnOrderItemDetails.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Return order item request body + /// + public partial class ReturnOrderItemDetails + { + /// + /// Initializes a new instance of the ReturnOrderItemDetails class. + /// + public ReturnOrderItemDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReturnOrderItemDetails class. + /// + /// Return Reason. + /// customer return address. + public ReturnOrderItemDetails(string returnReason, AddressProperties returnAddress = default(AddressProperties)) + { + ReturnAddress = returnAddress; + ReturnReason = returnReason; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets customer return address. + /// + [JsonProperty(PropertyName = "returnAddress")] + public AddressProperties ReturnAddress { get; set; } + + /// + /// Gets or sets return Reason. + /// + [JsonProperty(PropertyName = "returnReason")] + public string ReturnReason { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ReturnReason == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ReturnReason"); + } + if (ReturnAddress != null) + { + ReturnAddress.Validate(); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingAddress.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingAddress.cs new file mode 100644 index 0000000000000..ecec0c8aa94e9 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingAddress.cs @@ -0,0 +1,144 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Shipping address where customer wishes to receive the device. + /// + public partial class ShippingAddress + { + /// + /// Initializes a new instance of the ShippingAddress class. + /// + public ShippingAddress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ShippingAddress class. + /// + /// Street Address line 1. + /// Name of the Country. + /// Street Address line 2. + /// Street Address line 3. + /// Name of the City. + /// Name of the State or + /// Province. + /// Postal code. + /// Extended Zip Code. + /// Name of the company. + /// Type of address. Possible values include: + /// 'None', 'Residential', 'Commercial' + public ShippingAddress(string streetAddress1, string country, string streetAddress2 = default(string), string streetAddress3 = default(string), string city = default(string), string stateOrProvince = default(string), string postalCode = default(string), string zipExtendedCode = default(string), string companyName = default(string), string addressType = default(string)) + { + StreetAddress1 = streetAddress1; + StreetAddress2 = streetAddress2; + StreetAddress3 = streetAddress3; + City = city; + StateOrProvince = stateOrProvince; + Country = country; + PostalCode = postalCode; + ZipExtendedCode = zipExtendedCode; + CompanyName = companyName; + AddressType = addressType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets street Address line 1. + /// + [JsonProperty(PropertyName = "streetAddress1")] + public string StreetAddress1 { get; set; } + + /// + /// Gets or sets street Address line 2. + /// + [JsonProperty(PropertyName = "streetAddress2")] + public string StreetAddress2 { get; set; } + + /// + /// Gets or sets street Address line 3. + /// + [JsonProperty(PropertyName = "streetAddress3")] + public string StreetAddress3 { get; set; } + + /// + /// Gets or sets name of the City. + /// + [JsonProperty(PropertyName = "city")] + public string City { get; set; } + + /// + /// Gets or sets name of the State or Province. + /// + [JsonProperty(PropertyName = "stateOrProvince")] + public string StateOrProvince { get; set; } + + /// + /// Gets or sets name of the Country. + /// + [JsonProperty(PropertyName = "country")] + public string Country { get; set; } + + /// + /// Gets or sets postal code. + /// + [JsonProperty(PropertyName = "postalCode")] + public string PostalCode { get; set; } + + /// + /// Gets or sets extended Zip Code. + /// + [JsonProperty(PropertyName = "zipExtendedCode")] + public string ZipExtendedCode { get; set; } + + /// + /// Gets or sets name of the company. + /// + [JsonProperty(PropertyName = "companyName")] + public string CompanyName { get; set; } + + /// + /// Gets or sets type of address. Possible values include: 'None', + /// 'Residential', 'Commercial' + /// + [JsonProperty(PropertyName = "addressType")] + public string AddressType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StreetAddress1 == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StreetAddress1"); + } + if (Country == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Country"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingDetails.cs new file mode 100644 index 0000000000000..3834a7e431b4e --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/ShippingDetails.cs @@ -0,0 +1,77 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Package shipping details + /// + public partial class ShippingDetails + { + /// + /// Initializes a new instance of the ShippingDetails class. + /// + public ShippingDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ShippingDetails class. + /// + /// Name of the carrier. + /// Carrier Name for display purpose. + /// Not to be used for any processing. + /// TrackingId of the package + /// TrackingUrl of the package. + public ShippingDetails(string carrierName = default(string), string carrierDisplayName = default(string), string trackingId = default(string), string trackingUrl = default(string)) + { + CarrierName = carrierName; + CarrierDisplayName = carrierDisplayName; + TrackingId = trackingId; + TrackingUrl = trackingUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the carrier. + /// + [JsonProperty(PropertyName = "carrierName")] + public string CarrierName { get; private set; } + + /// + /// Gets carrier Name for display purpose. Not to be used for any + /// processing. + /// + [JsonProperty(PropertyName = "carrierDisplayName")] + public string CarrierDisplayName { get; private set; } + + /// + /// Gets trackingId of the package + /// + [JsonProperty(PropertyName = "trackingId")] + public string TrackingId { get; private set; } + + /// + /// Gets trackingUrl of the package. + /// + [JsonProperty(PropertyName = "trackingUrl")] + public string TrackingUrl { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Specification.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Specification.cs new file mode 100644 index 0000000000000..3c4068b0ed926 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/Specification.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifications of the configurations + /// + public partial class Specification + { + /// + /// Initializes a new instance of the Specification class. + /// + public Specification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Specification class. + /// + /// Name of the specification + /// Value of the specification + public Specification(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the specification + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets value of the specification + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageDetails.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageDetails.cs new file mode 100644 index 0000000000000..6af8a085d714b --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageDetails.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource stage details. + /// + public partial class StageDetails + { + /// + /// Initializes a new instance of the StageDetails class. + /// + public StageDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StageDetails class. + /// + /// Stage status. Possible values include: + /// 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', + /// 'Cancelling' + /// Stage name. Possible values include: + /// 'Placed', 'InReview', 'Confirmed', 'ReadyToShip', 'Shipped', + /// 'Delivered', 'InUse', 'ReturnInitiated', 'ReturnPickedUp', + /// 'ReturnedToMicrosoft', 'ReturnCompleted', 'Cancelled' + /// Display name of the resource + /// stage. + /// Stage start time + public StageDetails(string stageStatus = default(string), string stageName = default(string), string displayName = default(string), System.DateTime? startTime = default(System.DateTime?)) + { + StageStatus = stageStatus; + StageName = stageName; + DisplayName = displayName; + StartTime = startTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets stage status. Possible values include: 'None', 'InProgress', + /// 'Succeeded', 'Failed', 'Cancelled', 'Cancelling' + /// + [JsonProperty(PropertyName = "stageStatus")] + public string StageStatus { get; private set; } + + /// + /// Gets stage name. Possible values include: 'Placed', 'InReview', + /// 'Confirmed', 'ReadyToShip', 'Shipped', 'Delivered', 'InUse', + /// 'ReturnInitiated', 'ReturnPickedUp', 'ReturnedToMicrosoft', + /// 'ReturnCompleted', 'Cancelled' + /// + [JsonProperty(PropertyName = "stageName")] + public string StageName { get; private set; } + + /// + /// Gets display name of the resource stage. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets stage start time + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; private set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageName.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageName.cs new file mode 100644 index 0000000000000..570232f79ca59 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageName.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.EdgeOrder.Models +{ + + /// + /// Defines values for StageName. + /// + public static class StageName + { + /// + /// Currently in draft mode and can still be cancelled + /// + public const string Placed = "Placed"; + /// + /// Order is currently in draft mode and can still be cancelled + /// + public const string InReview = "InReview"; + /// + /// Order is confirmed + /// + public const string Confirmed = "Confirmed"; + /// + /// Order is ready to ship + /// + public const string ReadyToShip = "ReadyToShip"; + /// + /// Order is in transit to customer + /// + public const string Shipped = "Shipped"; + /// + /// Order is delivered to customer + /// + public const string Delivered = "Delivered"; + /// + /// Order is in use at customer site + /// + public const string InUse = "InUse"; + /// + /// Return has been initiated by customer. + /// + public const string ReturnInitiated = "ReturnInitiated"; + /// + /// Order is in transit from customer to microsoft. + /// + public const string ReturnPickedUp = "ReturnPickedUp"; + /// + /// Order has been received back to microsoft. + /// + public const string ReturnedToMicrosoft = "ReturnedToMicrosoft"; + /// + /// Return has now completed. + /// + public const string ReturnCompleted = "ReturnCompleted"; + /// + /// Order has been cancelled. + /// + public const string Cancelled = "Cancelled"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageStatus.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageStatus.cs new file mode 100644 index 0000000000000..f8c0bdd6136f0 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/StageStatus.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for StageStatus. + /// + public static class StageStatus + { + /// + /// No status available yet. + /// + public const string None = "None"; + /// + /// Stage is in progress. + /// + public const string InProgress = "InProgress"; + /// + /// Stage has succeeded. + /// + public const string Succeeded = "Succeeded"; + /// + /// Stage has failed. + /// + public const string Failed = "Failed"; + /// + /// Stage has been cancelled. + /// + public const string Cancelled = "Cancelled"; + /// + /// Stage is cancelling. + /// + public const string Cancelling = "Cancelling"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SupportedFilterTypes.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SupportedFilterTypes.cs new file mode 100644 index 0000000000000..8af164ad48251 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SupportedFilterTypes.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for SupportedFilterTypes. + /// + public static class SupportedFilterTypes + { + /// + /// Ship to country + /// + public const string ShipToCountries = "ShipToCountries"; + /// + /// Double encryption status + /// + public const string DoubleEncryptionStatus = "DoubleEncryptionStatus"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SystemData.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..31ca98a7c1054 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.EdgeOrder.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TrackedResource.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TrackedResource.cs new file mode 100644 index 0000000000000..1473c0882e755 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TrackedResource.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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Tracked Resource + /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + Tags = tags; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { 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/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportPreferences.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportPreferences.cs new file mode 100644 index 0000000000000..184c010948cd2 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportPreferences.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Preferences related to the shipment logistics of the sku + /// + public partial class TransportPreferences + { + /// + /// Initializes a new instance of the TransportPreferences class. + /// + public TransportPreferences() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TransportPreferences class. + /// + /// Indicates Shipment Logistics + /// type that the customer preferred. Possible values include: + /// 'CustomerManaged', 'MicrosoftManaged' + public TransportPreferences(string preferredShipmentType) + { + PreferredShipmentType = preferredShipmentType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates Shipment Logistics type that the customer + /// preferred. Possible values include: 'CustomerManaged', + /// 'MicrosoftManaged' + /// + [JsonProperty(PropertyName = "preferredShipmentType")] + public string PreferredShipmentType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PreferredShipmentType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PreferredShipmentType"); + } + } + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportShipmentTypes.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportShipmentTypes.cs new file mode 100644 index 0000000000000..0e231cf17ad6c --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/TransportShipmentTypes.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for TransportShipmentTypes. + /// + public static class TransportShipmentTypes + { + /// + /// Shipment Logistics is handled by the customer. + /// + public const string CustomerManaged = "CustomerManaged"; + /// + /// Shipment Logistics is handled by Microsoft. + /// + public const string MicrosoftManaged = "MicrosoftManaged"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/WeightMeasurementUnit.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/WeightMeasurementUnit.cs new file mode 100644 index 0000000000000..9313d77901c4b --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/Models/WeightMeasurementUnit.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights 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.EdgeOrder.Models +{ + + /// + /// Defines values for WeightMeasurementUnit. + /// + public static class WeightMeasurementUnit + { + /// + /// Pounds. + /// + public const string LBS = "LBS"; + /// + /// Kilograms. + /// + public const string KGS = "KGS"; + } +} diff --git a/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/SdkInfo_EdgeOrderManagementClient.cs b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/SdkInfo_EdgeOrderManagementClient.cs new file mode 100644 index 0000000000000..4e1ccc80031d4 --- /dev/null +++ b/sdk/edgeorder/Microsoft.Azure.Management.EdgeOrder/src/Generated/SdkInfo_EdgeOrderManagementClient.cs @@ -0,0 +1,47 @@ + +// +// 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.EdgeOrder +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_EdgeOrderManagementClient + { + get + { + return new Tuple[] + { + new Tuple("EdgeOrder", "CancelOrderItem", "2020-12-01-preview"), + new Tuple("EdgeOrder", "CreateAddress", "2020-12-01-preview"), + new Tuple("EdgeOrder", "CreateOrderItem", "2020-12-01-preview"), + new Tuple("EdgeOrder", "DeleteAddressByName", "2020-12-01-preview"), + new Tuple("EdgeOrder", "DeleteOrderItemByName", "2020-12-01-preview"), + new Tuple("EdgeOrder", "GetAddressByName", "2020-12-01-preview"), + new Tuple("EdgeOrder", "GetOrderByName", "2020-12-01-preview"), + new Tuple("EdgeOrder", "GetOrderItemByName", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListAddressesAtResourceGroupLevel", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListAddressesAtSubscriptionLevel", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListConfigurations", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListOperations", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListOrderAtResourceGroupLevel", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListOrderAtSubscriptionLevel", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListOrderItemsAtResourceGroupLevel", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListOrderItemsAtSubscriptionLevel", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListProductFamilies", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ListProductFamiliesMetadata", "2020-12-01-preview"), + new Tuple("EdgeOrder", "ReturnOrderItem", "2020-12-01-preview"), + new Tuple("EdgeOrder", "UpdateAddress", "2020-12-01-preview"), + new Tuple("EdgeOrder", "UpdateOrderItem", "2020-12-01-preview"), + }.AsEnumerable(); + } + } + } +}